diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/README.md new file mode 100644 index 000000000000..9c4156868a1f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/README.md @@ -0,0 +1,138 @@ + + +# gapx + +> Add a scalar constant to each element in a one-dimensional ndarray. + +
+ +## Usage + +```javascript +var gapx = require( '@stdlib/blas/ext/base/ndarray/gapx' ); +``` + +#### gapx( arrays ) + +Adds a scalar constant to each element in a one-dimensional ndarray. + +```javascript +var ndarray = require( '@stdlib/ndarray/ctor' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); + +var xbuf = [ 1.0, 2.0, 3.0, 4.0 ]; +var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + +var alpha = scalar2ndarray( 5.0, { + 'dtype': 'generic' +}); + +var out = gapx( [ x, alpha ] ); +// returns [ 6, 7, 8, 9 ] + +var bool = ( out === x ); +// returns true + +var arr = ndarray2array( out ); +// returns [ 6, 7, 8, 9 ] +``` + +The function has the following parameters: + +- **arrays**: array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray containing a scalar constant. + +```javascript +var ndarray = require( '@stdlib/ndarray/ctor' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + +// Initial array: +var xbuf = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + +// Create an ndarray view: +var x = new ndarray( 'generic', xbuf, [ 3 ], [ 1 ], 2, 'row-major' ); +var alpha = scalar2ndarray( 5.0, { + 'dtype': 'generic' +}); +var out = gapx( [ x, alpha ] ); +// returns [ 8, 9, 10 ] +``` + +
+ + + +
+ +## Notes + +- The function supports generic arrays and typed arrays. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var gapx = require( '@stdlib/blas/ext/base/ndarray/gapx' ); + +var xbuf = discreteUniform( 10, 0, 100, { + 'dtype': 'generic' +}); +var x = new ndarray( 'generic', xbuf, [ 10 ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +var alpha = scalar2ndarray( 5.0, { + 'dtype': 'generic' +}); + +gapx( [ x, alpha ] ); +console.log( ndarray2array( x ) ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/benchmark/benchmark.js new file mode 100644 index 000000000000..cb75d033c53a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/benchmark/benchmark.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var gapx = require( './../lib' ); + + +// VARIABLES // + +var options = { + 'dtype': 'generic' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var alpha; + var xbuf; + var x; + + xbuf = discreteUniform( len, -100, 100, options ); + x = new ndarray( options.dtype, xbuf, [ len ], [ 1 ], 0, 'row-major' ); + alpha = scalar2ndarray( 5.0, options ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = gapx( [ x, alpha ] ); + if ( typeof z !== 'object' ) { + b.fail( 'should return an ndarray' ); + } + } + b.toc(); + if ( typeof z !== 'object' ) { + b.fail( 'should return an ndarray' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/docs/repl.txt new file mode 100644 index 000000000000..ac96e86bdd98 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/docs/repl.txt @@ -0,0 +1,28 @@ + +{{alias}}( arrays ) + Adds a scalar constant to each element in a one-dimensional ndarray. + + Parameters + ---------- + arrays: ArrayLikeObject + Array-like object containing a one-dimensional input ndarray and a + zero-dimensional ndarray containing a scalar constant. + + Returns + ------- + out: ndarray + Input ndarray. + + Examples + -------- + > var xbuf = [ 1.0, 2.0, 3.0, 4.0 ]; + > var x = {{alias:@stdlib/ndarray/ctor}}( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + > var alpha = {{alias:@stdlib/ndarray/from-scalar}}( 5.0, { 'dtype': 'generic' } ); + > {{alias}}( [ x, alpha ] ) + [ 6, 7, 8, 9 ] + > var data = x.data + [ 6, 7, 8, 9 ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/docs/types/index.d.ts new file mode 100644 index 000000000000..d3dcd3089d4d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/docs/types/index.d.ts @@ -0,0 +1,54 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { ndarray } from '@stdlib/types/ndarray'; + +/** +* Adds a scalar constant to each element in a one-dimensional ndarray. +* +* @param arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray containing a scalar constant +* @returns input ndarray +* +* @example +* var ndarray = require( '@stdlib/ndarray/ctor' ); +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* var ndarray2array = require( '@stdlib/ndarray/to-array' ); +* +* var xbuf = [ 1.0, 2.0, 3.0, 4.0 ]; +* var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); +* +* var alpha = scalar2ndarray( 5.0, { +* 'dtype': 'generic' +* }); +* +* var out = gapx( [ x, alpha ] ); +* // returns +* +* var arr = ndarray2array( out ); +* // returns [ 6, 7, 8, 9 ] +*/ +declare function gapx( arrays: [ ndarray, ndarray ] ): ndarray; + + +// EXPORTS // + +export = gapx; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/docs/types/test.ts new file mode 100644 index 000000000000..b3a1de9964bf --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/docs/types/test.ts @@ -0,0 +1,53 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import zeros = require( '@stdlib/ndarray/base/zeros' ); +import scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +import gapx = require( './index' ); + + +// TESTS // + +// The function returns an ndarray... +{ + const x = zeros( 'generic', [ 3 ], 'row-major' ); + const alpha = scalar2ndarray( 5.0, { 'dtype': 'generic' } ); + gapx( [ x, alpha ] ); // $ExpectType ndarray +} + +// The compiler throws an error if the function is provided a first argument which is not an array-like object containing ndarrays... +{ + const alpha = scalar2ndarray( 5.0, { 'dtype': 'generic' } ); + gapx( 123 ); // $ExpectError + gapx( true ); // $ExpectError + gapx( false ); // $ExpectError + gapx( null ); // $ExpectError + gapx( undefined ); // $ExpectError + gapx( '5' ); // $ExpectError + gapx( [ '1', '2' ] ); // $ExpectError + gapx( {} ); // $ExpectError + gapx( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = zeros( 'generic', [ 3 ], 'row-major' ); + const alpha = scalar2ndarray( 5.0, { 'dtype': 'generic' } ); + gapx(); // $ExpectError + gapx( [ x, alpha ], 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/examples/index.js new file mode 100644 index 000000000000..ea189e30179a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/examples/index.js @@ -0,0 +1,43 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var gapx = require( './../lib' ); + + +// MAIN // + +var xbuf = discreteUniform( 10, 0, 100, { + 'dtype': 'generic' +}); +var x = new ndarray( 'generic', xbuf, [ 10 ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +var alpha = scalar2ndarray( 5.0, { + 'dtype': 'generic' +}); + +gapx( [ x, alpha ] ); +console.log( ndarray2array( x ) ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/lib/index.js new file mode 100644 index 000000000000..c52de49b34b5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/lib/index.js @@ -0,0 +1,53 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Add a scalar constant to each element in a one-dimensional ndarray. +* +* @module @stdlib/blas/ext/base/ndarray/gapx +* +* @example +* var ndarray = require( '@stdlib/ndarray/ctor' ); +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* var ndarray2array = require( '@stdlib/ndarray/to-array' ); +* var gapx = require( '@stdlib/blas/ext/base/ndarray/gapx' ); +* +* var xbuf = [ 1.0, 2.0, 3.0, 4.0 ]; +* var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); +* +* var alpha = scalar2ndarray( 5.0, { +* 'dtype': 'generic' +* }); +* +* var out = gapx( [ x, alpha ] ); +* // returns +* +* var arr = ndarray2array( out ); +* // returns [ 6, 7, 8, 9 ] +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/lib/main.js new file mode 100644 index 000000000000..6bbb2d3ed40d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/lib/main.js @@ -0,0 +1,67 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); +var strided = require( '@stdlib/blas/ext/base/gapx' ).ndarray; +var getStride = require( '@stdlib/ndarray/base/stride' ); +var getOffset = require( '@stdlib/ndarray/base/offset' ); +var getData = require( '@stdlib/ndarray/base/data-buffer' ); +var ndarraylike2scalar = require( '@stdlib/ndarray/base/ndarraylike2scalar' ); + + +// MAIN // + +/** +* Adds a scalar constant to each element in a one-dimensional ndarray. +* +* @param {ArrayLikeObject} arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray containing a scalar constant +* @returns {ndarray} input ndarray +* +* @example +* var ndarray = require( '@stdlib/ndarray/ctor' ); +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* var ndarray2array = require( '@stdlib/ndarray/to-array' ); +* +* var xbuf = [ 1.0, 2.0, 3.0, 4.0 ]; +* var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); +* +* var alpha = scalar2ndarray( 5.0, { +* 'dtype': 'generic' +* }); +* +* var out = gapx( [ x, alpha ] ); +* // returns +* +* var arr = ndarray2array( out ); +* // returns [ 6, 7, 8, 9 ] +*/ +function gapx( arrays ) { + var x = arrays[ 0 ]; + + strided( numelDimension( x, 0 ), ndarraylike2scalar( arrays[ 1 ] ), getData( x ), getStride( x, 0 ), getOffset( x ) ); // eslint-disable-line max-len + return x; +} + + +// EXPORTS // + +module.exports = gapx; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/package.json b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/package.json new file mode 100644 index 000000000000..95064334ef22 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/package.json @@ -0,0 +1,74 @@ +{ + "name": "@stdlib/blas/ext/base/ndarray/gapx", + "version": "0.0.0", + "description": "Add a scalar constant to each element in a one-dimensional ndarray.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "level 1", + "gapx", + "linear", + "algebra", + "subroutines", + "ndarray", + "vector", + "array", + "multidimensional", + "add", + "constant", + "plus", + "increment", + "augment", + "generic" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/test/test.js new file mode 100644 index 000000000000..f0f31b59d4fe --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/gapx/test/test.js @@ -0,0 +1,115 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var getData = require( '@stdlib/ndarray/base/data-buffer' ); +var gapx = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gapx, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function adds a scalar constant to each element in an ndarray', function test( t ) { + var expected; + var alpha; + var xbuf; + var x; + xbuf = [ 1.0, 2.0, 3.0, 4.0 ]; + x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + expected = [ 6, 7, 8, 9 ]; + alpha = scalar2ndarray( 5.0, { + 'dtype': 'generic' + }); + gapx( [ x, alpha ] ); + t.deepEqual( getData( x ), expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns the input ndarray', function test( t ) { + var alpha; + var xbuf; + var x; + var y; + xbuf = [ 1.0, 2.0, 3.0, 4.0 ]; + x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + alpha = scalar2ndarray( 5.0, { + 'dtype': 'generic' + }); + y = gapx( [ x, alpha ] ); + t.strictEqual( y, x, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports ndarrays with negative strides', function test( t ) { + var expected; + var alpha; + var xbuf; + var x; + xbuf = [ 1.0, 2.0, 3.0, 4.0 ]; + x = new ndarray( 'generic', xbuf, [ 4 ], [ -1 ], 3, 'row-major' ); + expected = [ 6, 7, 8, 9 ]; + alpha = scalar2ndarray( 5.0, { + 'dtype': 'generic' + }); + gapx( [ x, alpha ] ); + t.deepEqual( getData( x ), expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports ndarrays with non-zero offsets', function test( t ) { + var expected; + var alpha; + var xbuf; + var x; + xbuf = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + x = new ndarray( 'generic', xbuf, [ 3 ], [ 1 ], 2, 'row-major' ); + expected = [ 1, 2, 8, 9, 10 ]; + alpha = scalar2ndarray( 5.0, { + 'dtype': 'generic' + }); + gapx( [ x, alpha ] ); + t.deepEqual( getData( x ), expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports zero-length ndarrays', function test( t ) { + var expected; + var alpha; + var xbuf; + var x; + xbuf = []; + x = new ndarray( 'generic', xbuf, [ 0 ], [ 1 ], 0, 'row-major' ); + expected = []; + alpha = scalar2ndarray( 5.0, { + 'dtype': 'generic' + }); + gapx( [ x, alpha ] ); + t.deepEqual( getData( x ), expected, 'returns expected value' ); + t.end(); +});