diff --git a/lib/node_modules/@stdlib/strided/base/ternary/README.md b/lib/node_modules/@stdlib/strided/base/ternary/README.md index 9a81169051fb..c209031cf9e1 100644 --- a/lib/node_modules/@stdlib/strided/base/ternary/README.md +++ b/lib/node_modules/@stdlib/strided/base/ternary/README.md @@ -41,12 +41,9 @@ 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' ); -function add( x, y, z ) { - return x + y + z; -} - 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 ] ); @@ -66,12 +63,9 @@ 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' ); -function add( x, y, z ) { - return x + y + z; -} - 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 ] ); @@ -84,12 +78,9 @@ 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' ); -function add( x, y, z ) { - return x + y + z; -} - // 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 ] ); @@ -113,12 +104,9 @@ 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' ); -function add( x, y, z ) { - return x + y + z; -} - 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 ] ); @@ -137,12 +125,9 @@ 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' ); -function add( x, y, z ) { - return x + y + z; -} - 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 ] ); @@ -172,12 +157,9 @@ ternary.ndarray( [ x, y, z, w ], [ 3 ], [ 2, 2, 2, -1 ], [ 1, 1, 1, w.length-1 ] 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' ); -function add( x, y, z ) { - return x + y + z; -} - var N = 10; var x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); diff --git a/lib/node_modules/@stdlib/strided/base/ternary/benchmark/benchmark.js b/lib/node_modules/@stdlib/strided/base/ternary/benchmark/benchmark.js index a536cfbbf974..90f15fd753c2 100644 --- a/lib/node_modules/@stdlib/strided/base/ternary/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/strided/base/ternary/benchmark/benchmark.js @@ -26,6 +26,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var round = require( '@stdlib/math/base/special/round' ); var filledarray = require( '@stdlib/array/filled' ); +var add = require( '@stdlib/math/base/ops/add3' ); var pkg = require( './../package.json' ).name; var ternary = require( './../lib/main.js' ); @@ -37,19 +38,6 @@ var types = [ 'float64' ]; // FUNCTIONS // -/** -* Returns the sum. -* -* @private -* @param {number} x - value -* @param {number} y - value -* @param {number} z - value -* @returns {number} sum -*/ -function add( x, y, z ) { - return x + y + z; -} - /** * Creates a benchmark function. * diff --git a/lib/node_modules/@stdlib/strided/base/ternary/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/strided/base/ternary/benchmark/benchmark.ndarray.js index 2b08f383356b..0f2c90682ab5 100644 --- a/lib/node_modules/@stdlib/strided/base/ternary/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/strided/base/ternary/benchmark/benchmark.ndarray.js @@ -26,6 +26,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var round = require( '@stdlib/math/base/special/round' ); var filledarray = require( '@stdlib/array/filled' ); +var add = require( '@stdlib/math/base/ops/add3' ); var pkg = require( './../package.json' ).name; var ternary = require( './../lib/ndarray.js' ); @@ -37,19 +38,6 @@ var types = [ 'float64' ]; // FUNCTIONS // -/** -* Returns the sum. -* -* @private -* @param {number} x - value -* @param {number} y - value -* @param {number} z - value -* @returns {number} sum -*/ -function add( x, y, z ) { - return x + y + z; -} - /** * Creates a benchmark function. * diff --git a/lib/node_modules/@stdlib/strided/base/ternary/docs/types/index.d.ts b/lib/node_modules/@stdlib/strided/base/ternary/docs/types/index.d.ts index 5910f8458077..6bff2c9adc75 100644 --- a/lib/node_modules/@stdlib/strided/base/ternary/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/strided/base/ternary/docs/types/index.d.ts @@ -45,12 +45,9 @@ interface Routine { * @param fcn - ternary callback * * @example + * var add = require( `@stdlib/math/base/ops/add3` ); * var Float64Array = require( `@stdlib/array/float64` ); * - * function add( x, y, z ) { - * return x + y + z; - * } - * * 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 ] ); @@ -76,12 +73,9 @@ interface Routine { * @param fcn - ternary callback * * @example + * var add = require( `@stdlib/math/base/ops/add3` ); * var Float64Array = require( `@stdlib/array/float64` ); * - * function add( x, y, z ) { - * return x + y + z; - * } - * * 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 ] ); @@ -108,12 +102,9 @@ interface Routine { * @param fcn - ternary callback * * @example +* var add = require( `@stdlib/math/base/ops/add3` ); * var Float64Array = require( `@stdlib/array/float64` ); * -* function add( x, y, z ) { -* return x + y + z; -* } -* * 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 ] ); @@ -128,12 +119,9 @@ interface Routine { * // => [ 3.0, 6.0, 9.0, 12.0, 15.0 ] * * @example +* var add = require( `@stdlib/math/base/ops/add3` ); * var Float64Array = require( `@stdlib/array/float64` ); * -* function add( x, y, z ) { -* return x + y + z; -* } -* * 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 ] ); diff --git a/lib/node_modules/@stdlib/strided/base/ternary/examples/index.js b/lib/node_modules/@stdlib/strided/base/ternary/examples/index.js index 65164c003008..d0c639e7ed3a 100644 --- a/lib/node_modules/@stdlib/strided/base/ternary/examples/index.js +++ b/lib/node_modules/@stdlib/strided/base/ternary/examples/index.js @@ -21,12 +21,9 @@ 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( './../lib' ); -function add( x, y, z ) { - return x + y + z; -} - var N = 10; var x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ); diff --git a/lib/node_modules/@stdlib/strided/base/ternary/lib/index.js b/lib/node_modules/@stdlib/strided/base/ternary/lib/index.js index 0a66d6701f51..fa67a448bab3 100644 --- a/lib/node_modules/@stdlib/strided/base/ternary/lib/index.js +++ b/lib/node_modules/@stdlib/strided/base/ternary/lib/index.js @@ -24,13 +24,10 @@ * @module @stdlib/strided/base/ternary * * @example +* var add = require( '@stdlib/math/base/ops/add3' ); * var Float64Array = require( '@stdlib/array/float64' ); * var ternary = require( '@stdlib/strided/base/ternary' ); * -* function add( x, y, z ) { -* return x + y + z; -* } -* * 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 ] ); @@ -45,13 +42,10 @@ * // => [ 3.0, 6.0, 9.0, 12.0, 15.0 ] * * @example +* var add = require( '@stdlib/math/base/ops/add3' ); * var Float64Array = require( '@stdlib/array/float64' ); * var ternary = require( '@stdlib/strided/base/ternary' ); * -* function add( x, y, z ) { -* return x + y + z; -* } -* * 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 ] ); diff --git a/lib/node_modules/@stdlib/strided/base/ternary/lib/main.js b/lib/node_modules/@stdlib/strided/base/ternary/lib/main.js index c09441324ca6..e23849bcdae1 100644 --- a/lib/node_modules/@stdlib/strided/base/ternary/lib/main.js +++ b/lib/node_modules/@stdlib/strided/base/ternary/lib/main.js @@ -30,12 +30,9 @@ * @returns {void} * * @example +* var add = require( '@stdlib/math/base/ops/add3' ); * var Float64Array = require( '@stdlib/array/float64' ); * -* function add( x, y, z ) { -* return x + y + z; -* } -* * 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 ] ); diff --git a/lib/node_modules/@stdlib/strided/base/ternary/lib/ndarray.js b/lib/node_modules/@stdlib/strided/base/ternary/lib/ndarray.js index d3d1d236dc3c..a0ef5747b977 100644 --- a/lib/node_modules/@stdlib/strided/base/ternary/lib/ndarray.js +++ b/lib/node_modules/@stdlib/strided/base/ternary/lib/ndarray.js @@ -31,12 +31,9 @@ * @returns {void} * * @example +* var add = require( '@stdlib/math/base/ops/add3' ); * var Float64Array = require( '@stdlib/array/float64' ); * -* function add( x, y, z ) { -* return x + y + z; -* } -* * 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 ] ); diff --git a/lib/node_modules/@stdlib/strided/base/ternary/test/fixtures/add.js b/lib/node_modules/@stdlib/strided/base/ternary/test/fixtures/add.js deleted file mode 100644 index 9d26e31122d7..000000000000 --- a/lib/node_modules/@stdlib/strided/base/ternary/test/fixtures/add.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2020 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Returns the sum. -* -* @private -* @param {number} x - value -* @param {number} y - value -* @param {number} z - value -* @returns {number} sum -*/ -function add( x, y, z ) { - return x + y + z; -} - - -// EXPORTS // - -module.exports = add; diff --git a/lib/node_modules/@stdlib/strided/base/ternary/test/test.main.js b/lib/node_modules/@stdlib/strided/base/ternary/test/test.main.js index fce3765ec53b..e509901f4974 100644 --- a/lib/node_modules/@stdlib/strided/base/ternary/test/test.main.js +++ b/lib/node_modules/@stdlib/strided/base/ternary/test/test.main.js @@ -23,14 +23,10 @@ var tape = require( 'tape' ); var floor = require( '@stdlib/math/base/special/floor' ); var Float64Array = require( '@stdlib/array/float64' ); +var add = require( '@stdlib/math/base/ops/add3' ); var ternary = require( './../lib/main.js' ); -// FIXTURES // - -var add = require( './fixtures/add.js' ); - - // TESTS // tape( 'main export is a function', function test( t ) { diff --git a/lib/node_modules/@stdlib/strided/base/ternary/test/test.ndarray.js b/lib/node_modules/@stdlib/strided/base/ternary/test/test.ndarray.js index 9ea8956a69bb..2c0ba960dd79 100644 --- a/lib/node_modules/@stdlib/strided/base/ternary/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/strided/base/ternary/test/test.ndarray.js @@ -24,14 +24,10 @@ var tape = require( 'tape' ); var Float64Array = require( '@stdlib/array/float64' ); +var add = require( '@stdlib/math/base/ops/add3' ); var ternary = require( './../lib/ndarray.js' ); -// FIXTURES // - -var add = require( './fixtures/add.js' ); - - // TESTS // tape( 'main export is a function', function test( t ) {