diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/README.md b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/README.md
new file mode 100644
index 000000000000..9c52e3f9be49
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/README.md
@@ -0,0 +1,170 @@
+
+
+# ghadamard
+
+> Generate a Hadamard matrix.
+
+
+
+
+
+
+
+## Usage
+
+```javascript
+var ghadamard = require( '@stdlib/blas/ext/base/ghadamard' );
+```
+
+#### ghadamard( order, N, out, ldo )
+
+Generates a Hadamard matrix.
+
+```javascript
+var out = [ 0.0, 0.0, 0.0, 0.0 ];
+
+ghadamard( 'row-major', 2, out, 2 );
+// out => [ 1.0, 1.0, 1.0, -1.0 ]
+```
+
+The function has the following parameters:
+
+- **order**: row-major (C-style) or column-major (Fortran-style) order.
+- **N**: number of rows and columns of the output matrix. Must be a power of `2`.
+- **out**: output matrix.
+- **ldo**: stride between successive contiguous vectors of the matrix `out` (a.k.a., leading dimension of the matrix `out`). Must be greater than or equal to `max(1,N)`.
+
+Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
+
+
+
+```javascript
+var Float64Array = require( '@stdlib/array/float64' );
+
+// Initial array:
+var out0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+
+// Create an offset view:
+var out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*1 );
+
+ghadamard( 'row-major', 2, out1, 2 );
+// out0 => [ 0.0, 1.0, 1.0, 1.0, -1.0 ]
+```
+
+#### ghadamard.ndarray( N, out, strideOut1, strideOut2, offsetOut )
+
+Generates a Hadamard matrix using alternative indexing semantics.
+
+```javascript
+var out = [ 0.0, 0.0, 0.0, 0.0 ];
+
+ghadamard.ndarray( 2, out, 2, 1, 0 );
+// out => [ 1.0, 1.0, 1.0, -1.0 ]
+```
+
+The function has the following additional parameters:
+
+- **strideOut1**: stride length for the first dimension of `out`.
+- **strideOut2**: stride length for the second dimension of `out`.
+- **offsetOut**: starting index for `out`.
+
+While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to start writing matrix elements from the second element of the output array:
+
+```javascript
+var out = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
+
+ghadamard.ndarray( 2, out, 2, 1, 1 );
+// out => [ 0.0, 1.0, 1.0, 1.0, -1.0 ]
+```
+
+
+
+
+
+
+
+## Notes
+
+- If `N <= 0`, both functions return `out` unchanged.
+- Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/base/accessor`][@stdlib/array/base/accessor]).
+
+
+
+
+
+
+
+## Examples
+
+
+
+```javascript
+var ndarray2array = require( '@stdlib/ndarray/base/to-array' );
+var shape2strides = require( '@stdlib/ndarray/base/shape2strides' );
+var zeros = require( '@stdlib/array/zeros' );
+var ghadamard = require( '@stdlib/blas/ext/base/ghadamard' );
+
+var N = 4;
+var order = 'row-major';
+var shape = [ N, N ];
+var strides = shape2strides( shape, order );
+
+var out = zeros( N*N, 'generic' );
+
+ghadamard( order, N, out, N );
+console.log( ndarray2array( out, shape, strides, 0, order ) );
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
+
+[@stdlib/array/base/accessor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/accessor
+
+
+
+
+
+
+
+
diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/benchmark/benchmark.js
new file mode 100644
index 000000000000..9e29961d00e0
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/benchmark/benchmark.js
@@ -0,0 +1,103 @@
+/**
+* @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 isnan = require( '@stdlib/math/base/assert/is-nan' );
+var pow = require( '@stdlib/math/base/special/pow' );
+var zeros = require( '@stdlib/array/zeros' );
+var format = require( '@stdlib/string/format' );
+var pkg = require( './../package.json' ).name;
+var ghadamard = require( './../lib/main.js' );
+
+
+// VARIABLES //
+
+var options = {
+ 'dtype': 'generic'
+};
+
+
+// FUNCTIONS //
+
+/**
+* Creates a benchmark function.
+*
+* @private
+* @param {PositiveInteger} len - array length
+* @returns {Function} benchmark function
+*/
+function createBenchmark( len ) {
+ var out = zeros( len * len, options.dtype );
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var v;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = ghadamard( 'row-major', len, out, len );
+ if ( isnan( v[ i%v.length ] ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ }
+ b.toc();
+ if ( isnan( v[ i%v.length ] ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+ }
+}
+
+
+// MAIN //
+
+/**
+* Main execution sequence.
+*
+* @private
+*/
+function main() {
+ var len;
+ var min;
+ var max;
+ var f;
+ var i;
+
+ min = 2; // 2^min
+ max = 10; // 2^max
+
+ for ( i = min; i <= max; i += 2 ) {
+ len = pow( 2, i );
+ f = createBenchmark( len );
+ bench( format( '%s:len=%d', pkg, len ), f );
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/benchmark/benchmark.ndarray.js
new file mode 100644
index 000000000000..dcb9db6e9919
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/benchmark/benchmark.ndarray.js
@@ -0,0 +1,103 @@
+/**
+* @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 isnan = require( '@stdlib/math/base/assert/is-nan' );
+var pow = require( '@stdlib/math/base/special/pow' );
+var zeros = require( '@stdlib/array/zeros' );
+var format = require( '@stdlib/string/format' );
+var pkg = require( './../package.json' ).name;
+var ghadamard = require( './../lib/ndarray.js' );
+
+
+// VARIABLES //
+
+var options = {
+ 'dtype': 'generic'
+};
+
+
+// FUNCTIONS //
+
+/**
+* Creates a benchmark function.
+*
+* @private
+* @param {PositiveInteger} len - array length
+* @returns {Function} benchmark function
+*/
+function createBenchmark( len ) {
+ var out = zeros( len * len, options.dtype );
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var v;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = ghadamard( len, out, len, 1, 0 );
+ if ( isnan( v[ i%v.length ] ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ }
+ b.toc();
+ if ( isnan( v[ i%v.length ] ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+ }
+}
+
+
+// MAIN //
+
+/**
+* Main execution sequence.
+*
+* @private
+*/
+function main() {
+ var len;
+ var min;
+ var max;
+ var f;
+ var i;
+
+ min = 2; // 2^min
+ max = 10; // 2^max
+
+ for ( i = min; i <= max; i += 2 ) {
+ len = pow( 2, i );
+ f = createBenchmark( len );
+ bench( format( '%s:ndarray:len=%d', pkg, len ), f );
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/docs/repl.txt
new file mode 100644
index 000000000000..409842417fbb
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/docs/repl.txt
@@ -0,0 +1,83 @@
+
+{{alias}}( order, N, out, ldo )
+ Generates a Hadamard matrix.
+
+ If `N` is less than or equal to `0`, the function returns `out` unchanged.
+
+ Parameters
+ ----------
+ order: string
+ Storage layout.
+
+ N: integer
+ Number of rows and columns of the output matrix. Must be a power of `2`.
+
+ out: ArrayLikeObject
+ Output array.
+
+ ldo: integer
+ Stride length between successive contiguous vectors of the matrix
+ `out` (a.k.a., leading dimension of `out`). Must be greater than or
+ equal to `max(1,N)`.
+
+ Returns
+ -------
+ out: ArrayLikeObject
+ Output array.
+
+ Examples
+ --------
+ // Standard Usage:
+ > var out = [ 0.0, 0.0, 0.0, 0.0 ];
+ > {{alias}}( 'row-major', 2, out, 2 )
+ [ 1.0, 1.0, 1.0, -1.0 ]
+
+ // Using a leading dimension greater than `N`:
+ > out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
+ > {{alias}}( 'row-major', 2, out, 3 )
+ [ 1.0, 1.0, 0.0, 1.0, -1.0, 0.0 ]
+
+
+{{alias}}.ndarray( N, out, so1, so2, oo )
+ Generates a Hadamard matrix using alternative indexing semantics.
+
+ While typed array views mandate a view offset based on the underlying
+ buffer, the offset parameter supports indexing semantics based on a starting
+ index.
+
+ Parameters
+ ----------
+ N: integer
+ Number of rows and columns of the output matrix. Must be a power of `2`.
+
+ out: ArrayLikeObject
+ Output array.
+
+ so1: integer
+ Stride length for the first dimension of `out`.
+
+ so2: integer
+ Stride length for the second dimension of `out`.
+
+ oo: integer
+ Starting index for `out`.
+
+ Returns
+ -------
+ out: ArrayLikeObject
+ Output array.
+
+ Examples
+ --------
+ // Standard Usage:
+ > var out = [ 0.0, 0.0, 0.0, 0.0 ];
+ > {{alias}}.ndarray( 2, out, 2, 1, 0 )
+ [ 1.0, 1.0, 1.0, -1.0 ]
+
+ // Using an index offset:
+ > out = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
+ > {{alias}}.ndarray( 2, out, 2, 1, 1 )
+ [ 0.0, 1.0, 1.0, 1.0, -1.0 ]
+
+ See Also
+ --------
diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/docs/types/index.d.ts
new file mode 100644
index 000000000000..141a420a541f
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/docs/types/index.d.ts
@@ -0,0 +1,97 @@
+/*
+* @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 { Collection, AccessorArrayLike } from '@stdlib/types/array';
+import { Layout } from '@stdlib/types/blas';
+
+/**
+* Output array.
+*/
+type OutputArray = Collection | AccessorArrayLike;
+
+/**
+* Interface describing `ghadamard`.
+*/
+interface Routine {
+ /**
+ * Generates a Hadamard matrix.
+ *
+ * @param order - storage layout
+ * @param N - number of rows and columns of the output matrix
+ * @param out - output array
+ * @param ldo - stride length between successive contiguous vectors of the matrix `out` (a.k.a., leading dimension of `out`)
+ * @returns output array
+ *
+ * @example
+ * var out = [ 0.0, 0.0, 0.0, 0.0 ];
+ *
+ * ghadamard( 'row-major', 2, out, 2 );
+ * // out => [ 1.0, 1.0, 1.0, -1.0 ]
+ */
+ = OutputArray>( order: Layout, N: number, out: V, ldo: number ): V;
+
+ /**
+ * Generates a Hadamard matrix using alternative indexing semantics.
+ *
+ * @param N - number of rows and columns of the output matrix
+ * @param out - output array
+ * @param strideOut1 - stride length for the first dimension of `out`
+ * @param strideOut2 - stride length for the second dimension of `out`
+ * @param offsetOut - starting index for `out`
+ * @returns output array
+ *
+ * @example
+ * var out = [ 0.0, 0.0, 0.0, 0.0 ];
+ *
+ * ghadamard.ndarray( 2, out, 2, 1, 0 );
+ * // out => [ 1.0, 1.0, 1.0, -1.0 ]
+ */
+ ndarray = OutputArray>( N: number, out: V, strideOut1: number, strideOut2: number, offsetOut: number ): V;
+}
+
+/**
+* Generates a Hadamard matrix.
+*
+* @param order - storage layout
+* @param N - number of rows and columns of the output matrix
+* @param out - output array
+* @param ldo - stride length between successive contiguous vectors of the matrix `out` (a.k.a., leading dimension of `out`)
+* @returns output array
+*
+* @example
+* var out = [ 0.0, 0.0, 0.0, 0.0 ];
+*
+* ghadamard( 'row-major', 2, out, 2 );
+* // out => [ 1.0, 1.0, 1.0, -1.0 ]
+*
+* @example
+* var out = [ 0.0, 0.0, 0.0, 0.0 ];
+*
+* ghadamard.ndarray( 2, out, 2, 1, 0 );
+* // out => [ 1.0, 1.0, 1.0, -1.0 ]
+*/
+declare var ghadamard: Routine;
+
+
+// EXPORTS //
+
+export = ghadamard;
diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/docs/types/test.ts
new file mode 100644
index 000000000000..ba0e7beae962
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/docs/types/test.ts
@@ -0,0 +1,184 @@
+/*
+* @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 AccessorArray = require( '@stdlib/array/base/accessor' );
+import ghadamard = require( './index' );
+
+
+// TESTS //
+
+// The function returns a collection...
+{
+ const out = new Float64Array( 16 );
+
+ ghadamard( 'row-major', 4, out, 4 ); // $ExpectType Float64Array
+ ghadamard( 'row-major', 4, new AccessorArray( out ), 4 ); // $ExpectType AccessorArray
+}
+
+// The compiler throws an error if the function is provided a first argument which is not a valid order...
+{
+ const out = new Float64Array( 16 );
+
+ ghadamard( 10, 4, out, 4 ); // $ExpectError
+ ghadamard( true, 4, out, 4 ); // $ExpectError
+ ghadamard( false, 4, out, 4 ); // $ExpectError
+ ghadamard( null, 4, out, 4 ); // $ExpectError
+ ghadamard( undefined, 4, out, 4 ); // $ExpectError
+ ghadamard( [], 4, out, 4 ); // $ExpectError
+ ghadamard( {}, 4, out, 4 ); // $ExpectError
+ ghadamard( ( x: number ): number => x, 4, out, 4 ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a second argument which is not a number...
+{
+ const out = new Float64Array( 16 );
+
+ ghadamard( 'row-major', '10', out, 4 ); // $ExpectError
+ ghadamard( 'row-major', true, out, 4 ); // $ExpectError
+ ghadamard( 'row-major', false, out, 4 ); // $ExpectError
+ ghadamard( 'row-major', null, out, 4 ); // $ExpectError
+ ghadamard( 'row-major', undefined, out, 4 ); // $ExpectError
+ ghadamard( 'row-major', [], out, 4 ); // $ExpectError
+ ghadamard( 'row-major', {}, out, 4 ); // $ExpectError
+ ghadamard( 'row-major', ( x: number ): number => x, out, 4 ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a third argument which is not a collection...
+{
+ ghadamard( 'row-major', 4, 10, 4 ); // $ExpectError
+ ghadamard( 'row-major', 4, true, 4 ); // $ExpectError
+ ghadamard( 'row-major', 4, false, 4 ); // $ExpectError
+ ghadamard( 'row-major', 4, null, 4 ); // $ExpectError
+ ghadamard( 'row-major', 4, undefined, 4 ); // $ExpectError
+ ghadamard( 'row-major', 4, {}, 4 ); // $ExpectError
+ ghadamard( 'row-major', 4, ( x: number ): number => x, 4 ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a fourth argument which is not a number...
+{
+ const out = new Float64Array( 16 );
+
+ ghadamard( 'row-major', 4, out, '10' ); // $ExpectError
+ ghadamard( 'row-major', 4, out, true ); // $ExpectError
+ ghadamard( 'row-major', 4, out, false ); // $ExpectError
+ ghadamard( 'row-major', 4, out, null ); // $ExpectError
+ ghadamard( 'row-major', 4, out, undefined ); // $ExpectError
+ ghadamard( 'row-major', 4, out, [] ); // $ExpectError
+ ghadamard( 'row-major', 4, out, {} ); // $ExpectError
+ ghadamard( 'row-major', 4, out, ( x: number ): number => x ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ const out = new Float64Array( 16 );
+
+ ghadamard(); // $ExpectError
+ ghadamard( 'row-major' ); // $ExpectError
+ ghadamard( 'row-major', 4 ); // $ExpectError
+ ghadamard( 'row-major', 4, out ); // $ExpectError
+ ghadamard( 'row-major', 4, out, 4, 10 ); // $ExpectError
+}
+
+// Attached to the main export is an `ndarray` method which returns a collection...
+{
+ const out = new Float64Array( 16 );
+
+ ghadamard.ndarray( 4, out, 4, 1, 0 ); // $ExpectType Float64Array
+ ghadamard.ndarray( 4, new AccessorArray( out ), 4, 1, 0 ); // $ExpectType AccessorArray
+}
+
+// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
+{
+ const out = new Float64Array( 16 );
+
+ ghadamard.ndarray( '10', out, 4, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( true, out, 4, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( false, out, 4, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( null, out, 4, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( undefined, out, 4, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( [], out, 4, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( {}, out, 4, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( ( x: number ): number => x, out, 4, 1, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided a second argument which is not a collection...
+{
+ ghadamard.ndarray( 4, 10, 4, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, true, 4, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, false, 4, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, null, 4, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, undefined, 4, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, {}, 4, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, ( x: number ): number => x, 4, 1, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided a third argument which is not a number...
+{
+ const out = new Float64Array( 16 );
+
+ ghadamard.ndarray( 4, out, '10', 1, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, out, true, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, out, false, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, out, null, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, out, undefined, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, out, [], 1, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, out, {}, 1, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, out, ( x: number ): number => x, 1, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number...
+{
+ const out = new Float64Array( 16 );
+
+ ghadamard.ndarray( 4, out, 4, '10', 0 ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, true, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, false, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, null, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, undefined, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, [], 0 ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, {}, 0 ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, ( x: number ): number => x, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a number...
+{
+ const out = new Float64Array( 16 );
+
+ ghadamard.ndarray( 4, out, 4, 1, '10' ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, 1, true ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, 1, false ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, 1, null ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, 1, undefined ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, 1, [] ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, 1, {} ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, 1, ( x: number ): number => x ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments...
+{
+ const out = new Float64Array( 16 );
+
+ ghadamard.ndarray(); // $ExpectError
+ ghadamard.ndarray( 4 ); // $ExpectError
+ ghadamard.ndarray( 4, out ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4 ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, 1 ); // $ExpectError
+ ghadamard.ndarray( 4, out, 4, 1, 0, 10 ); // $ExpectError
+}
diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/examples/index.js
new file mode 100644
index 000000000000..9c594a6e5a7d
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/examples/index.js
@@ -0,0 +1,34 @@
+/**
+* @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 ndarray2array = require( '@stdlib/ndarray/base/to-array' );
+var shape2strides = require( '@stdlib/ndarray/base/shape2strides' );
+var zeros = require( '@stdlib/array/zeros' );
+var ghadamard = require( './../lib' );
+
+var N = 4;
+var order = 'row-major';
+var shape = [ N, N ];
+var strides = shape2strides( shape, order );
+
+var out = zeros( N*N, 'generic' );
+
+ghadamard( order, N, out, N );
+console.log( ndarray2array( out, shape, strides, 0, order ) );
diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/lib/accessors.js b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/lib/accessors.js
new file mode 100644
index 000000000000..6d4f17dbaedc
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/lib/accessors.js
@@ -0,0 +1,86 @@
+/**
+* @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';
+
+// MAIN //
+
+/**
+* Generates a Hadamard matrix using accessor arrays.
+*
+* @private
+* @param {NonNegativeInteger} N - number of rows and columns of the output matrix
+* @param {Object} out - output array object
+* @param {integer} strideOut1 - stride length for the first dimension of `out`
+* @param {integer} strideOut2 - stride length for the second dimension of `out`
+* @param {NonNegativeInteger} offsetOut - starting index for `out`
+* @returns {Object} output array object
+*
+* @example
+* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
+* var arraylike2object = require( '@stdlib/array/base/arraylike2object' );
+*
+* var out = [ 0.0, 0.0, 0.0, 0.0 ];
+*
+* ghadamard( 2, arraylike2object( toAccessorArray( out ) ), 2, 1, 0 );
+* // out => [ 1.0, 1.0, 1.0, -1.0 ]
+*/
+function ghadamard( N, out, strideOut1, strideOut2, offsetOut ) {
+ var obuf;
+ var oget;
+ var oset;
+ var io;
+ var ij;
+ var d1;
+ var d2;
+ var v;
+ var n;
+ var i;
+ var j;
+
+ obuf = out.data;
+ oget = out.accessors[ 0 ];
+ oset = out.accessors[ 1 ];
+
+ // Seed the top-left quadrant with the 1x1 Hadamard matrix:
+ oset( obuf, offsetOut, 1.0 );
+
+ // Perform iterative doubling, copying the current n-by-n leading submatrix to the three remaining quadrants of the 2n-by-2n leading submatrix, with the bottom-right quadrant having flipped signs...
+ for ( n = 1; n < N; n *= 2 ) {
+ d1 = n * strideOut1;
+ d2 = n * strideOut2;
+ io = offsetOut;
+ for ( i = 0; i < n; i++ ) {
+ ij = io;
+ for ( j = 0; j < n; j++ ) {
+ v = oget( obuf, ij );
+ oset( obuf, ij+d2, v );
+ oset( obuf, ij+d1, v );
+ oset( obuf, ij+d1+d2, -v );
+ ij += strideOut2;
+ }
+ io += strideOut1;
+ }
+ }
+ return out;
+}
+
+
+// EXPORTS //
+
+module.exports = ghadamard;
diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/lib/index.js
new file mode 100644
index 000000000000..465aa38e5f07
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/lib/index.js
@@ -0,0 +1,57 @@
+/**
+* @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';
+
+/**
+* Generate a Hadamard matrix.
+*
+* @module @stdlib/blas/ext/base/ghadamard
+*
+* @example
+* var ghadamard = require( '@stdlib/blas/ext/base/ghadamard' );
+*
+* var out = [ 0.0, 0.0, 0.0, 0.0 ];
+*
+* ghadamard( 'row-major', 2, out, 2 );
+* // out => [ 1.0, 1.0, 1.0, -1.0 ]
+*
+* @example
+* var ghadamard = require( '@stdlib/blas/ext/base/ghadamard' );
+*
+* var out = [ 0.0, 0.0, 0.0, 0.0 ];
+*
+* ghadamard.ndarray( 2, out, 2, 1, 0 );
+* // out => [ 1.0, 1.0, 1.0, -1.0 ]
+*/
+
+// MODULES //
+
+var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
+var main = require( './main.js' );
+var ndarray = require( './ndarray.js' );
+
+
+// MAIN //
+
+setReadOnly( main, 'ndarray', ndarray );
+
+
+// EXPORTS //
+
+module.exports = main;
diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/lib/main.js
new file mode 100644
index 000000000000..d7c79699591d
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/lib/main.js
@@ -0,0 +1,84 @@
+/**
+* @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 isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' );
+var resolveLayout = require( '@stdlib/blas/base/layout-resolve-str' );
+var isPow2 = require( '@stdlib/math/base/assert/uint32-is-pow2' );
+var max = require( '@stdlib/math/base/special/fast/max' );
+var format = require( '@stdlib/string/format' );
+var ndarray = require( './ndarray.js' );
+
+
+// MAIN //
+
+/**
+* Generates a Hadamard matrix.
+*
+* @param {(integer|string)} order - storage layout
+* @param {NonNegativeInteger} N - number of rows and columns of the output matrix
+* @param {Collection} out - output array
+* @param {PositiveInteger} ldo - stride between successive contiguous vectors of the matrix `out` (a.k.a., leading dimension of the matrix `out`)
+* @throws {TypeError} first argument must be a valid order
+* @throws {RangeError} second argument must be a power of two
+* @throws {RangeError} fourth argument must be a valid stride
+* @returns {Collection} output matrix
+*
+* @example
+* var out = [ 0.0, 0.0, 0.0, 0.0 ];
+*
+* ghadamard( 'row-major', 2, out, 2 );
+* // out => [ 1.0, 1.0, 1.0, -1.0 ]
+*/
+function ghadamard( order, N, out, ldo ) {
+ var iscm;
+ var sa1;
+ var sa2;
+ var l;
+
+ l = resolveLayout( order );
+ if ( l === null ) {
+ throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) );
+ }
+ if ( ldo < max( 1, N ) ) {
+ throw new RangeError( format( 'invalid argument. Fourth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, ldo ) );
+ }
+ if ( N <= 0 ) {
+ return out;
+ }
+ if ( !isPow2( N ) ) {
+ throw new RangeError( format( 'invalid argument. Second argument must be a power of two. Value: `%d`.', N ) );
+ }
+ iscm = isColumnMajor( l );
+ if ( iscm ) {
+ sa1 = 1;
+ sa2 = ldo;
+ } else { // order === 'row-major'
+ sa1 = ldo;
+ sa2 = 1;
+ }
+ return ndarray( N, out, sa1, sa2, 0 );
+}
+
+
+// EXPORTS //
+
+module.exports = ghadamard;
diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/lib/ndarray.js
new file mode 100644
index 000000000000..326da1708e6c
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/lib/ndarray.js
@@ -0,0 +1,96 @@
+/**
+* @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 arraylike2object = require( '@stdlib/array/base/arraylike2object' );
+var isPow2 = require( '@stdlib/math/base/assert/uint32-is-pow2' );
+var format = require( '@stdlib/string/format' );
+var accessors = require( './accessors.js' );
+
+
+// MAIN //
+
+/**
+* Generates a Hadamard matrix using alternative indexing semantics.
+*
+* @param {NonNegativeInteger} N - number of rows and columns of the output matrix
+* @param {Collection} out - output array
+* @param {integer} strideOut1 - stride length for the first dimension of `out`
+* @param {integer} strideOut2 - stride length for the second dimension of `out`
+* @param {NonNegativeInteger} offsetOut - starting index for `out`
+* @throws {RangeError} first argument must be a power of two
+* @returns {Collection} output matrix
+*
+* @example
+* var out = [ 0.0, 0.0, 0.0, 0.0 ];
+*
+* ghadamard( 2, out, 2, 1, 0 );
+* // out => [ 1.0, 1.0, 1.0, -1.0 ]
+*/
+function ghadamard( N, out, strideOut1, strideOut2, offsetOut ) {
+ var oo;
+ var io;
+ var ij;
+ var d1;
+ var d2;
+ var v;
+ var n;
+ var i;
+ var j;
+
+ if ( N <= 0 ) {
+ return out;
+ }
+ if ( !isPow2( N ) ) {
+ throw new RangeError( format( 'invalid argument. First argument must be a power of two. Value: `%d`.', N ) );
+ }
+ oo = arraylike2object( out );
+ if ( oo.accessorProtocol ) {
+ accessors( N, oo, strideOut1, strideOut2, offsetOut );
+ return out;
+ }
+ // Seed the top-left quadrant with the 1x1 Hadamard matrix:
+ out[ offsetOut ] = 1.0;
+
+ // Perform iterative doubling, copying the current n-by-n leading submatrix to the three remaining quadrants of the 2n-by-2n leading submatrix, with the bottom-right quadrant having flipped signs...
+ for ( n = 1; n < N; n *= 2 ) {
+ d1 = n * strideOut1;
+ d2 = n * strideOut2;
+ io = offsetOut;
+ for ( i = 0; i < n; i++ ) {
+ ij = io;
+ for ( j = 0; j < n; j++ ) {
+ v = out[ ij ];
+ out[ ij+d2 ] = v;
+ out[ ij+d1 ] = v;
+ out[ ij+d1+d2 ] = -v;
+ ij += strideOut2;
+ }
+ io += strideOut1;
+ }
+ }
+ return out;
+}
+
+
+// EXPORTS //
+
+module.exports = ghadamard;
diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/package.json b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/package.json
new file mode 100644
index 000000000000..504b450abdb3
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/package.json
@@ -0,0 +1,69 @@
+{
+ "name": "@stdlib/blas/ext/base/ghadamard",
+ "version": "0.0.0",
+ "description": "Generate a Hadamard matrix.",
+ "license": "Apache-2.0",
+ "author": {
+ "name": "The Stdlib Authors",
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
+ },
+ "contributors": [
+ {
+ "name": "The Stdlib Authors",
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
+ }
+ ],
+ "main": "./lib",
+ "directories": {
+ "benchmark": "./benchmark",
+ "doc": "./docs",
+ "example": "./examples",
+ "lib": "./lib",
+ "test": "./test"
+ },
+ "types": "./docs/types",
+ "scripts": {},
+ "homepage": "https://github.com/stdlib-js/stdlib",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/stdlib-js/stdlib.git"
+ },
+ "bugs": {
+ "url": "https://github.com/stdlib-js/stdlib/issues"
+ },
+ "dependencies": {},
+ "devDependencies": {},
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "keywords": [
+ "stdlib",
+ "stdmath",
+ "mathematics",
+ "math",
+ "blas",
+ "extended",
+ "hadamard",
+ "matrix",
+ "strided",
+ "strided array",
+ "typed",
+ "array",
+ "ndarray",
+ "vector",
+ "ghadamard"
+ ],
+ "__stdlib__": {}
+}
diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/test/test.js
new file mode 100644
index 000000000000..618ca7ff6c31
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/test/test.js
@@ -0,0 +1,38 @@
+/**
+* @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 ghadamard = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof ghadamard, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) {
+ t.strictEqual( typeof ghadamard.ndarray, 'function', 'method is a function' );
+ t.end();
+});
diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/test/test.main.js b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/test/test.main.js
new file mode 100644
index 000000000000..e6993a3a784f
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/test/test.main.js
@@ -0,0 +1,685 @@
+/**
+* @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 toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
+var Float64Array = require( '@stdlib/array/float64' );
+var ghadamard = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof ghadamard, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function has an arity of 4', function test( t ) {
+ t.strictEqual( ghadamard.length, 4, 'has expected arity' );
+ t.end();
+});
+
+tape( 'the function throws an error if provided an invalid first argument', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ 'foo',
+ 'bar',
+ 'beep',
+ 'boop'
+ ];
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ ghadamard( value, 2, [ 0.0, 0.0, 0.0, 0.0 ], 2 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided an invalid first argument (accessors)', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ 'foo',
+ 'bar',
+ 'beep',
+ 'boop'
+ ];
+
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
+ }
+ t.end();
+
+ function badValue( value ) {
+ return function badValue() {
+ ghadamard( value, 2, toAccessorArray( [ 0.0, 0.0, 0.0, 0.0 ] ), 2 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided an invalid second argument', function test( t ) {
+ var values;
+ var out;
+ var i;
+
+ values = [
+ 3,
+ 5,
+ 6,
+ 7
+ ];
+
+ out = new Float64Array( 64 );
+
+ 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() {
+ ghadamard( 'row-major', value, out, 8 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided an invalid second argument (accessors)', function test( t ) {
+ var values;
+ var out;
+ var i;
+
+ values = [
+ 3,
+ 5,
+ 6,
+ 7
+ ];
+
+ out = toAccessorArray( new Float64Array( 64 ) );
+
+ 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() {
+ ghadamard( 'row-major', value, out, 8 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided an invalid fourth argument', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ -2,
+ -1,
+ 0,
+ 1
+ ];
+
+ 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() {
+ ghadamard( 'row-major', 2, [ 0.0, 0.0, 0.0, 0.0 ], value );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided an invalid fourth argument (accessors)', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ -2,
+ -1,
+ 0,
+ 1
+ ];
+
+ 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() {
+ ghadamard( 'row-major', 2, toAccessorArray( [ 0.0, 0.0, 0.0, 0.0 ] ), value );
+ };
+ }
+});
+
+tape( 'if provided an `N` less than or equal to `0`, the function returns the output array unchanged', function test( t ) {
+ var expected;
+ var out;
+
+ out = [ 0.0, 0.0, 0.0, 0.0 ];
+
+ ghadamard( 'row-major', 0, out, 1 );
+
+ expected = [ 0.0, 0.0, 0.0, 0.0 ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'if provided an `N` less than or equal to `0`, the function returns the output array unchanged (accessors)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [ 0.0, 0.0, 0.0, 0.0 ];
+
+ ghadamard( 'row-major', 0, toAccessorArray( out ), 1 );
+
+ expected = [ 0.0, 0.0, 0.0, 0.0 ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function returns the output matrix', function test( t ) {
+ var out;
+ var v;
+
+ out = [ 0.0, 0.0, 0.0, 0.0 ];
+
+ v = ghadamard( 'row-major', 2, out, 2 );
+
+ t.strictEqual( v, out, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function returns the output matrix (accessors)', function test( t ) {
+ var out;
+ var v;
+
+ out = toAccessorArray( [ 0.0, 0.0, 0.0, 0.0 ] );
+
+ v = ghadamard( 'row-major', 2, out, 2 );
+
+ t.strictEqual( v, out, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function generates a Hadamard matrix (row-major)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 'row-major', 4, out, 4 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function generates a Hadamard matrix (row-major, accessors)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 'row-major', 4, toAccessorArray( out ), 4 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function generates a Hadamard matrix (column-major)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 'column-major', 4, out, 4 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function generates a Hadamard matrix (column-major, accessors)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 'column-major', 4, toAccessorArray( out ), 4 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports a leading dimension for the output matrix (row-major)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 'row-major', 4, out, 5 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ 0.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports a leading dimension for the output matrix (row-major, accessors)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 'row-major', 4, toAccessorArray( out ), 5 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ 0.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports a leading dimension for the output matrix (column-major)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 'column-major', 4, out, 5 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ 0.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports a leading dimension for the output matrix (column-major, accessors)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 'column-major', 4, toAccessorArray( out ), 5 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ 0.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports view offsets', function test( t ) {
+ var expected;
+ var out0;
+ var out1;
+
+ out0 = new Float64Array( 17 );
+ out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*1 );
+
+ ghadamard( 'row-major', 4, out1, 4 );
+
+ expected = new Float64Array([
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0
+ ]);
+
+ t.deepEqual( out1, expected, 'returns expected value' );
+ t.end();
+});
diff --git a/lib/node_modules/@stdlib/blas/ext/base/ghadamard/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/test/test.ndarray.js
new file mode 100644
index 000000000000..97997004100e
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/ghadamard/test/test.ndarray.js
@@ -0,0 +1,868 @@
+/**
+* @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 toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
+var Float64Array = require( '@stdlib/array/float64' );
+var ghadamard = require( './../lib/ndarray.js' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof ghadamard, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function has an arity of 5', function test( t ) {
+ t.strictEqual( ghadamard.length, 5, 'has expected arity' );
+ t.end();
+});
+
+tape( 'the function throws an error if provided an invalid first argument', function test( t ) {
+ var values;
+ var out;
+ var i;
+
+ values = [
+ 3,
+ 5,
+ 6,
+ 7
+ ];
+
+ out = new Float64Array( 64 );
+
+ 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() {
+ ghadamard( value, out, 8, 1, 0 );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided an invalid first argument (accessors)', function test( t ) {
+ var values;
+ var out;
+ var i;
+
+ values = [
+ 3,
+ 5,
+ 6,
+ 7
+ ];
+
+ out = toAccessorArray( new Float64Array( 64 ) );
+
+ 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() {
+ ghadamard( value, out, 8, 1, 0 );
+ };
+ }
+});
+
+tape( 'the function generates a Hadamard matrix (row-major)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 4, out, 4, 1, 0 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function generates a Hadamard matrix (row-major, accessors)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 4, toAccessorArray( out ), 4, 1, 0 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function generates a Hadamard matrix (column-major)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 4, out, 1, 4, 0 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function generates a Hadamard matrix (column-major, accessors)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 4, toAccessorArray( out ), 1, 4, 0 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'if provided an `N` less than or equal to `0`, the function returns the output array unchanged', function test( t ) {
+ var expected;
+ var out;
+
+ out = [ 0.0, 0.0, 0.0, 0.0 ];
+
+ ghadamard( 0, out, 0, 1, 0 );
+
+ expected = [ 0.0, 0.0, 0.0, 0.0 ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'if provided an `N` less than or equal to `0`, the function returns the output array unchanged (accessors)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [ 0.0, 0.0, 0.0, 0.0 ];
+
+ ghadamard( 0, toAccessorArray( out ), 0, 1, 0 );
+
+ expected = [ 0.0, 0.0, 0.0, 0.0 ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function returns the output matrix', function test( t ) {
+ var out;
+ var v;
+
+ out = [ 0.0, 0.0, 0.0, 0.0 ];
+
+ v = ghadamard( 2, out, 2, 1, 0 );
+
+ t.strictEqual( v, out, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function returns the output matrix (accessors)', function test( t ) {
+ var out;
+ var v;
+
+ out = toAccessorArray( [ 0.0, 0.0, 0.0, 0.0 ] );
+
+ v = ghadamard( 2, out, 2, 1, 0 );
+
+ t.strictEqual( v, out, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports specifying output strides (row-major)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 4, out, 5, 1, 0 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ 0.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports specifying output strides (row-major, accessors)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 4, toAccessorArray( out ), 5, 1, 0 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ 0.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports specifying output strides (column-major)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 4, out, 1, 5, 0 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ 0.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports specifying output strides (column-major, accessors)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 4, toAccessorArray( out ), 1, 5, 0 );
+
+ expected = [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ 0.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports specifying negative output strides (row-major)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 4, out, -4, -1, 15 );
+
+ expected = [
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports specifying negative output strides (row-major, accessors)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 4, toAccessorArray( out ), -4, -1, 15 );
+
+ expected = [
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports specifying an offset for `out`', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 4, out, 4, 1, 1 );
+
+ expected = [
+ 0.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports specifying an offset for `out` (accessors)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 4, toAccessorArray( out ), 4, 1, 1 );
+
+ expected = [
+ 0.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports complex access patterns', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 4, out, 5, 1, 1 );
+
+ expected = [
+ 0.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports complex access patterns (accessors)', function test( t ) {
+ var expected;
+ var out;
+
+ out = [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ];
+
+ ghadamard( 4, toAccessorArray( out ), 5, 1, 1 );
+
+ expected = [
+ 0.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ 1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 0.0,
+ 1.0,
+ -1.0,
+ -1.0,
+ 1.0
+ ];
+
+ t.deepEqual( out, expected, 'returns expected value' );
+ t.end();
+});