From 3d3ff82c2066830d04b84b3becee5b98f1ec4372 Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Tue, 10 Jun 2025 09:05:44 +0000 Subject: [PATCH 01/21] feat: add missing tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.1d.js | 104 ++ .../ndarray/base/includes/test/test.2d.js | 1423 +++++++++++++++++ 2 files changed, 1527 insertions(+) create mode 100644 lib/node_modules/@stdlib/ndarray/base/includes/test/test.1d.js create mode 100644 lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.1d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.1d.js new file mode 100644 index 000000000000..e516244e11be --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.1d.js @@ -0,0 +1,104 @@ +/** +* @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 Float64Array = require( '@stdlib/array/float64' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var oneTo = require( '@stdlib/array/one-to' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var includes = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof includes, 'function', 'main export is a function'); + t.end(); +}); + +tape( 'the function tests whether a 1-dimensional ndarray contains a specified value', function test( t ) { + var actual; + var x; + var v; + + x = ndarray( 'float64', oneTo( 8, 'float64' ), [ 4 ], [ 2 ], 1, 'row-major' ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 1-dimensional ndarray contains a specified value (accessors)', function test( t ) { + var actual; + var x; + var v; + + x = ndarray( 'float64', toAccessorArray( oneTo( 8, 'float64' ) ), [ 4 ], [ 2 ], 1, 'row-major' ); + + v = ndarray( 'float64', toAccessorArray( new Float64Array( [ 9.0 ] ) ), [], [ 0 ], 0, 'row-major' ); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = ndarray( 'float64', toAccessorArray( new Float64Array( [ 4.0 ] ) ), [], [ 0 ], 0, 'row-major' ); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 1-dimensional ndarray contains a specified value (complex)', function test( t ) { + var actual; + var xbuf; + var x; + var v; + + xbuf = oneTo( 12, 'float64' ); + x = ndarray( 'complex128', new Complex128Array( xbuf ), [ 4 ], [ 1 ], 1, 'row-major' ); + + v = scalar2ndarray( new Complex128( 1.0, 2.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 9.0, 10.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js new file mode 100644 index 000000000000..1356bc93adf6 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js @@ -0,0 +1,1423 @@ +/** +* @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 toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var oneTo = require( '@stdlib/array/one-to' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var numel = require( '@stdlib/ndarray/base/numel' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var blockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' ); +var includes = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof includes, 'function', 'main export is a function'); + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 2 ]; + st = [ -2, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 2 ]; + st = [ 4, 1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 2 ]; + st = [ 4, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 2 ]; + st = [ -4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, bsize*2 ]; + st = [ bsize*4, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 2 ]; + st = [ -2, -1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 2 ]; + st = [ 4, 1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 8*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 7.0, 8.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 2 ]; + st = [ 4, -1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 8*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 7.0, 8.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 2 ]; + st = [ -4, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, bsize*2 ]; + st = [ bsize*4, -2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 2 ]; + st = [ -2, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 2 ]; + st = [ 4, 1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 4, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 2 ]; + st = [ 4, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 4, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 2 ]; + st = [ -4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, bsize*2 ]; + st = [ bsize*4, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 4, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 4, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 2 ]; + st = [ -1, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 2 ]; + st = [ 1, 4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 2 ]; + st = [ -1, 4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 2 ]; + st = [ 2, -bsize*4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, bsize*2 ]; + st = [ -2, 4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 2 ]; + st = [ -1, -2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 2 ]; + st = [ 1, 4 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 8*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 7.0, 8.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 2 ]; + st = [ 4, -1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 8*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 7.0, 8.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 2 ]; + st = [ -2, bsize*2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, bsize*2 ]; + st = [ 2, -4 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 2 ]; + st = [ -1, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 2 ]; + st = [ 1, 4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 4, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 2 ]; + st = [ 4, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 4, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 2 ]; + st = [ -2, bsize*2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 2-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, bsize*2 ]; + st = [ 2, -4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); From 22a9cecd4de9e79dc4904b8045266591b95251c5 Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Mon, 16 Jun 2025 08:33:22 +0000 Subject: [PATCH 02/21] test: fix col strides --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/ndarray/base/includes/test/test.2d.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js index 1356bc93adf6..65877e1b62be 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js @@ -1121,7 +1121,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'column-major'; sh = [ 2, 2 ]; - st = [ 4, -1 ]; + st = [ -1, 4 ]; o = strides2offset( sh, st ); xbuf = oneTo( 8*2, 'float64' ); @@ -1330,7 +1330,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 2 ]; - st = [ 4, -1 ]; + st = [ -1, 4 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); From 2f6914b0826eb2101b4d1c414c442cbf1c123179 Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Mon, 16 Jun 2025 18:34:59 +0000 Subject: [PATCH 03/21] test: add 3d tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.2d.js | 112 +- .../ndarray/base/includes/test/test.3d.js | 1643 +++++++++++++++++ 2 files changed, 1699 insertions(+), 56 deletions(-) create mode 100644 lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js index 65877e1b62be..bcec9f429b16 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js @@ -60,13 +60,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -93,13 +93,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -126,13 +126,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -159,13 +159,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -192,13 +192,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); - v = scalar2ndarray( 4, { + v = scalar2ndarray( 4.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6, { + v = scalar2ndarray( 6.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -225,13 +225,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); - v = scalar2ndarray( 4, { + v = scalar2ndarray( 4.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6, { + v = scalar2ndarray( 6.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -261,13 +261,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -297,13 +297,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -546,13 +546,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -579,13 +579,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -612,13 +612,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 4, { + v = scalar2ndarray( 4.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6, { + v = scalar2ndarray( 6.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -645,13 +645,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 4, { + v = scalar2ndarray( 4.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6, { + v = scalar2ndarray( 6.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -681,13 +681,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -717,13 +717,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -750,13 +750,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -783,13 +783,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -816,13 +816,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -849,13 +849,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -882,13 +882,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); - v = scalar2ndarray( 4, { + v = scalar2ndarray( 4.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6, { + v = scalar2ndarray( 6.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -915,13 +915,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); - v = scalar2ndarray( 4, { + v = scalar2ndarray( 4.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6, { + v = scalar2ndarray( 6.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -951,13 +951,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -987,13 +987,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1236,13 +1236,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1269,13 +1269,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1302,13 +1302,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 4, { + v = scalar2ndarray( 4.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6, { + v = scalar2ndarray( 6.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1335,13 +1335,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 4, { + v = scalar2ndarray( 4.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6, { + v = scalar2ndarray( 6.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1371,13 +1371,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1407,13 +1407,13 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 3, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js new file mode 100644 index 000000000000..2a4185120bd1 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js @@ -0,0 +1,1643 @@ +/** +* @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 toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var oneTo = require( '@stdlib/array/one-to' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var numel = require( '@stdlib/ndarray/base/numel' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var blockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' ); +var includes = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof includes, 'function', 'main export is a function'); + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2 ]; + st = [ -2, -2, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2 ]; + st = [ 3, 2, 1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2 ]; + st = [ -3, -2, 1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2 ]; + st = [ -4, -4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( -1.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2 ]; + st = [ -8, -4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( -1.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2 ]; + st = [ bsize*8, bsize*4, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( -1.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 1, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 2, 2 ]; + st = [ -4, -2, -1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 1, 2 ]; + st = [ 3, 2, 1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 8*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 1, 2 ]; + st = [ -3, -2, -1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 8*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2 ]; + st = [ -4, -4, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2 ]; + st = [ -8, -4, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2 ]; + st = [ -bsize*8, -bsize*4, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 2, 2 ]; + st = [ -2, -2, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2 ]; + st = [ 3, 2, 1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 6.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2 ]; + st = [ -3, -2, 1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 6.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2 ]; + st = [ -4, -4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2 ]; + st = [ -8, -4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2 ]; + st = [ bsize*8, bsize*4, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 4, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 4, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2 ]; + st = [ -1, -2, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2 ]; + st = [ 1, 2, 4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2 ]; + st = [ 1, -2, -4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2 ]; + st = [ 2, -bsize*4, -bsize*4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2 ]; + st = [ 2, -2, -bsize*4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2 ]; + st = [ 2, -4, -4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 1, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 2, 2 ]; + st = [ -1, -2, -4 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 1, 2 ]; + st = [ 1, 2, 3 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 8*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 1, 2 ]; + st = [ -1, -2, -3 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 8*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 2, 1 ]; + st = [ 2, -bsize*4, -bsize*8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2 ]; + st = [ 2, -2, bsize*4 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2 ]; + st = [ 2, -4, -4 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 2, 2 ]; + st = [ -1, -2, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2 ]; + st = [ 1, 2, 4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2 ]; + st = [ 1, -2, -4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 2, 1 ]; + st = [ 2, -bsize*4, -bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2 ]; + st = [ -2, -2, -bsize*4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 3-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2 ]; + st = [ 2, -4, -4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); From d480d95d713d76bc36cd320201b836a3891cb654 Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Tue, 17 Jun 2025 07:40:32 +0000 Subject: [PATCH 04/21] chore: make consistent --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/ndarray/base/includes/test/test.3d.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js index 2a4185120bd1..c2cdf269bf03 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js @@ -261,7 +261,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( -1.0, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -297,7 +297,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( -1.0, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -333,7 +333,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( -1.0, { + v = scalar2ndarray( 8.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); From d0bc7cb6552ac253c685a48af9563a73a33e075d Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Tue, 17 Jun 2025 08:13:35 +0000 Subject: [PATCH 05/21] feat: add 4d tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.4d.js | 1863 +++++++++++++++++ 1 file changed, 1863 insertions(+) create mode 100644 lib/node_modules/@stdlib/ndarray/base/includes/test/test.4d.js diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.4d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.4d.js new file mode 100644 index 000000000000..17a9c16e153c --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.4d.js @@ -0,0 +1,1863 @@ +/** +* @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 toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var oneTo = require( '@stdlib/array/one-to' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var numel = require( '@stdlib/ndarray/base/numel' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var blockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' ); +var includes = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof includes, 'function', 'main export is a function'); + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ 4, 2, 1, 1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ 4, -2, -1, 1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1 ]; + st = [ -4, -4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1 ]; + st = [ -bsize*8, -4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1 ]; + st = [ bsize*8, bsize*4, -2, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2 ]; + st = [ bsize*8, bsize*4, -bsize*4, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 2, 1, 2 ]; + st = [ -4, -2, -2, -1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ 4, 2, 1, 1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 8*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ 4, -2, -1, 1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 8*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1 ]; + st = [ -4, -4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1 ]; + st = [ -bsize*8, -4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1 ]; + st = [ -bsize*4, -bsize*4, -2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 1, bsize*2 ]; + st = [ -bsize*4, -bsize*4, bsize*4, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ 4, 2, 1, 1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ 4, -2, -1, 1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1 ]; + st = [ -4, -4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1 ]; + st = [ -bsize*8, -4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1 ]; + st = [ bsize*4, bsize*4, -2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 1, bsize*2 ]; + st = [ bsize*4, bsize*4, bsize*4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ -1, -2, -2, -4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ 1, 2, 4, 8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ 1, -2, -4, 8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2 ]; + st = [ 2, 2, -4, -4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1 ]; + st = [ 2, -2, -4, -bsize*4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 2 ]; + st = [ 2, 2, -bsize*4, -bsize*4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 1, 2 ]; + st = [ 2, -bsize*4, bsize*4, -bsize*4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 2, 1, 2 ]; + st = [ -1, -2, -4, -4 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ 1, 2, 4, 8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 8*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ 1, 2, -4, -8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 8*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1 ]; + st = [ 2, -bsize*4, -bsize*4, -bsize*8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, bsize*2, 1, 1 ]; + st = [ 2, 2, -bsize*4, -bsize*4 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1 ]; + st = [ 2, 4, -4, -bsize*4 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 1, bsize*4 ]; + st = [ 2, 4, -4, -4 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ -1, -2, -2, -4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ 1, 2, 4, 8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1 ]; + st = [ 1, -2, -4, 8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2 ]; + st = [ 2, 2, -4, -4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1 ]; + st = [ 2, 2, -4, -bsize*4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 2 ]; + st = [ 2, 2, -bsize*4, -bsize*4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 4-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 1, 2 ]; + st = [ 2, -bsize*4, bsize*4, -bsize*4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); From 4f0e6156e2c45bbb8bdbd4fd7f748ded3d48b274 Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Tue, 17 Jun 2025 09:36:13 +0000 Subject: [PATCH 06/21] test: add 5d tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.5d.js | 2045 +++++++++++++++++ 1 file changed, 2045 insertions(+) create mode 100644 lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js new file mode 100644 index 000000000000..68e3ab7332bb --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js @@ -0,0 +1,2045 @@ +/** +* @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 toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var oneTo = require( '@stdlib/array/one-to' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var numel = require( '@stdlib/ndarray/base/numel' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var blockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' ); +var includes = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof includes, 'function', 'main export is a function'); + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ -4, -4, -2, -2, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ 8, 8, 4, 4, 1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ 8, -8, -4, 4, 1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2 ]; + st = [ -8, -8, 4, 4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1, 2 ]; + st = [ -bsize*16, -8, 4, 4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1, 2 ]; + st = [ bsize*16, bsize*8, -4, -4, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2, 2 ]; + st = [ bsize*16, bsize*8, -bsize*8, -4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2 ]; + st = [ bsize*8, bsize*8, -bsize*4, -bsize*4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ -4, -4, -2, -2, -1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ 8, 8, 4, 4, 1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 32, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ 8, -8, -4, 4, 1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 32, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2 ]; + st = [ -8, -8, 4, 4, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1, 2 ]; + st = [ -bsize*16, -8, 4, 4, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1, 2 ]; + st = [ -bsize*16, -bsize*8, -4, 4, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*2, 1 ]; + st = [ -bsize*8, -bsize*8, bsize*4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2 ]; + st = [ -bsize*8, -bsize*8, bsize*4, bsize*4, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ -4, -4, -2, -2, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ 8, 8, 4, 4, 1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ 8, -8, -4, 4, 1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2 ]; + st = [ -8, -8, 4, 4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1, 2 ]; + st = [ -bsize*16, -8, 4, 4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2 ]; + st = [ bsize*8, bsize*8, -4, 4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*2, 1 ]; + st = [ bsize*8, bsize*8, bsize*4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2 ]; + st = [ bsize*8, bsize*8, bsize*4, bsize*4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ -1, -2, -2, -4, -4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ 1, 4, 4, 8, 8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ 1, 4, -4, -8, 8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2 ]; + st = [ 2, 4, 4, -8, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*2, 1 ]; + st = [ 2, -4, -4, -8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2 ]; + st = [ 2, 4, -4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 2, 2 ]; + st = [ 2, -2, bsize*4, -bsize*4, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2 ]; + st = [ 2, -bsize*4, bsize*4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ -1, -2, -2, -4, -4 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ 1, 4, 4, 8, 8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 32, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ 1, 4, -4, -8, 8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 32, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2 ]; + st = [ 2, -bsize*4, -bsize*4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, bsize*2, 1, 1, 2 ]; + st = [ 2, 4, -bsize*8, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2 ]; + st = [ 2, 4, -4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*4, 1 ]; + st = [ 2, 4, -4, -8, bsize*32 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ -1, -2, -2, -4, -4 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ 1, 4, 4, 8, 8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2 ]; + st = [ 1, -4, -4, 8, 8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 6.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2 ]; + st = [ 2, 4, -4, -8, 8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*2, 1 ]; + st = [ 2, 4, -4, -8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2 ]; + st = [ 2, 4, -4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 2, 2 ]; + st = [ 2, -2, bsize*4, -bsize*4, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2 ]; + st = [ 2, -bsize*4, bsize*4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); From 30316d1fbe49d4cabb991a7122df5709ebd64fda Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Tue, 17 Jun 2025 11:20:30 +0000 Subject: [PATCH 07/21] fix: add missing case --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.5d.js | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js index 68e3ab7332bb..97e885a3b49f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js @@ -1732,6 +1732,44 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v t.end(); }); +tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2 ]; + st = [ 2, 4, -4, -8, 8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + tape( 'the function tests whether a 5-dimensional ndarray contains a specified value (column-major, contiguous, accessors)', function test( t ) { var actual; var ord; From 993ff1577684b542f148385b375e6c40a4dc2fe4 Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Wed, 18 Jun 2025 09:46:56 +0000 Subject: [PATCH 08/21] test: add 6d tests & fix noncontiguous strides --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.2d.js | 48 +- .../ndarray/base/includes/test/test.3d.js | 56 +- .../ndarray/base/includes/test/test.4d.js | 56 +- .../ndarray/base/includes/test/test.5d.js | 56 +- .../ndarray/base/includes/test/test.6d.js | 2303 +++++++++++++++++ 5 files changed, 2411 insertions(+), 108 deletions(-) create mode 100644 lib/node_modules/@stdlib/ndarray/base/includes/test/test.6d.js diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js index bcec9f429b16..e9c39a532c43 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js @@ -187,7 +187,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 2 ]; - st = [ 4, 1 ]; + st = [ 4, 2 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); @@ -198,7 +198,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -220,7 +220,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 2 ]; - st = [ 4, -1 ]; + st = [ 4, -2 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); @@ -231,7 +231,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -396,7 +396,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'row-major'; sh = [ 2, 2 ]; - st = [ 4, 1 ]; + st = [ 4, 2 ]; o = strides2offset( sh, st ); xbuf = oneTo( 8*2, 'float64' ); @@ -408,7 +408,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 1.0, 2.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -431,7 +431,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'row-major'; sh = [ 2, 2 ]; - st = [ 4, -1 ]; + st = [ 4, -2 ]; o = strides2offset( sh, st ); xbuf = oneTo( 8*2, 'float64' ); @@ -443,7 +443,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 1.0, 2.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -607,7 +607,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 2 ]; - st = [ 4, 1 ]; + st = [ 4, 2 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); @@ -618,7 +618,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -640,7 +640,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 2 ]; - st = [ 4, -1 ]; + st = [ 4, -2 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); @@ -651,7 +651,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -877,7 +877,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 2 ]; - st = [ 1, 4 ]; + st = [ 2, 4 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); @@ -888,7 +888,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -910,7 +910,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 2 ]; - st = [ -1, 4 ]; + st = [ -2, 4 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); @@ -921,7 +921,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1086,7 +1086,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'column-major'; sh = [ 2, 2 ]; - st = [ 1, 4 ]; + st = [ 2, 4 ]; o = strides2offset( sh, st ); xbuf = oneTo( 8*2, 'float64' ); @@ -1098,7 +1098,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 1.0, 2.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1121,7 +1121,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'column-major'; sh = [ 2, 2 ]; - st = [ -1, 4 ]; + st = [ -2, 4 ]; o = strides2offset( sh, st ); xbuf = oneTo( 8*2, 'float64' ); @@ -1133,7 +1133,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 1.0, 2.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1297,7 +1297,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 2 ]; - st = [ 1, 4 ]; + st = [ 2, 4 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); @@ -1308,7 +1308,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1330,7 +1330,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 2 ]; - st = [ -1, 4 ]; + st = [ -2, 4 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); @@ -1341,7 +1341,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js index c2cdf269bf03..8f5a1d99d8b4 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js @@ -187,7 +187,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 1, 2 ]; - st = [ 3, 2, 1 ]; + st = [ 4, 4, 2 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); @@ -198,7 +198,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 2.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -220,7 +220,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 1, 2 ]; - st = [ -3, -2, 1 ]; + st = [ -4, -4, 2 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); @@ -231,7 +231,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 2.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -432,19 +432,19 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'row-major'; sh = [ 2, 1, 2 ]; - st = [ 3, 2, 1 ]; + st = [ 4, 4, 2 ]; o = strides2offset( sh, st ); xbuf = oneTo( 8*2, 'float64' ); x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 1.0, 2.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -467,19 +467,19 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'row-major'; sh = [ 2, 1, 2 ]; - st = [ -3, -2, -1 ]; + st = [ -4, -4, -2 ]; o = strides2offset( sh, st ); xbuf = oneTo( 8*2, 'float64' ); x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 1.0, 2.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -681,7 +681,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 1, 2 ]; - st = [ 3, 2, 1 ]; + st = [ 4, 4, 2 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); @@ -692,7 +692,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 4.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -714,7 +714,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 1, 2 ]; - st = [ -3, -2, 1 ]; + st = [ -4, -4, 2 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); @@ -725,7 +725,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 4.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -987,7 +987,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 1, 2 ]; - st = [ 1, 2, 4 ]; + st = [ 2, 4, 4 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); @@ -998,7 +998,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1020,7 +1020,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 1, 2 ]; - st = [ 1, -2, -4 ]; + st = [ 2, -4, -4 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); @@ -1031,7 +1031,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1232,19 +1232,19 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'column-major'; sh = [ 2, 1, 2 ]; - st = [ 1, 2, 3 ]; + st = [ 2, 4, 4 ]; o = strides2offset( sh, st ); xbuf = oneTo( 8*2, 'float64' ); x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 1.0, 2.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1267,19 +1267,19 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'column-major'; sh = [ 2, 1, 2 ]; - st = [ -1, -2, -3 ]; + st = [ -2, -4, -4 ]; o = strides2offset( sh, st ); xbuf = oneTo( 8*2, 'float64' ); x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 1.0, 2.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1481,7 +1481,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 1, 2 ]; - st = [ 1, 2, 4 ]; + st = [ 2, 4, 4 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); @@ -1492,7 +1492,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1514,7 +1514,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 1, 2 ]; - st = [ 1, -2, -4 ]; + st = [ 2, -4, -4 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); @@ -1525,7 +1525,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.4d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.4d.js index 17a9c16e153c..d51630685e0f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.4d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.4d.js @@ -187,7 +187,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 1, 2, 1 ]; - st = [ 4, 2, 1, 1 ]; + st = [ 4, 4, 2, 2 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); @@ -198,7 +198,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 2.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -220,7 +220,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 1, 2, 1 ]; - st = [ 4, -2, -1, 1 ]; + st = [ 4, -4, -2, 2 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); @@ -231,7 +231,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 2.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -468,19 +468,19 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'row-major'; sh = [ 2, 1, 2, 1 ]; - st = [ 4, 2, 1, 1 ]; + st = [ 4, 4, 2, 2 ]; o = strides2offset( sh, st ); xbuf = oneTo( 8*2, 'float64' ); x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -503,19 +503,19 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'row-major'; sh = [ 2, 1, 2, 1 ]; - st = [ 4, -2, -1, 1 ]; + st = [ 4, -4, -2, 2 ]; o = strides2offset( sh, st ); xbuf = oneTo( 8*2, 'float64' ); x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -755,7 +755,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 1, 2, 1 ]; - st = [ 4, 2, 1, 1 ]; + st = [ 4, 4, 2, 2 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); @@ -766,7 +766,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 2.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -788,7 +788,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 1, 2, 1 ]; - st = [ 4, -2, -1, 1 ]; + st = [ 4, -4, -2, 2 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); @@ -799,7 +799,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 2.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1097,7 +1097,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 1, 2, 1 ]; - st = [ 1, 2, 4, 8 ]; + st = [ 2, 4, 4, 8 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); @@ -1108,7 +1108,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1130,7 +1130,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 1, 2, 1 ]; - st = [ 1, -2, -4, 8 ]; + st = [ 2, -4, -4, 8 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); @@ -1141,7 +1141,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1378,19 +1378,19 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'column-major'; sh = [ 2, 1, 2, 1 ]; - st = [ 1, 2, 4, 8 ]; + st = [ 2, 4, 4, 8 ]; o = strides2offset( sh, st ); xbuf = oneTo( 8*2, 'float64' ); x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1413,19 +1413,19 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'column-major'; sh = [ 2, 1, 2, 1 ]; - st = [ 1, 2, -4, -8 ]; + st = [ 2, 4, -4, -8 ]; o = strides2offset( sh, st ); xbuf = oneTo( 8*2, 'float64' ); x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1665,7 +1665,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 1, 2, 1 ]; - st = [ 1, 2, 4, 8 ]; + st = [ 2, 4, 4, 8 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); @@ -1676,7 +1676,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1698,7 +1698,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 1, 2, 1 ]; - st = [ 1, -2, -4, 8 ]; + st = [ 2, -4, -4, 8 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); @@ -1709,7 +1709,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js index 97e885a3b49f..8617e7474eaa 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js @@ -187,7 +187,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, 8, 4, 4, 1 ]; + st = [ 8, 8, 4, 4, 2 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); @@ -198,7 +198,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 2.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -220,7 +220,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, -8, -4, 4, 1 ]; + st = [ 8, -8, -4, 4, 2 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); @@ -231,7 +231,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 2.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -504,19 +504,19 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'row-major'; sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, 8, 4, 4, 1 ]; + st = [ 8, 8, 4, 4, 2 ]; o = strides2offset( sh, st ); xbuf = oneTo( 32, 'float64' ); x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -539,19 +539,19 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'row-major'; sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, -8, -4, 4, 1 ]; + st = [ 8, -8, -4, 4, 2 ]; o = strides2offset( sh, st ); xbuf = oneTo( 32, 'float64' ); x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -829,7 +829,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, 8, 4, 4, 1 ]; + st = [ 8, 8, 4, 4, 2 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len @@ -840,7 +840,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 2.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -862,7 +862,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v dt = 'float64'; ord = 'row-major'; sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, -8, -4, 4, 1 ]; + st = [ 8, -8, -4, 4, 2 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len @@ -873,7 +873,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 2.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1207,7 +1207,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 1, 2, 1, 2 ]; - st = [ 1, 4, 4, 8, 8 ]; + st = [ 2, 4, 4, 8, 8 ]; o = strides2offset( sh, st ); x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); @@ -1218,7 +1218,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1240,7 +1240,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 1, 2, 1, 2 ]; - st = [ 1, 4, -4, -8, 8 ]; + st = [ 2, 4, -4, -8, 8 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len @@ -1251,7 +1251,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1524,19 +1524,19 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'column-major'; sh = [ 2, 1, 2, 1, 2 ]; - st = [ 1, 4, 4, 8, 8 ]; + st = [ 2, 4, 4, 8, 8 ]; o = strides2offset( sh, st ); xbuf = oneTo( 32, 'float64' ); x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1559,19 +1559,19 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v dt = 'complex128'; ord = 'column-major'; sh = [ 2, 1, 2, 1, 2 ]; - st = [ 1, 4, -4, -8, 8 ]; + st = [ 2, 4, -4, -8, 8 ]; o = strides2offset( sh, st ); xbuf = oneTo( 32, 'float64' ); x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1849,7 +1849,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 1, 2, 1, 2 ]; - st = [ 1, 4, 4, 8, 8 ]; + st = [ 2, 4, 4, 8, 8 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len @@ -1860,7 +1860,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1882,7 +1882,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v dt = 'float64'; ord = 'column-major'; sh = [ 2, 1, 2, 1, 2 ]; - st = [ 1, -4, -4, 8, 8 ]; + st = [ 2, -4, -4, 8, 8 ]; o = strides2offset( sh, st ); x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len @@ -1893,7 +1893,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( 3.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.6d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.6d.js new file mode 100644 index 000000000000..de186b4b0b99 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.6d.js @@ -0,0 +1,2303 @@ +/** +* @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 toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var oneTo = require( '@stdlib/array/one-to' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var numel = require( '@stdlib/ndarray/base/numel' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var blockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' ); +var includes = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof includes, 'function', 'main export is a function'); + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1 ]; + st = [ -8, -8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1, 2, 1 ]; + st = [ -bsize*16, -8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1, 2, 1 ]; + st = [ bsize*16, bsize*8, -4, -4, -2, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2, 2, 1 ]; + st = [ bsize*16, bsize*8, -bsize*8, -4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2, 1 ]; + st = [ bsize*8, bsize*8, -bsize*4, -bsize*4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, bsize*2 ]; + st = [ bsize*8, bsize*8, -bsize*4, -bsize*4, bsize*4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ 8, -8, -4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1 ]; + st = [ -8, -8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1, 2, 1 ]; + st = [ -bsize*16, -8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1, 2, 1 ]; + st = [ -bsize*16, -bsize*8, -4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*2, 1, 1 ]; + st = [ -bsize*8, -bsize*8, bsize*4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2, 1 ]; + st = [ -bsize*8, -bsize*8, bsize*4, bsize*4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, bsize*2 ]; + st = [ -bsize*8, -bsize*8, bsize*4, bsize*4, bsize*4, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ 8, -8, -4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1 ]; + st = [ -8, -8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1, 2, 1 ]; + st = [ -bsize*16, -8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2, 1 ]; + st = [ bsize*8, bsize*8, -4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*2, 1, 1 ]; + st = [ bsize*8, bsize*8, bsize*4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2, 1 ]; + st = [ bsize*8, bsize*8, bsize*4, bsize*4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, bsize*2 ]; + st = [ bsize*8, bsize*8, bsize*4, bsize*4, bsize*4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 4, -4, -8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, bsize*2 ]; + st = [ 2, 4, 4, -8, -8, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2, 1 ]; + st = [ 2, -4, -4, -8, 8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*2, 1, 1 ]; + st = [ 2, -4, -4, -8, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2, 1 ]; + st = [ 2, 4, -4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 2, 2, 1 ]; + st = [ 2, -2, bsize*4, -bsize*4, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1 ]; + st = [ 2, -bsize*4, bsize*4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 4, -4, -8, 8, 16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1 ]; + st = [ 2, -bsize*4, -bsize*4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, bsize*2, 1, 1, 2, 1 ]; + st = [ 2, 4, -bsize*8, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2, 1 ]; + st = [ 2, 4, -4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*4, 1, 1 ]; + st = [ 2, 4, -4, -8, bsize*32, bsize*32 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2, 1 ]; + st = [ 2, 4, -4, -8, 8, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, bsize*2 ]; + st = [ 2, 4, -4, -8, 8, 8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 2, 1, 2, 1, 2, 1 ]; + st = [ 2, -4, -4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, bsize*2 ]; + st = [ 2, 2, 4, -4, -8, 8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, bsize*2, 1 ]; + st = [ 2, 2, 4, -4, -8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2, 1, 2 ]; + st = [ 2, 2, 4, -4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, bsize*2, 1, 2, 2 ]; + st = [ 2, 2, -2, bsize*4, -bsize*4, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 2, 1, 2 ]; + st = [ 2, 2, -bsize*4, bsize*4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 6-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1 ]; + st = [ 2, bsize*4, -bsize*4, bsize*8, -bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); From 9e67f8946a23328e20328bda8a025be3235fcccd Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Wed, 18 Jun 2025 10:35:59 +0000 Subject: [PATCH 09/21] test: add 7d test --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.7d.js | 2523 +++++++++++++++++ 1 file changed, 2523 insertions(+) create mode 100644 lib/node_modules/@stdlib/ndarray/base/includes/test/test.7d.js diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.7d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.7d.js new file mode 100644 index 000000000000..0a2a35900c16 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.7d.js @@ -0,0 +1,2523 @@ +/** +* @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 toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var oneTo = require( '@stdlib/array/one-to' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var numel = require( '@stdlib/ndarray/base/numel' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var blockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' ); +var includes = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof includes, 'function', 'main export is a function'); + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -4, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 1, 2, 1, 2, 1 ]; + st = [ -8, -8, -8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 2, 1, 2, 1 ]; + st = [ -bsize*16, -8, -8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1, 1, 2, 1 ]; + st = [ bsize*16, bsize*8, 4, -4, -4, -2, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2, 1, 2, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, -4, -4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2, 1, 1 ]; + st = [ bsize*8, bsize*8, bsize*4, -bsize*4, -2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, bsize*2, 1 ]; + st = [ bsize*8, bsize*8, bsize*4, -bsize*4, -bsize*4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, bsize*2 ]; + st = [ bsize*8, bsize*8, bsize*4, -bsize*4, -bsize*4, bsize*4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -4, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, -8, -4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1, 1 ]; + st = [ -8, -8, 4, 4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1, 2, 1, 1 ]; + st = [ -bsize*16, -8, 4, 4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1, 2, 1, 1 ]; + st = [ -bsize*16, -bsize*8, -4, 4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*2, 1, 1, 1 ]; + st = [ -bsize*8, -bsize*8, bsize*4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, bsize*2, 1, 1 ]; + st = [ -bsize*16, -bsize*8, bsize*4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, bsize*2, 1 ]; + st = [ -bsize*16, -bsize*8, -bsize*8, bsize*4, bsize*4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, bsize*2 ]; + st = [ -bsize*16, -bsize*8, -bsize*8, bsize*4, bsize*4, bsize*4, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -8, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 16, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 16, 8, -8, -4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1, 1 ]; + st = [ -8, -8, 4, 4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1, 2, 1, 1 ]; + st = [ -bsize*16, -8, 4, 4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2, 1, 1 ]; + st = [ bsize*8, bsize*8, -4, 4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2, 2, 1, 1 ]; + st = [ bsize*16, bsize*8, -bsize*8, 4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, bsize*2, 1, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, bsize*4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, bsize*2, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, bsize*4, bsize*4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, bsize*2 ]; + st = [ bsize*16, bsize*8, bsize*8, bsize*4, bsize*4, bsize*4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 4, -4, -8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, bsize*2 ]; + st = [ 2, 2, 4, 4, -8, -8, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, bsize*2, 1 ]; + st = [ 2, 2, -4, -4, -8, 8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, bsize*2, 1, 1 ]; + st = [ 2, 2, -4, -4, -8, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2, 1, 2, 1 ]; + st = [ 2, 2, 4, -4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, bsize*2, 1, 2, 2, 1 ]; + st = [ 2, 2, -2, bsize*4, -bsize*4, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, -bsize*4, bsize*4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 1, 2, 1, 2, 1 ]; + st = [ 2, bsize*4, -bsize*4, bsize*4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 4, -4, -8, 8, 16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1, 1 ]; + st = [ 2, -bsize*4, -bsize*4, -bsize*8, bsize*8, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, bsize*2, 1, 1, 2, 1, 1 ]; + st = [ 2, 4, -bsize*8, -bsize*8, bsize*8, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2, 1, 1 ]; + st = [ 2, 4, -4, -bsize*8, bsize*8, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*4, 1, 1, 1 ]; + st = [ 2, 4, -4, -8, bsize*32, bsize*32, bsize*32 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2, 1, 1 ]; + st = [ 2, 4, -4, -8, 8, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, bsize*2, 1 ]; + st = [ 2, 4, -4, -8, 8, 8, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, bsize*2 ]; + st = [ 2, 4, -4, -8, 8, 8, 8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, -4, -4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 2, 1, 2, 1, bsize*2 ]; + st = [ 2, 2, 2, 4, -4, -8, 8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 2, 1, 2, bsize*2, 1 ]; + st = [ 2, 2, 2, 4, -4, -8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 2, 1, bsize*2, 1, 2 ]; + st = [ 2, 2, 2, 4, -4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, bsize*2, 1, 2, 2 ]; + st = [ 2, 2, 2, -2, bsize*4, -bsize*4, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, bsize*2, 1, 2, 1, 2 ]; + st = [ 2, 2, 2, -bsize*4, bsize*4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, bsize*4, -bsize*4, bsize*8, -bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 7-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 1, 2, 1, 2, 1 ]; + st = [ 2, bsize*4, bsize*4, -bsize*4, bsize*8, -bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); From 1e95d2838372dc563b0d73b52dfc9da5dc564bc6 Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Wed, 18 Jun 2025 11:18:54 +0000 Subject: [PATCH 10/21] test: add 8d tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.8d.js | 2743 +++++++++++++++++ 1 file changed, 2743 insertions(+) create mode 100644 lib/node_modules/@stdlib/ndarray/base/includes/test/test.8d.js diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.8d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.8d.js new file mode 100644 index 000000000000..9faf924b01fc --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.8d.js @@ -0,0 +1,2743 @@ +/** +* @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 toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var oneTo = require( '@stdlib/array/one-to' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var numel = require( '@stdlib/ndarray/base/numel' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var blockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' ); +var includes = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof includes, 'function', 'main export is a function'); + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1, 1, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1, 1, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -8, -8, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 1, 2, 1, 2, 1, 1 ]; + st = [ -8, -8, -8, 4, 4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 2, 1, 2, 1, 1 ]; + st = [ -bsize*16, -8, -8, 4, 4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1, 1, 2, 1, 1 ]; + st = [ bsize*16, bsize*8, 4, -4, -4, -2, -2, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2, 1, 2, 1, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, -4, -4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2, 1, 1, 1 ]; + st = [ bsize*8, bsize*8, bsize*4, -bsize*4, -2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, bsize*2, 1, 1 ]; + st = [ bsize*8, bsize*8, bsize*4, -bsize*4, -bsize*4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, bsize*2, 1 ]; + st = [ bsize*8, bsize*8, bsize*4, -bsize*4, -bsize*4, bsize*4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, 1, bsize*2 ]; + st = [ bsize*8, bsize*8, bsize*4, -bsize*4, -bsize*4, bsize*4, bsize*4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -4, -4, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, -8, -4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1, 1, 1 ]; + st = [ -8, -8, 4, 4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1, 2, 1, 1, 1 ]; + st = [ -bsize*16, -8, 4, 4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1, 2, 1, 1, 1 ]; + st = [ -bsize*16, -bsize*8, -4, 4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*2, 1, 1, 1, 1 ]; + st = [ -bsize*8, -bsize*8, bsize*4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, bsize*2, 1, 1, 1 ]; + st = [ -bsize*16, -bsize*8, bsize*4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, bsize*2, 1, 1 ]; + st = [ -bsize*16, -bsize*8, -bsize*8, bsize*4, bsize*4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, bsize*2, 1 ]; + st = [ -bsize*16, -bsize*8, -bsize*8, bsize*4, bsize*4, bsize*4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, 1, bsize*2 ]; + st = [ -bsize*16, -bsize*8, -bsize*8, bsize*4, bsize*4, bsize*4, bsize*4, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -8, -8, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 16, 16, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 16, 16, 8, -8, -4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1, 1, 1 ]; + st = [ -8, -8, 4, 4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1, 2, 1, 1, 1 ]; + st = [ -bsize*16, -8, 4, 4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2, 1, 1, 1 ]; + st = [ bsize*8, bsize*8, -4, 4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2, 2, 1, 1, 1 ]; + st = [ bsize*16, bsize*8, -bsize*8, 4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, bsize*2, 1, 1, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, bsize*4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, bsize*2, 1, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, bsize*4, bsize*4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, bsize*2, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, bsize*4, bsize*4, bsize*4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, 1, bsize*2 ]; + st = [ bsize*16, bsize*8, bsize*8, bsize*4, bsize*4, bsize*4, bsize*4, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 4, -4, -8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 2, 1, 2, 1, 1, bsize*2 ]; + st = [ 2, 2, 2, 4, 4, -8, -8, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 2, 1, 2, 1, bsize*2, 1 ]; + st = [ 2, 2, 2, -4, -4, -8, 8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 2, 1, 2, bsize*2, 1, 1 ]; + st = [ 2, 2, 2, -4, -4, -8, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 2, 1, bsize*2, 1, 2, 1 ]; + st = [ 2, 2, 2, 4, -4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, bsize*2, 1, 2, 2, 1 ]; + st = [ 2, 2, 2, -2, bsize*4, -bsize*4, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, bsize*2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, -bsize*4, bsize*4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, bsize*4, -bsize*4, bsize*4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 1, 1, 2, 1, 2, 1 ]; + st = [ 2, bsize*4, bsize*4, -bsize*4, bsize*4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 4, -4, -8, 8, 16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1, 1, 1 ]; + st = [ 2, -bsize*4, -bsize*4, -bsize*8, bsize*8, bsize*16, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, bsize*2, 1, 1, 2, 1, 1, 1 ]; + st = [ 2, 4, -bsize*8, -bsize*8, bsize*8, bsize*16, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2, 1, 1, 1 ]; + st = [ 2, 4, -4, -bsize*8, bsize*8, bsize*16, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*4, 1, 1, 1, 1 ]; + st = [ 2, 4, -4, -8, bsize*32, bsize*32, bsize*32, bsize*32 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2, 1, 1, 1 ]; + st = [ 2, 4, -4, -8, 8, bsize*16, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, bsize*2, 1, 1 ]; + st = [ 2, 4, -4, -8, 8, 8, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, bsize*2, 1 ]; + st = [ 2, 4, -4, -8, 8, 8, 8, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, 1, bsize*2 ]; + st = [ 2, 4, -4, -8, 8, 8, 8, 8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, -4, -4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 2, 1, 2, 1, bsize*2 ]; + st = [ 2, 2, 2, 2, 4, -4, -8, 8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 2, 1, 2, bsize*2, 1 ]; + st = [ 2, 2, 2, 2, 4, -4, -8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 2, 1, bsize*2, 1, 2 ]; + st = [ 2, 2, 2, 2, 4, -4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, bsize*2, 1, 2, 2 ]; + st = [ 2, 2, 2, 2, -2, bsize*4, -bsize*4, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, bsize*2, 1, 2, 1, 2 ]; + st = [ 2, 2, 2, 2, -bsize*4, bsize*4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, bsize*2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, bsize*4, -bsize*4, bsize*8, -bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, bsize*4, bsize*4, -bsize*4, bsize*8, -bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 8-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 1, 1, 2, 1, 2, 1 ]; + st = [ 2, bsize*4, bsize*4, bsize*4, -bsize*4, bsize*8, -bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); From 31395230b36d71f6a95d765a1f710f8e830c3170 Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Wed, 18 Jun 2025 14:40:28 +0000 Subject: [PATCH 11/21] test: add 9d tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.9d.js | 3009 +++++++++++++++++ 1 file changed, 3009 insertions(+) create mode 100644 lib/node_modules/@stdlib/ndarray/base/includes/test/test.9d.js diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.9d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.9d.js new file mode 100644 index 000000000000..31cf049f07c9 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.9d.js @@ -0,0 +1,3009 @@ +/** +* @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 toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var oneTo = require( '@stdlib/array/one-to' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var numel = require( '@stdlib/ndarray/base/numel' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var blockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' ); +var includes = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof includes, 'function', 'main export is a function'); + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -8, -8, -8, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 1, 2, 1, 2, 1, 1, 1 ]; + st = [ -8, -8, -8, 4, 4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 2, 1, 2, 1, 1, 1 ]; + st = [ -bsize*16, -8, -8, 4, 4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1, 1, 2, 1, 1, 1 ]; + st = [ bsize*16, bsize*8, 4, -4, -4, -2, -2, -2, -2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2, 1, 2, 1, 1, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, -4, -4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2, 1, 1, 1, 1 ]; + st = [ bsize*8, bsize*8, bsize*4, -bsize*4, -2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, bsize*2, 1, 1, 1 ]; + st = [ bsize*8, bsize*8, bsize*4, -bsize*4, -bsize*4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, bsize*2, 1, 1 ]; + st = [ bsize*8, bsize*8, bsize*4, -bsize*4, -bsize*4, bsize*4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, 1, bsize*2, 1 ]; + st = [ + bsize*8, + bsize*8, + bsize*4, + -bsize*4, + -bsize*4, + bsize*4, + bsize*4, + 2, + 2 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, 1, 1, bsize*2 ]; + st = [ + bsize*8, + bsize*8, + bsize*4, + -bsize*4, + -bsize*4, + bsize*4, + bsize*4, + bsize*4, + 2 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -4, -4, -4, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, -8, -4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1, 1, 1, 1 ]; + st = [ -8, -8, 4, 4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1, 2, 1, 1, 1, 1 ]; + st = [ -bsize*16, -8, 4, 4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1, 2, 1, 1, 1, 1 ]; + st = [ -bsize*16, -bsize*8, -4, 4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*2, 1, 1, 1, 1, 1 ]; + st = [ -bsize*8, -bsize*8, bsize*4, 2, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, bsize*2, 1, 1, 1, 1 ]; + st = [ -bsize*16, -bsize*8, bsize*4, 2, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, bsize*2, 1, 1, 1 ]; + st = [ -bsize*16, -bsize*8, -bsize*8, bsize*4, bsize*4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, bsize*2, 2, 1 ]; + st = [ -bsize*16, -bsize*8, -bsize*8, bsize*4, bsize*4, bsize*4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, 1, bsize*2, 1 ]; + st = [ + -bsize*16, + -bsize*8, + -bsize*8, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + 2, + 2 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -8, -8, -8, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 16, 16, 16, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 16, 16, 16, 8, -8, -4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1, 1, 1, 1 ]; + st = [ -8, -8, 4, 4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1, 2, 1, 1, 1, 1 ]; + st = [ -bsize*16, -8, 4, 4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2, 1, 1, 1, 1 ]; + st = [ bsize*8, bsize*8, -4, 4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2, 2, 1, 1, 1, 1 ]; + st = [ bsize*16, bsize*8, -bsize*8, 4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, bsize*2, 1, 1, 1, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, bsize*4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, bsize*2, 1, 1, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, bsize*4, bsize*4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, bsize*2, 1, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, bsize*4, bsize*4, bsize*4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, 1, bsize*2, 1 ]; + st = [ + bsize*16, + bsize*8, + bsize*8, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + 2, + 2 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, 1, 1, bsize*2 ]; + st = [ + bsize*16, + bsize*8, + bsize*8, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + 2 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 4, -4, -8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 2, 1, 2, 1, 1, bsize*2 ]; + st = [ 2, 2, 2, 2, 4, 4, -8, -8, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 2, 1, 2, 1, bsize*2, 1 ]; + st = [ 2, 2, 2, 2, -4, -4, -8, 8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 2, 1, 2, bsize*2, 1, 1 ]; + st = [ 2, 2, 2, 2, -4, -4, -8, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 2, 1, bsize*2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 4, -4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, bsize*2, 1, 2, 2, 1 ]; + st = [ 2, 2, 2, 2, -2, bsize*4, -bsize*4, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, bsize*2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, -bsize*4, bsize*4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, bsize*2, 1, 1, 2, 1, 2, 1 ]; + st = [ + 2, + 2, + 2, + bsize*4, + -bsize*4, + bsize*4, + -bsize*8, + bsize*8, + bsize*16 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 1, 1, 2, 1, 2, 1, 1 ]; + st = [ + 2, + bsize*4, + bsize*4, + -bsize*4, + bsize*4, + -bsize*8, + bsize*8, + bsize*16, + bsize*16 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 4, -4, -8, 8, 16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1, 1, 1, 1 ]; + st = [ + 2, + -bsize*4, + -bsize*4, + -bsize*8, + bsize*8, + bsize*16, + bsize*16, + bsize*16, + bsize*16 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, bsize*2, 1, 1, 2, 1, 1, 1, 1 ]; + st = [ + 2, + 4, + -bsize*8, + -bsize*8, + bsize*8, + bsize*16, + bsize*16, + bsize*16, + bsize*16 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2, 1, 1, 1, 1 ]; + st = [ + 2, + 4, + -4, + -bsize*8, + bsize*8, + bsize*16, + bsize*16, + bsize*16, + bsize*16 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*4, 1, 1, 1, 1, 1 ]; + st = [ + 2, + 4, + -4, + -8, + bsize*32, + bsize*32, + bsize*32, + bsize*32, + bsize*32 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2, 1, 1, 1, 1 ]; + st = [ + 2, + 4, + -4, + -8, + 8, + bsize*16, + bsize*16, + bsize*16, + bsize*16 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, bsize*2, 1, 1, 1 ]; + st = [ 2, 4, -4, -8, 8, 8, bsize*16, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, bsize*2, 1, 1 ]; + st = [ 2, 4, -4, -8, 8, 8, 8, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, 1, bsize*2, 1 ]; + st = [ 2, 4, -4, -8, 8, 8, 8, 8, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, 1, 1, bsize*2 ]; + st = [ 2, 4, -4, -8, 8, 8, 8, 8, 8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, -4, -4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, bsize*2 ]; + st = [ 2, 2, 2, 2, 2, 4, -4, -8, 8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, 2, 1, 2, bsize*2, 1 ]; + st = [ 2, 2, 2, 2, 2, 4, -4, -8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, 2, 1, bsize*2, 1, 2 ]; + st = [ 2, 2, 2, 2, 2, 4, -4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, 1, bsize*2, 1, 2, 2 ]; + st = [ 2, 2, 2, 2, 2, -2, bsize*4, -bsize*4, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, bsize*2, 1, 2, 1, 2 ]; + st = [ 2, 2, 2, 2, 2, -bsize*4, bsize*4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, bsize*2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, bsize*4, -bsize*4, bsize*8, -bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, bsize*2, 1, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, bsize*4, bsize*4, -bsize*4, bsize*8, -bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 1, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, bsize*4, bsize*4, bsize*4, -bsize*4, bsize*8, -bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 1, 1, 1, 2, 1, 2, 1 ]; + st = [ 2, bsize*4, bsize*4, bsize*4, bsize*4, -bsize*4, bsize*8, -bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); From 7331af7cbdae5fd1e655d0dc80c426e4b6308970 Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Wed, 18 Jun 2025 15:10:00 +0000 Subject: [PATCH 12/21] test: add 10d tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.10d.js | 3291 +++++++++++++++++ 1 file changed, 3291 insertions(+) create mode 100644 lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js new file mode 100644 index 000000000000..2d29a52ab4e5 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js @@ -0,0 +1,3291 @@ +/** +* @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 toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var oneTo = require( '@stdlib/array/one-to' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var numel = require( '@stdlib/ndarray/base/numel' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var blockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' ); +var includes = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof includes, 'function', 'main export is a function'); + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -8, -8, -8, -8, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 1, 2, 1, 2, 1, 1, 1, 1 ]; + st = [ -8, -8, -8, 4, 4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 2, 1, 2, 1, 1, 1, 1 ]; + st = [ -bsize*16, -8, -8, 4, 4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1, 1, 2, 1, 1, 1, 1 ]; + st = [ bsize*16, bsize*8, 4, -4, -4, -2, -2, -2, -2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2, 1, 2, 1, 1, 1, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, -4, -4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2, 1, 1, 1, 1, 1 ]; + st = [ bsize*8, bsize*8, bsize*4, -bsize*4, -2, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, bsize*2, 1, 1, 1, 1 ]; + st = [ bsize*8, bsize*8, bsize*4, -bsize*4, -bsize*4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, bsize*2, 1, 1, 1 ]; + st = [ bsize*8, bsize*8, bsize*4, -bsize*4, -bsize*4, bsize*4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, 1, bsize*2, 1, 1 ]; + st = [ + bsize*8, + bsize*8, + bsize*4, + -bsize*4, + -bsize*4, + bsize*4, + bsize*4, + 2, + 2, + 2 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, 1, 1, bsize*2, 1 ]; + st = [ + bsize*8, + bsize*8, + bsize*4, + -bsize*4, + -bsize*4, + bsize*4, + bsize*4, + bsize*4, + 2, + 2 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, 1, 1, 1, bsize*2 ]; + st = [ + bsize*8, + bsize*8, + bsize*4, + -bsize*4, + -bsize*4, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + 2 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -4, -4, -4, -4, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, 8, -8, -4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1, 1, 1, 1, 1 ]; + st = [ -8, -8, 4, 4, 2, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1, 2, 1, 1, 1, 1, 1 ]; + st = [ -bsize*16, -8, 4, 4, 2, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, bsize*2, 1, 2, 1, 1, 1, 1, 1 ]; + st = [ -bsize*16, -bsize*8, -4, 4, 2, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*2, 1, 1, 1, 1, 1, 1 ]; + st = [ -bsize*8, -bsize*8, bsize*4, 2, 2, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, bsize*2, 1, 1, 1, 1, 1 ]; + st = [ -bsize*16, -bsize*8, bsize*4, 2, 2, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, bsize*2, 1, 1, 1, 1 ]; + st = [ -bsize*16, -bsize*8, -bsize*8, bsize*4, bsize*4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, bsize*2, 2, 1, 1 ]; + st = [ -bsize*16, -bsize*8, -bsize*8, bsize*4, bsize*4, bsize*4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, 1, bsize*2, 1, 1 ]; + st = [ + -bsize*16, + -bsize*8, + -bsize*8, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + 2, + 2, + 2 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -8, -8, -8, -8, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1, 1 ]; + st = [ 16, 16, 16, 8, 8, 4, 4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 2, 1, 2, 1, 2, 1, 1 ]; + st = [ 16, 16, 16, 8, -8, -4, 4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1, 1, 1, 1, 1 ]; + st = [ -8, -8, 4, 4, 2, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 2, 1, 2, 1, 1, 1, 1, 1 ]; + st = [ -bsize*16, -8, 4, 4, 2, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2, 1, 1, 1, 1, 1 ]; + st = [ bsize*8, bsize*8, -4, 4, 2, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, bsize*2, 2, 1, 1, 1, 1, 1 ]; + st = [ bsize*16, bsize*8, -bsize*8, 4, 2, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, bsize*2, 1, 1, 1, 1, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, bsize*4, 2, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, bsize*2, 1, 1, 1, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, bsize*4, bsize*4, 2, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, bsize*2, 1, 1, 1 ]; + st = [ bsize*16, bsize*8, bsize*8, bsize*4, bsize*4, bsize*4, 2, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, 1, bsize*2, 1, 1 ]; + st = [ + bsize*16, + bsize*8, + bsize*8, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + 2, + 2, + 2 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, 1, 1, bsize*2, 1 ]; + st = [ + bsize*16, + bsize*8, + bsize*8, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + 2, + 2 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, 1, 1, 1, bsize*2 ]; + st = [ + bsize*16, + bsize*8, + bsize*8, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + 2 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -1, -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, 4, -4, -8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 1, bsize*2 ]; + st = [ 2, 2, 2, 2, 2, 4, 4, -8, -8, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, bsize*2, 1 ]; + st = [ 2, 2, 2, 2, 2, -4, -4, -8, 8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, 2, 1, 2, bsize*2, 1, 1 ]; + st = [ 2, 2, 2, 2, 2, -4, -4, -8, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, 2, 1, bsize*2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, 4, -4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, 1, bsize*2, 1, 2, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, -2, bsize*4, -bsize*4, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, bsize*2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, -bsize*4, bsize*4, -bsize*8, bsize*8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, bsize*2, 1, 1, 2, 1, 2, 1 ]; + st = [ + 2, + 2, + 2, + 2, + bsize*4, + -bsize*4, + bsize*4, + -bsize*8, + bsize*8, + bsize*16 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 1, 1, 2, 1, 2, 1, 1 ]; + st = [ + 2, + 2, + bsize*4, + bsize*4, + -bsize*4, + bsize*4, + -bsize*8, + bsize*8, + bsize*16, + bsize*16 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 1, 1, 1, 2, 1, 2, 1, 1 ]; + st = [ + 2, + bsize*4, + bsize*4, + bsize*4, + -bsize*4, + bsize*4, + -bsize*8, + bsize*8, + bsize*16, + bsize*16 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -1, -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, 4, -4, -8, 8, 16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 2, 1, 2, 1, 1, 1, 1, 1 ]; + st = [ + 2, + -bsize*4, + -bsize*4, + -bsize*8, + bsize*8, + bsize*16, + bsize*16, + bsize*16, + bsize*16, + bsize*16 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, bsize*2, 1, 1, 2, 1, 1, 1, 1, 1 ]; + st = [ + 2, + 4, + -bsize*8, + -bsize*8, + bsize*8, + bsize*16, + bsize*16, + bsize*16, + bsize*16, + bsize*16 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, bsize*2, 1, 2, 1, 1, 1, 1, 1 ]; + st = [ + 2, + 4, + -4, + -bsize*8, + bsize*8, + bsize*16, + bsize*16, + bsize*16, + bsize*16, + bsize*16 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, bsize*4, 1, 1, 1, 1, 1, 1 ]; + st = [ + 2, + 4, + -4, + -8, + bsize*32, + bsize*32, + bsize*32, + bsize*32, + bsize*32, + bsize*32 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, bsize*2, 1, 1, 1, 1, 1 ]; + st = [ + 2, + 4, + -4, + -8, + 8, + bsize*16, + bsize*16, + bsize*16, + bsize*16, + bsize*16 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, bsize*2, 1, 1, 1, 1 ]; + st = [ 2, 4, -4, -8, 8, 8, bsize*16, bsize*16, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, bsize*2, 1, 1, 1 ]; + st = [ 2, 4, -4, -8, 8, 8, 8, bsize*16, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, 1, bsize*2, 1, 1 ]; + st = [ 2, 4, -4, -8, 8, 8, 8, 8, bsize*16, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, 1, 1, bsize*2, 1 ]; + st = [ 2, 4, -4, -8, 8, 8, 8, 8, 8, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 2, 1, 2, 1, 1, 1, 1, 1, 1, bsize*2 ]; + st = [ 2, 4, -4, -8, 8, 8, 8, 8, 8, 8, bsize*16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -1, -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, -4, -4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, bsize*2 ]; + st = [ 2, 2, 2, 2, 2, 2, 4, -4, -8, 8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, bsize*2, 1 ]; + st = [ 2, 2, 2, 2, 2, 2, 4, -4, -8, bsize*16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, 1, 2, 1, bsize*2, 1, 2 ]; + st = [ 2, 2, 2, 2, 2, 2, 4, -4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, 1, 1, bsize*2, 1, 2, 2 ]; + st = [ 2, 2, 2, 2, 2, 2, -2, bsize*4, -bsize*4, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, 1, bsize*2, 1, 2, 1, 2 ]; + st = [ 2, 2, 2, 2, 2, 2, -bsize*4, bsize*4, -bsize*8, bsize*8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, 1, bsize*2, 1, 2, 1, 2, 1 ]; + st = [ + 2, + 2, + 2, + 2, + 2, + bsize*4, + -bsize*4, + bsize*8, + -bsize*8, + bsize*16 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, 1, bsize*2, 1, 1, 2, 1, 2, 1 ]; + st = [ + 2, + 2, + 2, + 2, + bsize*4, + bsize*4, + -bsize*4, + bsize*8, + -bsize*8, + bsize*16 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, bsize*2, 1, 1, 1, 2, 1, 2, 1 ]; + st = [ + 2, + 2, + 2, + bsize*4, + bsize*4, + bsize*4, + -bsize*4, + bsize*8, + -bsize*8, + bsize*16 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 1, 1, 1, 2, 1, 2, 1 ]; + st = [ + 2, + 2, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + -bsize*4, + bsize*8, + -bsize*8, + bsize*16 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays, accessors)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ bsize*2, 1, 1, 1, 1, 1, 2, 1, 2, 1 ]; + st = [ + 2, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + -bsize*4, + bsize*8, + -bsize*8, + bsize*16 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); From e37fe7dd67d629c58b4eb661efd28da912e0827d Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Wed, 18 Jun 2025 15:12:22 +0000 Subject: [PATCH 13/21] test: add 10d tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js index 2d29a52ab4e5..c202be77e6d1 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js @@ -2722,7 +2722,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified bsize = blockSize( dt ); sh = [ 2, 1, 2, 1, 1, 1, 1, 1, 1, bsize*2 ]; - st = [ 2, 4, -4, -8, 8, 8, 8, 8, 8, 8, bsize*16 ]; + st = [ 2, 4, -4, -8, 8, 8, 8, 8, 8, 8 ]; o = strides2offset( sh, st ); xbuf = oneTo( numel( sh )*4, 'float64' ); From e1fb9c9e41fe1a2aab7e6f078ed3ba471f42eeca Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Wed, 18 Jun 2025 15:39:59 +0000 Subject: [PATCH 14/21] test: add nd tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.nd.js | 982 ++++++++++++++++++ 1 file changed, 982 insertions(+) create mode 100644 lib/node_modules/@stdlib/ndarray/base/includes/test/test.nd.js diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.nd.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.nd.js new file mode 100644 index 000000000000..47f6091add11 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.nd.js @@ -0,0 +1,982 @@ +/** +* @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 toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var oneTo = require( '@stdlib/array/one-to' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var numel = require( '@stdlib/ndarray/base/numel' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var strides2offset = require( '@stdlib/ndarray/base/strides2offset' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var includes = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof includes, 'function', 'main export is a function'); + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (row-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (row-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (row-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (row-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -8, -8, -8, -8, -8, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (row-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -4, -4, -4, -4, -4, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, 8, 8, 8, 4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 8, 8, 8, 8, 8, 8, -8, -4, 4, 2, 2 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (row-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (row-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -8, -8, -8, -8, -8, -4, -4, -2, -2, -1, -1 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1 ]; + st = [ 16, 16, 16, 16, 8, 8, 4, 4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'row-major'; + sh = [ 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1 ]; + st = [ 16, 16, 16, 16, 8, -8, -4, 4, 2, 2, 2 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (column-major, singleton dimensions)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (column-major, singleton dimensions, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (column-major, contiguous)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (column-major, contiguous, negative strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -1, -1, -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, 2, 4, -4, -8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (column-major, contiguous, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -1, -1, -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*2, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { + var actual; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, 2, 4, -4, -8, 8, 16 ]; + o = strides2offset( sh, st ); + xbuf = oneTo( 64, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (column-major, contiguous, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = shape2strides( sh, ord ); + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (column-major, contiguous, negative strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ -1, -1, -1, -1, -1, -1, -2, -2, -4, -4, -8 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); + + v = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, 2, 4, 4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a n-dimensional ndarray contains a specified value (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { + var actual; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + sh = [ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1 ]; + st = [ 2, 2, 2, 2, 2, 2, -4, -4, 8, 8, 16 ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len + + v = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); From b3d712937a803bca89851aea57066d6e9ebe877b Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Wed, 18 Jun 2025 15:55:10 +0000 Subject: [PATCH 15/21] fix: add missing 10d tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.10d.js | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js index c202be77e6d1..380265642c65 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js @@ -1088,6 +1088,104 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified t.end(); }); +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, 1, 1, bsize*2, 1 ]; + st = [ + -bsize*16, + -bsize*8, + -bsize*8, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + 2, + 2 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, 1, 1, 1, bsize*2 ]; + st = [ + -bsize*16, + -bsize*8, + -bsize*8, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + 2 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, contiguous, accessors)', function test( t ) { var actual; var ord; @@ -2074,6 +2172,53 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified t.end(); }); +tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, 1, bsize*2, 1, 1, 1, 2, 1, 2, 1 ]; + st = [ + 2, + 2, + 2, + bsize*4, + bsize*4, + -bsize*4, + bsize*4, + -bsize*8, + bsize*8, + bsize*16 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { var actual; var bsize; From a9c6dd0f22b888ca4cd759210f44cffbccb041ba Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Wed, 18 Jun 2025 16:00:37 +0000 Subject: [PATCH 16/21] fix: add missing 9d tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.9d.js | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.9d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.9d.js index 31cf049f07c9..88e76055586a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.9d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.9d.js @@ -1038,6 +1038,54 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v t.end(); }); +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) { + var actual; + var bsize; + var xbuf; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'complex128'; + ord = 'row-major'; + + bsize = blockSize( dt ); + sh = [ 1, 2, 1, 2, 1, 1, 1, 1, bsize*2 ]; + st = [ + -bsize*16, + -bsize*8, + -bsize*8, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + bsize*4, + 2 + ]; + o = strides2offset( sh, st ); + xbuf = oneTo( numel( sh )*4, 'float64' ); + + x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); + + v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( new Complex128( 5.0, 6.0 ), { + 'dtype': 'complex128' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (row-major, contiguous, accessors)', function test( t ) { var actual; var ord; @@ -1974,6 +2022,52 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v t.end(); }); +tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { + var actual; + var bsize; + var ord; + var sh; + var st; + var dt; + var o; + var x; + var v; + + dt = 'float64'; + ord = 'column-major'; + + bsize = blockSize( dt ); + sh = [ 1, bsize*2, 1, 1, 1, 2, 1, 2, 1 ]; + st = [ + 2, + 2, + bsize*4, + bsize*4, + -bsize*4, + bsize*4, + -bsize*8, + bsize*8, + bsize*16 + ]; + o = strides2offset( sh, st ); + + x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); + + v = scalar2ndarray( 8.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, false, 'returns expected value' ); + + v = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + tape( 'the function tests whether a 9-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) { var actual; var bsize; From 1072b563a4260f9eb727027b8e96aa286605aca8 Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Wed, 18 Jun 2025 16:26:21 +0000 Subject: [PATCH 17/21] test: add empty test case --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.js index e5e858cf8965..90b480ce5f08 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.js @@ -21,6 +21,9 @@ // MODULES // var tape = require( 'tape' ); +var oneTo = require( '@stdlib/array/one-to' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); var includes = require( './../lib' ); @@ -31,3 +34,19 @@ tape( 'main export is a function', function test( t ) { t.strictEqual( typeof includes, 'function', 'main export is a function' ); t.end(); }); + +tape( 'the function returns `true` if the input is an empty ndarray', function test( t ) { + var actual; + var x; + var v; + + x = ndarray( 'float64', oneTo( 8, 'float64' ), [ 0 ], [ 1 ], 0, 'row-major' ); + + v = scalar2ndarray( 9, { + 'dtype': 'float64' + }); + actual = includes( [ x, v ] ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); From d8fc736c07fd33d735745542439593cf0819305c Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 28 Jun 2025 19:03:29 -0700 Subject: [PATCH 18/21] fix: handle empty input array and update tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/ndarray/base/includes/lib/main.js | 3 +- .../ndarray/base/includes/test/test.1d.js | 6 +- .../ndarray/base/includes/test/test.2d.js | 80 +++++++++---------- 3 files changed, 45 insertions(+), 44 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/includes/lib/main.js index e0f4443ab09b..1a93d4a1d94e 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/lib/main.js @@ -305,7 +305,8 @@ function includes( arrays ) { } // Check whether we were provided an empty ndarray... if ( len === 0 ) { - return true; + // An empty array is a trivial case in which an array does not contain a search element: + return false; } // Determine whether the ndarray is one-dimensional and thus readily translates to a one-dimensional strided array... if ( ndims === 1 ) { diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.1d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.1d.js index e516244e11be..a1ec86162317 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.1d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.1d.js @@ -46,7 +46,7 @@ tape( 'the function tests whether a 1-dimensional ndarray contains a specified v x = ndarray( 'float64', oneTo( 8, 'float64' ), [ 4 ], [ 2 ], 1, 'row-major' ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -68,7 +68,7 @@ tape( 'the function tests whether a 1-dimensional ndarray contains a specified v x = ndarray( 'float64', toAccessorArray( oneTo( 8, 'float64' ) ), [ 4 ], [ 2 ], 1, 'row-major' ); - v = ndarray( 'float64', toAccessorArray( new Float64Array( [ 9.0 ] ) ), [], [ 0 ], 0, 'row-major' ); + v = ndarray( 'float64', toAccessorArray( new Float64Array( [ -99.0 ] ) ), [], [ 0 ], 0, 'row-major' ); actual = includes( [ x, v ] ); t.strictEqual( actual, false, 'returns expected value' ); @@ -88,7 +88,7 @@ tape( 'the function tests whether a 1-dimensional ndarray contains a specified v xbuf = oneTo( 12, 'float64' ); x = ndarray( 'complex128', new Complex128Array( xbuf ), [ 4 ], [ 1 ], 1, 'row-major' ); - v = scalar2ndarray( new Complex128( 1.0, 2.0 ), { + v = scalar2ndarray( new Complex128( -1.0, -2.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js index e9c39a532c43..f5978b1c34f4 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.2d.js @@ -60,7 +60,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -93,7 +93,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -126,7 +126,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -159,7 +159,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -192,7 +192,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); - v = scalar2ndarray( 4.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -225,7 +225,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); - v = scalar2ndarray( 4.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -261,7 +261,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -297,7 +297,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -332,7 +332,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -367,7 +367,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -402,7 +402,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 7.0, 8.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -437,7 +437,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 7.0, 8.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -475,7 +475,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -513,7 +513,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -546,7 +546,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -579,7 +579,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -612,7 +612,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 4.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -645,7 +645,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 4.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -681,7 +681,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -717,7 +717,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -750,7 +750,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -783,7 +783,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -816,7 +816,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -849,7 +849,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh ), dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -882,7 +882,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); - v = scalar2ndarray( 4.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -915,7 +915,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( 8, dt ), sh, st, o, ord ); - v = scalar2ndarray( 4.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -951,7 +951,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -987,7 +987,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1022,7 +1022,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1057,7 +1057,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1092,7 +1092,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 7.0, 8.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1127,7 +1127,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 7.0, 8.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1165,7 +1165,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1203,7 +1203,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 3.0, 4.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1236,7 +1236,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1269,7 +1269,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1302,7 +1302,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 4.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1335,7 +1335,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 4.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1371,7 +1371,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1407,7 +1407,7 @@ tape( 'the function tests whether a 2-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); From 5b0d799330132a1d17a9cc0fb96f6884060c3e6f Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 28 Jun 2025 19:04:32 -0700 Subject: [PATCH 19/21] test: fix failing test --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/ndarray/base/includes/test/test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.js index 90b480ce5f08..a8571957b9b2 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.js @@ -35,7 +35,7 @@ tape( 'main export is a function', function test( t ) { t.end(); }); -tape( 'the function returns `true` if the input is an empty ndarray', function test( t ) { +tape( 'the function returns `false` if the input is an empty ndarray', function test( t ) { var actual; var x; var v; @@ -46,7 +46,7 @@ tape( 'the function returns `true` if the input is an empty ndarray', function t 'dtype': 'float64' }); actual = includes( [ x, v ] ); - t.strictEqual( actual, true, 'returns expected value' ); + t.strictEqual( actual, false, 'returns expected value' ); t.end(); }); From e95d3da9b9fce8b8cdf244956658b17175e9ae8e Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 28 Jun 2025 19:05:10 -0700 Subject: [PATCH 20/21] test: test against known value --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/ndarray/base/includes/test/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.js index a8571957b9b2..3f2f91741838 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.js @@ -42,7 +42,7 @@ tape( 'the function returns `false` if the input is an empty ndarray', function x = ndarray( 'float64', oneTo( 8, 'float64' ), [ 0 ], [ 1 ], 0, 'row-major' ); - v = scalar2ndarray( 9, { + v = scalar2ndarray( 1.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); From e870766318622bc1e60894e855be8a14a9e4ae48 Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 29 Jun 2025 02:59:07 -0700 Subject: [PATCH 21/21] test: make negative case test values more obvious --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ndarray/base/includes/test/test.10d.js | 112 +++++++++--------- .../ndarray/base/includes/test/test.3d.js | 64 +++++----- .../ndarray/base/includes/test/test.4d.js | 68 +++++------ .../ndarray/base/includes/test/test.5d.js | 76 ++++++------ .../ndarray/base/includes/test/test.6d.js | 80 ++++++------- .../ndarray/base/includes/test/test.7d.js | 88 +++++++------- .../ndarray/base/includes/test/test.8d.js | 96 +++++++-------- .../ndarray/base/includes/test/test.9d.js | 104 ++++++++-------- .../ndarray/base/includes/test/test.nd.js | 32 ++--- 9 files changed, 360 insertions(+), 360 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js index 380265642c65..6b411e8a94c9 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js @@ -60,7 +60,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -93,7 +93,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -126,7 +126,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -159,7 +159,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -261,7 +261,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -297,7 +297,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -333,7 +333,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -369,7 +369,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -405,7 +405,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -441,7 +441,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -477,7 +477,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -524,7 +524,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -571,7 +571,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -618,7 +618,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -653,7 +653,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -688,7 +688,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1204,7 +1204,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1237,7 +1237,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1339,7 +1339,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1375,7 +1375,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1411,7 +1411,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1447,7 +1447,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1483,7 +1483,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1519,7 +1519,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1555,7 +1555,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1602,7 +1602,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1649,7 +1649,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1696,7 +1696,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1729,7 +1729,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1762,7 +1762,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1795,7 +1795,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1828,7 +1828,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1930,7 +1930,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1966,7 +1966,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2002,7 +2002,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2038,7 +2038,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2074,7 +2074,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2110,7 +2110,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2157,7 +2157,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2204,7 +2204,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2251,7 +2251,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2298,7 +2298,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2333,7 +2333,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -2368,7 +2368,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -2906,7 +2906,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2939,7 +2939,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -3041,7 +3041,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -3077,7 +3077,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -3113,7 +3113,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -3149,7 +3149,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -3185,7 +3185,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -3232,7 +3232,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -3279,7 +3279,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -3326,7 +3326,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -3373,7 +3373,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -3420,7 +3420,7 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js index 8f5a1d99d8b4..5ddf3e28d2de 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.3d.js @@ -60,7 +60,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -93,7 +93,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -126,7 +126,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -159,7 +159,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -192,7 +192,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -225,7 +225,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -261,7 +261,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -297,7 +297,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -333,7 +333,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -368,7 +368,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -403,7 +403,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -620,7 +620,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -653,7 +653,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -686,7 +686,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -719,7 +719,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( 8, dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 6.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -755,7 +755,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -791,7 +791,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -827,7 +827,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -860,7 +860,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -893,7 +893,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -926,7 +926,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -959,7 +959,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1061,7 +1061,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1097,7 +1097,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1133,7 +1133,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1168,7 +1168,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1203,7 +1203,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1420,7 +1420,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1453,7 +1453,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1555,7 +1555,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1591,7 +1591,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1627,7 +1627,7 @@ tape( 'the function tests whether a 3-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.4d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.4d.js index d51630685e0f..59953848d327 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.4d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.4d.js @@ -60,7 +60,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -93,7 +93,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -126,7 +126,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -159,7 +159,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -192,7 +192,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -225,7 +225,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -261,7 +261,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -297,7 +297,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -333,7 +333,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -369,7 +369,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -404,7 +404,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -439,7 +439,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -694,7 +694,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -727,7 +727,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -829,7 +829,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -865,7 +865,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -901,7 +901,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -937,7 +937,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -970,7 +970,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1003,7 +1003,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1036,7 +1036,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1069,7 +1069,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1171,7 +1171,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1207,7 +1207,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1243,7 +1243,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1279,7 +1279,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1314,7 +1314,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1349,7 +1349,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1604,7 +1604,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1637,7 +1637,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1739,7 +1739,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1775,7 +1775,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1811,7 +1811,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1847,7 +1847,7 @@ tape( 'the function tests whether a 4-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js index 8617e7474eaa..938f208a32e6 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.5d.js @@ -60,7 +60,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -93,7 +93,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -126,7 +126,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -159,7 +159,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -192,7 +192,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -225,7 +225,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -261,7 +261,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -297,7 +297,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -333,7 +333,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -369,7 +369,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -405,7 +405,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -440,7 +440,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -475,7 +475,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -768,7 +768,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -801,7 +801,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -903,7 +903,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -939,7 +939,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -975,7 +975,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1011,7 +1011,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1047,7 +1047,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1080,7 +1080,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1113,7 +1113,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1146,7 +1146,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1179,7 +1179,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1281,7 +1281,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1317,7 +1317,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1353,7 +1353,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1389,7 +1389,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1425,7 +1425,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*2, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1460,7 +1460,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1495,7 +1495,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1788,7 +1788,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1821,7 +1821,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1923,7 +1923,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1959,7 +1959,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1995,7 +1995,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2031,7 +2031,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2067,7 +2067,7 @@ tape( 'the function tests whether a 5-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.6d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.6d.js index de186b4b0b99..bab06d5e4c12 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.6d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.6d.js @@ -60,7 +60,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -93,7 +93,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -126,7 +126,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -159,7 +159,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -261,7 +261,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -297,7 +297,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -333,7 +333,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -369,7 +369,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -405,7 +405,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -441,7 +441,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -476,7 +476,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -511,7 +511,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -842,7 +842,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -875,7 +875,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -977,7 +977,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1013,7 +1013,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1049,7 +1049,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1085,7 +1085,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1121,7 +1121,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1157,7 +1157,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1190,7 +1190,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1223,7 +1223,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1256,7 +1256,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1289,7 +1289,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1391,7 +1391,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1427,7 +1427,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1463,7 +1463,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1499,7 +1499,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1535,7 +1535,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1571,7 +1571,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1606,7 +1606,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1641,7 +1641,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1972,7 +1972,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2005,7 +2005,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2107,7 +2107,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2143,7 +2143,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2179,7 +2179,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2215,7 +2215,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2251,7 +2251,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2287,7 +2287,7 @@ tape( 'the function tests whether a 6-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.7d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.7d.js index 0a2a35900c16..aa2c571c4a79 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.7d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.7d.js @@ -60,7 +60,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -93,7 +93,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -126,7 +126,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -159,7 +159,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -261,7 +261,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -297,7 +297,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -333,7 +333,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -369,7 +369,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -405,7 +405,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -441,7 +441,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -477,7 +477,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -512,7 +512,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -547,7 +547,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -916,7 +916,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -949,7 +949,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1051,7 +1051,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1087,7 +1087,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1123,7 +1123,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1159,7 +1159,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1195,7 +1195,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1231,7 +1231,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1267,7 +1267,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1300,7 +1300,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1333,7 +1333,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1366,7 +1366,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1399,7 +1399,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1501,7 +1501,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1537,7 +1537,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1573,7 +1573,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1609,7 +1609,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1645,7 +1645,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1681,7 +1681,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1717,7 +1717,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1752,7 +1752,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1787,7 +1787,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -2156,7 +2156,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2189,7 +2189,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2291,7 +2291,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2327,7 +2327,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2363,7 +2363,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2399,7 +2399,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2435,7 +2435,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2471,7 +2471,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2507,7 +2507,7 @@ tape( 'the function tests whether a 7-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.8d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.8d.js index 9faf924b01fc..2ab64e75953b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.8d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.8d.js @@ -60,7 +60,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -93,7 +93,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -126,7 +126,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -159,7 +159,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -261,7 +261,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -297,7 +297,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -333,7 +333,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -369,7 +369,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -405,7 +405,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -441,7 +441,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -477,7 +477,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -513,7 +513,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -548,7 +548,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -583,7 +583,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -990,7 +990,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1023,7 +1023,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1125,7 +1125,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1161,7 +1161,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1197,7 +1197,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1233,7 +1233,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1269,7 +1269,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1305,7 +1305,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1341,7 +1341,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1377,7 +1377,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1410,7 +1410,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1443,7 +1443,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1476,7 +1476,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1509,7 +1509,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1611,7 +1611,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1647,7 +1647,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1683,7 +1683,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1719,7 +1719,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1755,7 +1755,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1791,7 +1791,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1827,7 +1827,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1863,7 +1863,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1898,7 +1898,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1933,7 +1933,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -2340,7 +2340,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2373,7 +2373,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2475,7 +2475,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2511,7 +2511,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2547,7 +2547,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2583,7 +2583,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2619,7 +2619,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2655,7 +2655,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2691,7 +2691,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2727,7 +2727,7 @@ tape( 'the function tests whether a 8-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.9d.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.9d.js index 88e76055586a..81af7207628a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.9d.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.9d.js @@ -60,7 +60,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -93,7 +93,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -126,7 +126,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -159,7 +159,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -261,7 +261,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -297,7 +297,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -333,7 +333,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -369,7 +369,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -405,7 +405,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -441,7 +441,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -477,7 +477,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -523,7 +523,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -569,7 +569,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -604,7 +604,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -639,7 +639,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -1104,7 +1104,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1137,7 +1137,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1239,7 +1239,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1275,7 +1275,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1311,7 +1311,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1347,7 +1347,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1383,7 +1383,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1419,7 +1419,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1455,7 +1455,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1501,7 +1501,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1547,7 +1547,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1580,7 +1580,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1613,7 +1613,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1646,7 +1646,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1679,7 +1679,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1781,7 +1781,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1817,7 +1817,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1853,7 +1853,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1889,7 +1889,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1925,7 +1925,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -1961,7 +1961,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2007,7 +2007,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2053,7 +2053,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2099,7 +2099,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2134,7 +2134,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -2169,7 +2169,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -2664,7 +2664,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2697,7 +2697,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2799,7 +2799,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2835,7 +2835,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2871,7 +2871,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2907,7 +2907,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2943,7 +2943,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -2979,7 +2979,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -3015,7 +3015,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -3051,7 +3051,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -3087,7 +3087,7 @@ tape( 'the function tests whether a 9-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh )*4, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.nd.js b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.nd.js index 47f6091add11..1559ca11fa9e 100644 --- a/lib/node_modules/@stdlib/ndarray/base/includes/test/test.nd.js +++ b/lib/node_modules/@stdlib/ndarray/base/includes/test/test.nd.js @@ -59,7 +59,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -92,7 +92,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -125,7 +125,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -158,7 +158,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -259,7 +259,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -294,7 +294,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -397,7 +397,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -430,7 +430,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -529,7 +529,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -562,7 +562,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 8.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -595,7 +595,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -628,7 +628,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -729,7 +729,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -764,7 +764,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord ); - v = scalar2ndarray( new Complex128( 1.0, 0.0 ), { + v = scalar2ndarray( new Complex128( -99.0, -99.0 ), { 'dtype': 'complex128' }); actual = includes( [ x, v ] ); @@ -867,7 +867,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] ); @@ -900,7 +900,7 @@ tape( 'the function tests whether a n-dimensional ndarray contains a specified v x = ndarray( dt, toAccessorArray( oneTo( numel( sh ), dt ) ), sh, st, o, ord ); - v = scalar2ndarray( 9.0, { + v = scalar2ndarray( -99.0, { 'dtype': 'float64' }); actual = includes( [ x, v ] );