diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/README.md new file mode 100644 index 000000000000..b45ba7e79865 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/README.md @@ -0,0 +1,122 @@ + + +# dsome + +> Test whether a one-dimensional double-precision floating-point ndarray contains at least `k` truthy elements. + +
+ +
+ + + +
+ +## Usage + +```javascript +var dsome = require( '@stdlib/blas/ext/base/ndarray/dsome' ); +``` + +#### dsome( arrays ) + +Tests whether a one-dimensional double-precision floating-point ndarray contains at least `k` truthy elements. + +```javascript +var Float64Vector = require( '@stdlib/ndarray/vector/float64' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + +var x = new Float64Vector( [ 0.0, 0.0, 1.0, 2.0 ] ); + +var k = scalar2ndarray( 2, { + 'dtype': 'generic' +}); + +var v = dsome( [ x, k ] ); +// returns true +``` + +The function has the following parameters: + +- **arrays**: array-like object containing the following ndarrays: + + - a one-dimensional input ndarray. + - a zero-dimensional ndarray specifying the minimum number of truthy elements. + +
+ + + +
+ +## Notes + +- If provided an empty one-dimensional ndarray, the function returns `false`. +- The function explicitly treats `NaN` values as falsy. + +
+ + + +
+ +## Examples + + + +```javascript +var bernoulli = require( '@stdlib/random/bernoulli' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var dsome = require( '@stdlib/blas/ext/base/ndarray/dsome' ); + +var x = bernoulli( [ 10 ], 0.3, { + 'dtype': 'float64' +}); +console.log( ndarray2array( x ) ); + +var k = scalar2ndarray( 3, { + 'dtype': 'generic' +}); + +var v = dsome( [ x, k ] ); +console.log( v ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/benchmark/benchmark.js new file mode 100644 index 000000000000..9429108d1681 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/benchmark/benchmark.js @@ -0,0 +1,107 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 zeros = require( '@stdlib/ndarray/zeros' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dsome = require( './../lib' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = zeros( [ len ], options ); + var k = scalar2ndarray( floor( len / 2 ), { + 'dtype': 'generic' + }); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var out; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + out = dsome( [ x, k ] ); + if ( typeof out !== 'boolean' ) { + b.fail( 'should return a boolean' ); + } + } + b.toc(); + if ( typeof out !== 'boolean' ) { + b.fail( 'should return a boolean' ); + } + 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/dsome/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/docs/repl.txt new file mode 100644 index 000000000000..c302e179be1e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/docs/repl.txt @@ -0,0 +1,33 @@ + +{{alias}}( arrays ) + Tests whether a one-dimensional double-precision floating-point ndarray + contains at least `k` truthy elements. + + If provided an empty ndarray, the function returns `false`. + + The function explicitly treats `NaN` values as falsy. + + Parameters + ---------- + arrays: ArrayLikeObject + Array-like object containing the following ndarrays: + + - a one-dimensional input ndarray. + - a zero-dimensional ndarray specifying the minimum number of truthy + elements. + + Returns + ------- + bool: boolean + Boolean indicating whether the input ndarray contains at least `k` + truthy elements. + + Examples + -------- + > var x = new {{alias:@stdlib/ndarray/vector/float64}}( [ 0.0, 0.0, 1.0, 2.0 ] ); + > var k = {{alias:@stdlib/ndarray/from-scalar}}( 2, { 'dtype': 'generic' } ); + > {{alias}}( [ x, k ] ) + true + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/docs/types/index.d.ts new file mode 100644 index 000000000000..0c765cf184ff --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/docs/types/index.d.ts @@ -0,0 +1,58 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 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 { float64ndarray, typedndarray } from '@stdlib/types/ndarray'; + +/** +* Tests whether a one-dimensional double-precision floating-point ndarray contains at least `k` truthy elements. +* +* ## Notes +* +* - The function expects the following ndarrays: +* +* - a one-dimensional input ndarray. +* - a zero-dimensional ndarray specifying the minimum number of truthy elements. +* +* - The function explicitly treats `NaN` values as falsy. +* +* @param arrays - array-like object containing ndarrays +* @returns boolean indicating whether the input ndarray contains at least `k` truthy elements +* +* @example +* var Float64Vector = require( '@stdlib/ndarray/vector/float64' ); +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* +* var x = new Float64Vector( [ 0.0, 0.0, 1.0, 2.0 ] ); +* +* var k = scalar2ndarray( 2, { +* 'dtype': 'generic' +* }); +* +* var v = dsome( [ x, k ] ); +* // returns true +*/ +declare function dsome( arrays: [ float64ndarray, typedndarray ] ): boolean; + + +// EXPORTS // + +export = dsome; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/docs/types/test.ts new file mode 100644 index 000000000000..c55e2b6b408d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/docs/types/test.ts @@ -0,0 +1,64 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 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. +*/ + +/* eslint-disable space-in-parens */ + +import zeros = require( '@stdlib/ndarray/zeros' ); +import scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +import dsome = require( './index' ); + + +// TESTS // + +// The function returns a boolean... +{ + const x = zeros( [ 10 ], { + 'dtype': 'float64' + }); + const k = scalar2ndarray( 2, { + 'dtype': 'generic' + }); + + dsome( [ x, k ] ); // $ExpectType boolean +} + +// The compiler throws an error if the function is provided a first argument which is not an array of ndarrays... +{ + dsome( '10' ); // $ExpectError + dsome( 10 ); // $ExpectError + dsome( true ); // $ExpectError + dsome( false ); // $ExpectError + dsome( null ); // $ExpectError + dsome( undefined ); // $ExpectError + dsome( [] ); // $ExpectError + dsome( {} ); // $ExpectError + dsome( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = zeros( [ 10 ], { + 'dtype': 'float64' + }); + const k = scalar2ndarray( 2, { + 'dtype': 'generic' + }); + + dsome(); // $ExpectError + dsome( [ x, k ], {} ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/examples/index.js new file mode 100644 index 000000000000..56f1844e8cde --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/examples/index.js @@ -0,0 +1,36 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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'; + +var bernoulli = require( '@stdlib/random/bernoulli' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var dsome = require( './../lib' ); + +var x = bernoulli( [ 10 ], 0.3, { + 'dtype': 'float64' +}); +console.log( ndarray2array( x ) ); + +var k = scalar2ndarray( 3, { + 'dtype': 'generic' +}); + +var v = dsome( [ x, k ] ); +console.log( v ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/lib/index.js new file mode 100644 index 000000000000..b3da4aadcc3a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/lib/index.js @@ -0,0 +1,48 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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'; + +/** +* Test whether a one-dimensional double-precision floating-point ndarray contains at least `k` truthy elements. +* +* @module @stdlib/blas/ext/base/ndarray/dsome +* +* @example +* var Float64Vector = require( '@stdlib/ndarray/vector/float64' ); +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* var dsome = require( '@stdlib/blas/ext/base/ndarray/dsome' ); +* +* var x = new Float64Vector( [ 0.0, 0.0, 1.0, 2.0 ] ); +* +* var k = scalar2ndarray( 2, { +* 'dtype': 'generic' +* }); +* +* var v = dsome( [ x, k ] ); +* // returns true +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/lib/main.js new file mode 100644 index 000000000000..79b68f9c1a7a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/lib/main.js @@ -0,0 +1,70 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 ndarraylike2scalar = require( '@stdlib/ndarray/base/ndarraylike2scalar' ); +var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); +var getStride = require( '@stdlib/ndarray/base/stride' ); +var getOffset = require( '@stdlib/ndarray/base/offset' ); +var getData = require( '@stdlib/ndarray/base/data-buffer' ); +var strided = require( '@stdlib/blas/ext/base/dsome' ).ndarray; + + +// MAIN // + +/** +* Tests whether a one-dimensional double-precision floating-point ndarray contains at least `k` truthy elements. +* +* ## Notes +* +* - The function expects the following ndarrays: +* +* - a one-dimensional input ndarray. +* - a zero-dimensional ndarray specifying the minimum number of truthy elements. +* +* - The function explicitly treats `NaN` values as falsy. +* +* @param {ArrayLikeObject} arrays - array-like object containing ndarrays +* @returns {boolean} boolean indicating whether the input ndarray contains at least `k` truthy elements +* +* @example +* var Float64Vector = require( '@stdlib/ndarray/vector/float64' ); +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* +* var x = new Float64Vector( [ 0.0, 0.0, 1.0, 2.0 ] ); +* +* var k = scalar2ndarray( 2, { +* 'dtype': 'generic' +* }); +* +* var v = dsome( [ x, k ] ); +* // returns true +*/ +function dsome( arrays ) { + var x = arrays[ 0 ]; + var k = ndarraylike2scalar( arrays[ 1 ] ); + return strided( numelDimension( x, 0 ), k, getData( x ), getStride( x, 0 ), getOffset( x ) ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = dsome; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/package.json b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/package.json new file mode 100644 index 000000000000..49ddbfee7caa --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/package.json @@ -0,0 +1,69 @@ +{ + "name": "@stdlib/blas/ext/base/ndarray/dsome", + "version": "0.0.0", + "description": "Test whether a one-dimensional double-precision floating-point ndarray contains at least `k` truthy elements.", + "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", + "extended", + "some", + "dsome", + "truthy", + "test", + "boolean", + "ndarray", + "float64", + "double-precision", + "float64array" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/test/test.js new file mode 100644 index 000000000000..238999713229 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dsome/test/test.js @@ -0,0 +1,186 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 Float64Array = require( '@stdlib/array/float64' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var dsome = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Returns a one-dimensional ndarray. +* +* @private +* @param {Float64Array} buffer - underlying data buffer +* @param {NonNegativeInteger} length - number of indexed elements +* @param {integer} stride - stride length +* @param {NonNegativeInteger} offset - index offset +* @returns {ndarray} one-dimensional ndarray +*/ +function vector( buffer, length, stride, offset ) { + return new ndarray( 'float64', buffer, [ length ], [ stride ], offset, 'row-major' ); +} + +/** +* Returns a zero-dimensional ndarray. +* +* @private +* @param {integer} k - minimum number of truthy elements +* @returns {ndarray} zero-dimensional ndarray +*/ +function scalar( k ) { + return scalar2ndarray( k, { + 'dtype': 'generic' + }); +} + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dsome, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 1', function test( t ) { + t.strictEqual( dsome.length, 1, 'has expected arity' ); + t.end(); +}); + +tape( 'the function tests whether a one-dimensional ndarray contains at least `k` truthy elements', function test( t ) { + var x; + var v; + + x = new Float64Array( [ 0.0, 0.0, 1.0, 2.0 ] ); + v = dsome( [ vector( x, 4, 1, 0 ), scalar( 2 ) ] ); + t.strictEqual( v, true, 'returns expected value' ); + + x = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + v = dsome( [ vector( x, 4, 1, 0 ), scalar( 1 ) ] ); + t.strictEqual( v, false, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + v = dsome( [ vector( x, 4, 1, 0 ), scalar( 5 ) ] ); + t.strictEqual( v, false, 'returns expected value' ); + + x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + v = dsome( [ vector( x, 4, 1, 0 ), scalar( 4 ) ] ); + t.strictEqual( v, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function treats `NaN` values as falsy', function test( t ) { + var x; + var v; + + x = new Float64Array( [ NaN, NaN, NaN ] ); + v = dsome( [ vector( x, 3, 1, 0 ), scalar( 1 ) ] ); + t.strictEqual( v, false, 'returns expected value' ); + + x = new Float64Array( [ NaN, 1.0, 2.0 ] ); + v = dsome( [ vector( x, 3, 1, 0 ), scalar( 2 ) ] ); + t.strictEqual( v, true, 'returns expected value' ); + + x = new Float64Array( [ NaN, 1.0, 0.0 ] ); + v = dsome( [ vector( x, 3, 1, 0 ), scalar( 2 ) ] ); + t.strictEqual( v, false, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an empty ndarray, the function returns `false`', function test( t ) { + var x; + var v; + + x = new Float64Array( [] ); + + v = dsome( [ vector( x, 0, 1, 0 ), scalar( 1 ) ] ); + t.strictEqual( v, false, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having non-unit strides', function test( t ) { + var x; + var v; + + x = new Float64Array([ + 1.0, // 0 + 0.0, + 0.0, // 1 + 0.0, + 1.0, // 2 + 0.0, + 0.0, // 3 + 0.0 + ]); + + v = dsome( [ vector( x, 4, 2, 0 ), scalar( 2 ) ] ); + + t.strictEqual( v, true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having negative strides', function test( t ) { + var x; + var v; + + x = new Float64Array([ + 1.0, + 2.0, // 2 + 3.0, + 4.0, // 1 + 5.0, + 6.0 // 0 + ]); + + v = dsome( [ vector( x, 3, -2, 5 ), scalar( 2 ) ] ); + + t.strictEqual( v, true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having non-zero offsets', function test( t ) { + var x; + var v; + + x = new Float64Array([ + 0.0, + 1.0, // 0 + 2.0, // 1 + 3.0, + 4.0 + ]); + + v = dsome( [ vector( x, 2, 1, 1 ), scalar( 2 ) ] ); + t.strictEqual( v, true, 'returns expected value' ); + + v = dsome( [ vector( x, 2, 1, 1 ), scalar( 3 ) ] ); + t.strictEqual( v, false, 'returns expected value' ); + + t.end(); +});