diff --git a/lib/node_modules/@stdlib/ndarray/base/tile/README.md b/lib/node_modules/@stdlib/ndarray/base/tile/README.md
new file mode 100644
index 000000000000..9fb79806ddd7
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/tile/README.md
@@ -0,0 +1,129 @@
+
+
+# tile
+
+> Return an [ndarray][@stdlib/ndarray/base/ctor] created by repeating the elements of an input [ndarray][@stdlib/ndarray/base/ctor] a specified number of times along each dimension.
+
+
+
+
+
+
+
+
+
+
+
+## Usage
+
+```javascript
+var tile = require( '@stdlib/ndarray/base/tile' );
+```
+
+#### tile( x, reps )
+
+Returns an [ndarray][@stdlib/ndarray/base/ctor] created by repeating the elements of an input [ndarray][@stdlib/ndarray/base/ctor] a specified number of times along each dimension.
+
+```javascript
+var array = require( '@stdlib/ndarray/array' );
+
+var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+// returns [ [ 1, 2 ], [ 3, 4 ] ]
+
+var y = tile( x, [ 2, 2 ] );
+// returns [ [ 1, 2, 1, 2 ], [ 3, 4, 3, 4 ], [ 1, 2, 1, 2 ], [ 3, 4, 3, 4 ] ]
+```
+
+The function accepts the following arguments:
+
+- **x**: input [ndarray][@stdlib/ndarray/base/ctor].
+- **reps**: list specifying the number of times to repeat elements of an input [ndarray][@stdlib/ndarray/base/ctor] along each dimension.
+
+
+
+
+
+
+
+
+
+## Notes
+
+- The number of repetitions must have at least as many elements as the number of input dimensions. When the number of repetitions exceeds the number of input dimensions, the input [ndarray][@stdlib/ndarray/base/ctor] is treated as if singleton dimensions were prepended.
+- The function always copies data to a new [ndarray][@stdlib/ndarray/base/ctor].
+
+
+
+
+
+
+
+
+
+## Examples
+
+
+
+```javascript
+var array = require( '@stdlib/ndarray/array' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var tile = require( '@stdlib/ndarray/base/tile' );
+
+// Create a 2x2 array:
+var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+console.log( ndarray2array( x ) );
+
+// Tile the array to 4x4:
+var out = tile( x, [ 2, 2 ] );
+console.log( ndarray2array( out ) );
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[@stdlib/ndarray/base/ctor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/ctor
+
+
+
+
diff --git a/lib/node_modules/@stdlib/ndarray/base/tile/benchmark/benchmark.js b/lib/node_modules/@stdlib/ndarray/base/tile/benchmark/benchmark.js
new file mode 100644
index 000000000000..a0f87fc4c461
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/tile/benchmark/benchmark.js
@@ -0,0 +1,115 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var bench = require( '@stdlib/bench' );
+var Float64Array = require( '@stdlib/array/float64' );
+var ndarrayBase = require( '@stdlib/ndarray/base/ctor' );
+var ndarray = require( '@stdlib/ndarray/ctor' );
+var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var format = require( '@stdlib/string/format' );
+var pkg = require( './../package.json' ).name;
+var tile = require( './../lib' );
+
+
+// MAIN //
+
+bench( format( '%s::ctor=base,ndims=2,order=row-major', pkg ), function benchmark( b ) {
+ var strides;
+ var values;
+ var buffer;
+ var offset;
+ var dtype;
+ var shape;
+ var order;
+ var out;
+ var i;
+
+ dtype = 'float64';
+ buffer = new Float64Array( 4 );
+ shape = [ 2, 2 ];
+ strides = [ 2, 1 ];
+ offset = 0;
+ order = 'row-major';
+
+ values = [
+ ndarrayBase( dtype, buffer, shape, strides, offset, order ),
+ ndarrayBase( dtype, buffer, shape, strides, offset, order ),
+ ndarrayBase( dtype, buffer, shape, strides, offset, order ),
+ ndarrayBase( dtype, buffer, shape, strides, offset, order ),
+ ndarrayBase( dtype, buffer, shape, strides, offset, order )
+ ];
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ out = tile( values[ i%values.length ], [ 2, 2 ] );
+ if ( typeof out !== 'object' ) {
+ b.fail( 'should return an object' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( out ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( format( '%s::ctor=non-base,ndims=2,order=row-major', pkg ), function benchmark( b ) {
+ var strides;
+ var values;
+ var buffer;
+ var offset;
+ var dtype;
+ var shape;
+ var order;
+ var out;
+ var i;
+
+ dtype = 'float64';
+ buffer = new Float64Array( 4 );
+ shape = [ 2, 2 ];
+ strides = [ 2, 1 ];
+ offset = 0;
+ order = 'row-major';
+
+ values = [
+ ndarray( dtype, buffer, shape, strides, offset, order ),
+ ndarray( dtype, buffer, shape, strides, offset, order ),
+ ndarray( dtype, buffer, shape, strides, offset, order ),
+ ndarray( dtype, buffer, shape, strides, offset, order ),
+ ndarray( dtype, buffer, shape, strides, offset, order )
+ ];
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ out = tile( values[ i%values.length ], [ 2, 2 ] );
+ if ( typeof out !== 'object' ) {
+ b.fail( 'should return an object' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( out ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
diff --git a/lib/node_modules/@stdlib/ndarray/base/tile/benchmark/benchmark.ndims.js b/lib/node_modules/@stdlib/ndarray/base/tile/benchmark/benchmark.ndims.js
new file mode 100644
index 000000000000..6de7285b034e
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/tile/benchmark/benchmark.ndims.js
@@ -0,0 +1,106 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var bench = require( '@stdlib/bench' );
+var array = require( '@stdlib/ndarray/array' );
+var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var format = require( '@stdlib/string/format' );
+var pkg = require( './../package.json' ).name;
+var tile = require( './../lib' );
+
+
+// FUNCTIONS //
+
+/**
+* Creates a benchmark function.
+*
+* @private
+* @param {PositiveInteger} ndims - number of output dimensions
+* @returns {Function} benchmark function
+*/
+function createBenchmark( ndims ) {
+ var reps;
+ var x;
+ var i;
+
+ x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+
+ reps = [];
+ for ( i = 0; i < ndims; i++ ) {
+ reps.push( 1 );
+ }
+ reps[ ndims-1 ] = 2;
+ if ( ndims >= 2 ) {
+ reps[ ndims-2 ] = 2;
+ }
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var out;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ out = tile( x, reps );
+ if ( typeof out !== 'object' ) {
+ b.fail( 'should return an object' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( out ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+ }
+}
+
+
+// MAIN //
+
+/**
+* Main execution sequence.
+*
+* @private
+*/
+function main() {
+ var min;
+ var max;
+ var f;
+ var i;
+
+ min = 2;
+ max = 10;
+
+ for ( i = min; i <= max; i++ ) {
+ f = createBenchmark( i );
+ bench( format( '%s::ctor=non-base,ndims=%d,order=row-major', pkg, i ), f );
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/ndarray/base/tile/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/base/tile/docs/repl.txt
new file mode 100644
index 000000000000..339b8f8477de
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/tile/docs/repl.txt
@@ -0,0 +1,35 @@
+
+{{alias}}( x, reps )
+ Returns an ndarray created by repeating the elements of an input ndarray
+ a specified number of times along each dimension.
+
+ The number of repetitions must have at least as many elements as the number
+ of input dimensions. When the number of repetitions exceeds the number of
+ input dimensions, the input array is treated as if singleton dimensions
+ were prepended.
+
+ The function always copies data to a new ndarray.
+
+ Parameters
+ ----------
+ x: ndarray
+ Input array.
+
+ reps: ArrayLikeObject
+ Number of repetitions along each dimension.
+
+ Returns
+ -------
+ out: ndarray
+ Output array.
+
+ Examples
+ --------
+ > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] )
+ [ [ 1, 2 ], [ 3, 4 ] ]
+ > var o = {{alias}}( x, [ 2, 2 ] )
+ [ [ 1, 2, 1, 2 ], [ 3, 4, 3, 4 ], [ 1, 2, 1, 2 ], [ 3, 4, 3, 4 ] ]
+
+ See Also
+ --------
+
diff --git a/lib/node_modules/@stdlib/ndarray/base/tile/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/tile/docs/types/index.d.ts
new file mode 100644
index 000000000000..2e9eb8653434
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/tile/docs/types/index.d.ts
@@ -0,0 +1,52 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+// TypeScript Version: 4.1
+
+///
+
+import { ArrayLike } from '@stdlib/types/array';
+import { ndarray } from '@stdlib/types/ndarray';
+
+/**
+* Returns an ndarray created by repeating the elements of an input ndarray a specified number of times along each dimension.
+*
+* ## Notes
+*
+* - The number of repetitions must have at least as many elements as the number of input dimensions. When the number of repetitions exceeds the number of input dimensions, the input array is treated as if singleton dimensions were prepended.
+* - The function always copies data to a new ndarray.
+*
+* @param x - input array
+* @param reps - number of repetitions along each dimension
+* @returns output array
+*
+* @example
+* var array = require( '@stdlib/ndarray/array' );
+*
+* var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+* // returns [ [ 1, 2 ], [ 3, 4 ] ]
+*
+* var y = tile( x, [ 2, 2 ] );
+* // returns [ [ 1, 2, 1, 2 ], [ 3, 4, 3, 4 ], [ 1, 2, 1, 2 ], [ 3, 4, 3, 4 ] ]
+*/
+declare function tile( x: T, reps: ArrayLike ): T;
+
+
+// EXPORTS //
+
+export = tile;
diff --git a/lib/node_modules/@stdlib/ndarray/base/tile/docs/types/test.ts b/lib/node_modules/@stdlib/ndarray/base/tile/docs/types/test.ts
new file mode 100644
index 000000000000..fa079a85f8e0
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/tile/docs/types/test.ts
@@ -0,0 +1,82 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+/* eslint-disable space-in-parens */
+
+///
+
+import zeros = require( '@stdlib/ndarray/zeros' );
+import tile = require( './index' );
+
+
+// TESTS //
+
+// The function returns an ndarray having the same type as the input ndarray...
+{
+ tile( zeros( [ 2, 2 ], { 'dtype': 'float64' } ), [ 2, 2 ] ); // $ExpectType float64ndarray
+ tile( zeros( [ 2, 2 ], { 'dtype': 'float32' } ), [ 2, 2 ] ); // $ExpectType float32ndarray
+ tile( zeros( [ 2, 2 ], { 'dtype': 'complex128' } ), [ 2, 2 ] ); // $ExpectType complex128ndarray
+ tile( zeros( [ 2, 2 ], { 'dtype': 'complex64' } ), [ 2, 2 ] ); // $ExpectType complex64ndarray
+ tile( zeros( [ 2, 2 ], { 'dtype': 'int32' } ), [ 2, 2 ] ); // $ExpectType int32ndarray
+ tile( zeros( [ 2, 2 ], { 'dtype': 'int16' } ), [ 2, 2 ] ); // $ExpectType int16ndarray
+ tile( zeros( [ 2, 2 ], { 'dtype': 'int8' } ), [ 2, 2 ] ); // $ExpectType int8ndarray
+ tile( zeros( [ 2, 2 ], { 'dtype': 'uint32' } ), [ 2, 2 ] ); // $ExpectType uint32ndarray
+ tile( zeros( [ 2, 2 ], { 'dtype': 'uint16' } ), [ 2, 2 ] ); // $ExpectType uint16ndarray
+ tile( zeros( [ 2, 2 ], { 'dtype': 'uint8' } ), [ 2, 2 ] ); // $ExpectType uint8ndarray
+ tile( zeros( [ 2, 2 ], { 'dtype': 'uint8c' } ), [ 2, 2 ] ); // $ExpectType uint8cndarray
+ tile( zeros( [ 2, 2 ], { 'dtype': 'generic' } ), [ 2, 2 ] ); // $ExpectType genericndarray
+}
+
+// The compiler throws an error if the function is not provided a first argument which is an ndarray...
+{
+ tile( '5', [ 2, 2, 2 ] ); // $ExpectError
+ tile( 5, [ 2, 2, 2 ] ); // $ExpectError
+ tile( true, [ 2, 2, 2 ] ); // $ExpectError
+ tile( false, [ 2, 2, 2 ] ); // $ExpectError
+ tile( null, [ 2, 2, 2 ] ); // $ExpectError
+ tile( {}, [ 2, 2, 2 ] ); // $ExpectError
+ tile( [ '5' ], [ 2, 2, 2 ] ); // $ExpectError
+ tile( ( x: number ): number => x, [ 2, 2, 2 ] ); // $ExpectError
+}
+
+// The compiler throws an error if the function is not provided a second argument which is an array-like object containing numbers...
+{
+ const x = zeros( [ 2, 2 ], {
+ 'dtype': 'float64'
+ });
+
+ tile( x, '5' ); // $ExpectError
+ tile( x, 5 ); // $ExpectError
+ tile( x, true ); // $ExpectError
+ tile( x, false ); // $ExpectError
+ tile( x, null ); // $ExpectError
+ tile( x, {} ); // $ExpectError
+ tile( x, [ '5' ] ); // $ExpectError
+ tile( x, ( x: number ): number => x ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ const x = zeros( [ 2, 2 ], {
+ 'dtype': 'float64'
+ });
+
+ tile(); // $ExpectError
+ tile( x ); // $ExpectError
+ tile( x, [ 1, 2, 3 ], [ 2, 3 ] ); // $ExpectError
+}
diff --git a/lib/node_modules/@stdlib/ndarray/base/tile/examples/index.js b/lib/node_modules/@stdlib/ndarray/base/tile/examples/index.js
new file mode 100644
index 000000000000..20363b4dceeb
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/tile/examples/index.js
@@ -0,0 +1,31 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+var array = require( '@stdlib/ndarray/array' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var tile = require( './../lib' );
+
+// Create a 2x2 array:
+var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+console.log( ndarray2array( x ) );
+
+// Tile the array to 4x4:
+var out = tile( x, [ 2, 2 ] );
+console.log( ndarray2array( out ) );
diff --git a/lib/node_modules/@stdlib/ndarray/base/tile/lib/index.js b/lib/node_modules/@stdlib/ndarray/base/tile/lib/index.js
new file mode 100644
index 000000000000..c8e214297abd
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/tile/lib/index.js
@@ -0,0 +1,44 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+/**
+* Return an ndarray created by repeating the elements of an input ndarray a specified number of times along each dimension.
+*
+* @module @stdlib/ndarray/base/tile
+*
+* @example
+* var array = require( '@stdlib/ndarray/array' );
+* var tile = require( '@stdlib/ndarray/base/tile' );
+*
+* var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+* // returns [ [ 1, 2 ], [ 3, 4 ] ]
+*
+* var y = tile( x, [ 2, 2 ] );
+* // returns [ [ 1, 2, 1, 2 ], [ 3, 4, 3, 4 ], [ 1, 2, 1, 2 ], [ 3, 4, 3, 4 ] ]
+*/
+
+// MODULES //
+
+var main = require( './main.js' );
+
+
+// EXPORTS //
+
+module.exports = main;
diff --git a/lib/node_modules/@stdlib/ndarray/base/tile/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/tile/lib/main.js
new file mode 100644
index 000000000000..03a13c3af4f3
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/tile/lib/main.js
@@ -0,0 +1,152 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var ndarray = require( '@stdlib/ndarray/base/ctor' );
+var assign = require( '@stdlib/ndarray/base/assign' );
+var buffer = require( '@stdlib/ndarray/base/buffer' );
+var numel = require( '@stdlib/ndarray/base/numel' );
+var shape2strides = require( '@stdlib/ndarray/base/shape2strides' );
+var strides2order = require( '@stdlib/ndarray/base/strides2order' );
+var getShape = require( '@stdlib/ndarray/base/shape' );
+var getStrides = require( '@stdlib/ndarray/base/strides' );
+var getOffset = require( '@stdlib/ndarray/base/offset' );
+var getOrder = require( '@stdlib/ndarray/base/order' );
+var getDType = require( '@stdlib/ndarray/base/dtype' );
+var getData = require( '@stdlib/ndarray/base/data-buffer' );
+var zeros = require( '@stdlib/array/base/zeros' );
+var format = require( '@stdlib/string/format' );
+
+
+// MAIN //
+
+/**
+* Returns an ndarray created by repeating the elements of an input ndarray a specified number of times along each dimension.
+*
+* ## Notes
+*
+* - The number of repetitions must have at least as many elements as the number of input dimensions. When the number of repetitions exceeds the number of input dimensions, the input array is treated as if singleton dimensions were prepended.
+* - The function always copies data to a new ndarray.
+*
+* @param {ndarray} x - input array
+* @param {NonNegativeIntegerArray} reps - number of repetitions along each dimension
+* @throws {RangeError} second argument must have at least as many elements as the number of input dimensions
+* @returns {ndarray} output array
+*
+* @example
+* var array = require( '@stdlib/ndarray/array' );
+*
+* var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+* // returns [ [ 1, 2 ], [ 3, 4 ] ]
+*
+* var y = tile( x, [ 2, 2 ] );
+* // returns [ [ 1, 2, 1, 2 ], [ 3, 4, 3, 4 ], [ 1, 2, 1, 2 ], [ 3, 4, 3, 4 ] ]
+*/
+function tile( x, reps ) {
+ var dtype;
+ var order;
+ var shx;
+ var sho;
+ var shi;
+ var sto;
+ var buf;
+ var len;
+ var out;
+ var Ds;
+ var si;
+ var sx;
+ var v1;
+ var v2;
+ var M;
+ var N;
+ var o;
+ var s;
+ var t;
+ var i;
+ var j;
+ var k;
+
+ shx = getShape( x, false );
+ sx = getStrides( x, false );
+ dtype = getDType( x );
+ N = reps.length;
+ M = shx.length;
+
+ if ( N < M ) {
+ throw new RangeError( format( 'invalid argument. Second argument must have at least as many elements as the number of dimensions of the first argument. Number of input dimensions: `%u`. Number of repetitions: `%u`.', M, N ) );
+ }
+ // Compute the implicit left-padding amount for the input shape:
+ Ds = N - M;
+
+ o = strides2order( sx );
+ if ( o === 0 || o === 3 ) {
+ // Fallback to stated layout when unable to infer the underlying physical layout:
+ order = getOrder( x );
+ } else if ( o === 1 ) {
+ order = 'row-major';
+ } else {
+ order = 'column-major';
+ }
+ // Compute an interleaved 2N-D shape and strides for "broadcasting" the input, along with the final N-D output shape. By inserting a repetition axis next to each original axis, a contiguous 2N-D buffer can be reinterpreted as the N-D tiled output without an additional copy...
+ shi = zeros( 2*N );
+ si = zeros( 2*N );
+ sho = zeros( N );
+ for ( i = 0; i < N; i++ ) {
+ j = i - Ds;
+ k = 2 * i;
+ s = ( j < 0 ) ? 1 : shx[ j ];
+ t = ( j < 0 ) ? 0 : sx[ j ];
+ sho[ i ] = reps[ i ] * s;
+ if ( order === 'row-major' ) {
+ shi[ k ] = reps[ i ];
+ shi[ k+1 ] = s;
+ si[ k+1 ] = t;
+ } else { // order === 'column-major'
+ shi[ k ] = s;
+ shi[ k+1 ] = reps[ i ];
+ si[ k ] = t;
+ }
+ }
+ if ( N > 0 ) {
+ len = numel( sho );
+ sto = shape2strides( sho, order );
+ } else {
+ len = 1;
+ sto = [ 0 ];
+ }
+ // Allocate an output array:
+ buf = buffer( dtype, len );
+ out = new x.constructor( dtype, buf, sho, sto, 0, order );
+
+ // Create a "broadcasted" input 2N-D view over the data buffers:
+ v1 = ndarray( dtype, getData( x ), shi, si, getOffset( x ), order );
+ v2 = ndarray( dtype, buf, shi, shape2strides( shi, order ), 0, order );
+
+ // Copy the elements to the output array:
+ assign( [ v1, v2 ] );
+
+ return out;
+}
+
+
+// EXPORTS //
+
+module.exports = tile;
diff --git a/lib/node_modules/@stdlib/ndarray/base/tile/package.json b/lib/node_modules/@stdlib/ndarray/base/tile/package.json
new file mode 100644
index 000000000000..1453d1870b67
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/tile/package.json
@@ -0,0 +1,68 @@
+{
+ "name": "@stdlib/ndarray/base/tile",
+ "version": "0.0.0",
+ "description": "Construct a new ndarray by repeating the elements of an input ndarray a specified number of times along each dimension.",
+ "license": "Apache-2.0",
+ "author": {
+ "name": "The Stdlib Authors",
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
+ },
+ "contributors": [
+ {
+ "name": "The Stdlib Authors",
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
+ }
+ ],
+ "main": "./lib",
+ "directories": {
+ "benchmark": "./benchmark",
+ "doc": "./docs",
+ "example": "./examples",
+ "lib": "./lib",
+ "test": "./test"
+ },
+ "types": "./docs/types",
+ "scripts": {},
+ "homepage": "https://github.com/stdlib-js/stdlib",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/stdlib-js/stdlib.git"
+ },
+ "bugs": {
+ "url": "https://github.com/stdlib-js/stdlib/issues"
+ },
+ "dependencies": {},
+ "devDependencies": {},
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "keywords": [
+ "stdlib",
+ "stdtypes",
+ "types",
+ "base",
+ "ndarray",
+ "tile",
+ "repeat",
+ "repmat",
+ "multidimensional",
+ "array",
+ "utilities",
+ "utility",
+ "utils",
+ "util"
+ ],
+ "__stdlib__": {}
+}
diff --git a/lib/node_modules/@stdlib/ndarray/base/tile/test/test.js b/lib/node_modules/@stdlib/ndarray/base/tile/test/test.js
new file mode 100644
index 000000000000..67d1403471e1
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/tile/test/test.js
@@ -0,0 +1,644 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var tape = require( 'tape' );
+var array = require( '@stdlib/ndarray/array' );
+var ndarray = require( '@stdlib/ndarray/ctor' );
+var base = require( '@stdlib/ndarray/base/ctor' );
+var instanceOf = require( '@stdlib/assert/instance-of' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var getShape = require( '@stdlib/ndarray/shape' );
+var getData = require( '@stdlib/ndarray/data-buffer' );
+var numel = require( '@stdlib/ndarray/base/numel' );
+var tile = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof tile, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function tiles an input array (row-major, base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = base( 'generic', [ 1, 2, 3, 4 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
+ y = tile( x, [ 2, 2 ] );
+
+ expected = [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, base ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 4, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function tiles an input array (row-major, non-base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+ y = tile( x, [ 2, 2 ] );
+
+ expected = [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, ndarray ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 4, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function tiles an input array (column-major, base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = base( 'generic', [ 1, 3, 2, 4 ], [ 2, 2 ], [ 1, 2 ], 0, 'column-major' );
+ y = tile( x, [ 2, 2 ] );
+
+ expected = [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, base ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 4, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function tiles an input array (column-major, non-base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = array( [ [ 1, 2 ], [ 3, 4 ] ], {
+ 'order': 'column-major'
+ });
+ y = tile( x, [ 2, 2 ] );
+
+ expected = [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, ndarray ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 4, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function tiles an input array (negative strides, base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = base( 'generic', [ 1, 2, 3, 4 ], [ 2, 2 ], [ -2, -1 ], 3, 'row-major' );
+ y = tile( x, [ 2, 2 ] );
+
+ expected = [
+ [ 4, 3, 4, 3 ],
+ [ 2, 1, 2, 1 ],
+ [ 4, 3, 4, 3 ],
+ [ 2, 1, 2, 1 ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, base ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 4, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function tiles an input array (negative strides, non-base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = ndarray( 'generic', [ 1, 2, 3, 4 ], [ 2, 2 ], [ -2, -1 ], 3, 'row-major' );
+ y = tile( x, [ 2, 2 ] );
+
+ expected = [
+ [ 4, 3, 4, 3 ],
+ [ 2, 1, 2, 1 ],
+ [ 4, 3, 4, 3 ],
+ [ 2, 1, 2, 1 ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, ndarray ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 4, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function tiles an input array (non-contiguous, base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = base( 'generic', [ 1, 2, 3, 4, 5, 6, 7, 8 ], [ 2, 2 ], [ 4, 2 ], 1, 'row-major' );
+ y = tile( x, [ 2, 2 ] );
+
+ expected = [
+ [ 2, 4, 2, 4 ],
+ [ 6, 8, 6, 8 ],
+ [ 2, 4, 2, 4 ],
+ [ 6, 8, 6, 8 ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, base ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 4, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function tiles an input array (non-contiguous, non-base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = ndarray( 'generic', [ 1, 2, 3, 4, 5, 6, 7, 8 ], [ 2, 2 ], [ 4, 2 ], 1, 'row-major' );
+ y = tile( x, [ 2, 2 ] );
+
+ expected = [
+ [ 2, 4, 2, 4 ],
+ [ 6, 8, 6, 8 ],
+ [ 2, 4, 2, 4 ],
+ [ 6, 8, 6, 8 ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, ndarray ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 4, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function prepends singleton dimensions when the number of repetitions exceeds the number of input dimensions (base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = base( 'generic', [ 1, 2, 3, 4 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
+ y = tile( x, [ 3, 2, 2 ] );
+
+ expected = [
+ [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ],
+ [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ],
+ [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, base ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 3, 4, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function prepends singleton dimensions when the number of repetitions exceeds the number of input dimensions (non-base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+ y = tile( x, [ 3, 2, 2 ] );
+
+ expected = [
+ [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ],
+ [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ],
+ [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, ndarray ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 3, 4, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function prepends singleton dimensions when the number of repetitions exceeds the number of input dimensions (column-major, base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = base( 'generic', [ 1, 3, 2, 4 ], [ 2, 2 ], [ 1, 2 ], 0, 'column-major' );
+ y = tile( x, [ 3, 2, 2 ] );
+
+ expected = [
+ [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ],
+ [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ],
+ [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, base ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 3, 4, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function prepends singleton dimensions when the number of repetitions exceeds the number of input dimensions (column-major, non-base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = array( [ [ 1, 2 ], [ 3, 4 ] ], {
+ 'order': 'column-major'
+ });
+ y = tile( x, [ 3, 2, 2 ] );
+
+ expected = [
+ [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ],
+ [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ],
+ [
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ],
+ [ 1, 2, 1, 2 ],
+ [ 3, 4, 3, 4 ]
+ ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, ndarray ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 3, 4, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function throws an error if the number of repetitions is less than the number of input dimensions', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ x = base( 'generic', [ 1, 2, 3, 4, 5, 6, 7, 8 ], [ 2, 2, 2 ], [ 4, 2, 1 ], 0, 'row-major' );
+
+ values = [
+ [],
+ [ 2 ],
+ [ 2, 2 ]
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ tile( x, value );
+ };
+ }
+});
+
+tape( 'the function tiles an input array when all repetitions are equal to one (base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = base( 'generic', [ 1, 2, 3, 4, 5, 6, 7, 8 ], [ 2, 2, 2 ], [ 4, 2, 1 ], 0, 'row-major' );
+ y = tile( x, [ 1, 1, 1 ] );
+
+ expected = [
+ [ [ 1, 2 ], [ 3, 4 ] ],
+ [ [ 5, 6 ], [ 7, 8 ] ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, base ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 2, 2, 2 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function tiles an input array when all repetitions are equal to one (non-base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = array( [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 5, 6 ], [ 7, 8 ] ] ] );
+ y = tile( x, [ 1, 1, 1 ] );
+
+ expected = [
+ [ [ 1, 2 ], [ 3, 4 ] ],
+ [ [ 5, 6 ], [ 7, 8 ] ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, ndarray ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 2, 2, 2 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function tiles an input array along singleton dimensions (base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = base( 'generic', [ 1, 2 ], [ 2, 1 ], [ 1, 1 ], 0, 'row-major' );
+ y = tile( x, [ 2, 3 ] );
+
+ expected = [
+ [ 1, 1, 1 ],
+ [ 2, 2, 2 ],
+ [ 1, 1, 1 ],
+ [ 2, 2, 2 ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, base ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 4, 3 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function tiles an input array along singleton dimensions (non-base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = array( [ [ 1 ], [ 2 ] ] );
+ y = tile( x, [ 2, 3 ] );
+
+ expected = [
+ [ 1, 1, 1 ],
+ [ 2, 2, 2 ],
+ [ 1, 1, 1 ],
+ [ 2, 2, 2 ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, ndarray ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 4, 3 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function tiles a zero-dimensional input array (base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = base( 'generic', [ 5 ], [], [ 0 ], 0, 'row-major' );
+ y = tile( x, [ 2, 3, 4 ] );
+
+ expected = [
+ [ [ 5, 5, 5, 5 ], [ 5, 5, 5, 5 ], [ 5, 5, 5, 5 ] ],
+ [ [ 5, 5, 5, 5 ], [ 5, 5, 5, 5 ], [ 5, 5, 5, 5 ] ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, base ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 2, 3, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ // Empty repetitions yield a zero-dimensional output:
+ y = tile( x, [] );
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, base ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [], 'returns expected value' );
+ t.strictEqual( y.get(), 5, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function tiles a zero-dimensional input array (non-base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = ndarray( 'generic', [ 5 ], [], [ 0 ], 0, 'row-major' );
+ y = tile( x, [ 2, 3, 4 ] );
+
+ expected = [
+ [ [ 5, 5, 5, 5 ], [ 5, 5, 5, 5 ], [ 5, 5, 5, 5 ] ],
+ [ [ 5, 5, 5, 5 ], [ 5, 5, 5, 5 ], [ 5, 5, 5, 5 ] ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, ndarray ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 2, 3, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ // Empty repetitions yield a zero-dimensional output:
+ y = tile( x, [] );
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, ndarray ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [], 'returns expected value' );
+ t.strictEqual( y.get(), 5, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function tiles a one-dimensional input array (base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = base( 'generic', [ 1, 2, 3 ], [ 3 ], [ 1 ], 0, 'row-major' );
+ y = tile( x, [ 2 ] );
+
+ expected = [ 1, 2, 3, 1, 2, 3 ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, base ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 6 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function tiles a one-dimensional input array (non-base)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = array( [ 1, 2, 3 ] );
+ y = tile( x, [ 2 ] );
+
+ expected = [ 1, 2, 3, 1, 2, 3 ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, ndarray ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 6 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function infers the output layout from the input strides (non-monotonic strides)', function test( t ) {
+ var expected;
+ var x;
+ var y;
+
+ x = base( 'generic', [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ], [ 2, 3, 2 ], [ 2, 4, 1 ], 0, 'row-major' );
+ y = tile( x, [ 1, 1, 2 ] );
+
+ expected = [
+ [
+ [ 1, 2, 1, 2 ],
+ [ 5, 6, 5, 6 ],
+ [ 9, 10, 9, 10 ]
+ ],
+ [
+ [ 3, 4, 3, 4 ],
+ [ 7, 8, 7, 8 ],
+ [ 11, 12, 11, 12 ]
+ ]
+ ];
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, base ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 2, 3, 4 ], 'returns expected value' );
+ t.deepEqual( ndarray2array( y ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns an empty ndarray when a repetition is zero (base)', function test( t ) {
+ var x;
+ var y;
+
+ x = base( 'generic', [ 1, 2, 3, 4 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
+ y = tile( x, [ 0, 2 ] );
+
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, base ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 0, 4 ], 'returns expected value' );
+ t.strictEqual( numel( getShape( y ) ), 0, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns an empty ndarray when a repetition is zero (non-base)', function test( t ) {
+ var x;
+ var y;
+
+ x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+ y = tile( x, [ 0, 2 ] );
+
+ t.notEqual( y, x, 'returns expected value' );
+ t.notEqual( getData( y ), getData( x ), 'returns expected value' );
+ t.strictEqual( instanceOf( y, ndarray ), true, 'returns expected value' );
+ t.deepEqual( getShape( y ), [ 0, 4 ], 'returns expected value' );
+ t.strictEqual( numel( getShape( y ) ), 0, 'returns expected value' );
+
+ t.end();
+});