diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/README.md b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/README.md
new file mode 100644
index 000000000000..25f71dee3545
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/README.md
@@ -0,0 +1,374 @@
+
+
+# cwxsa
+
+> Subtract a scalar constant from each element in a single-precision complex floating-point strided array `x` and assign the results to elements in a single-precision complex floating-point strided array `w`.
+
+
+
+This BLAS extension implements the operation
+
+
+
+```math
+\mathbf{w} = \mathbf{x} - \alpha
+```
+
+
+
+This API is complementary to the package [`@stdlib/blas/ext/base/cxsa`][@stdlib/blas/ext/base/cxsa], which performs an in-place update.
+
+
+
+
+
+
+
+## Usage
+
+```javascript
+var cwxsa = require( '@stdlib/blas/ext/base/cwxsa' );
+```
+
+#### cwxsa( N, alpha, x, strideX, w, strideW )
+
+Subtracts a scalar constant from each element in a single-precision complex floating-point strided array `x` and assigns the results to elements in a single-precision complex floating-point strided array `w`.
+
+```javascript
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+
+var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
+var w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+var alpha = new Complex64( 5.0, 3.0 );
+
+cwxsa( x.length, alpha, x, 1, w, 1 );
+// w => [ -4.0, -1.0, -2.0, 1.0, 0.0, 3.0, 2.0, 5.0 ]
+```
+
+The function has the following parameters:
+
+- **N**: number of indexed elements.
+- **alpha**: scalar constant.
+- **x**: input [`Complex64Array`][@stdlib/array/complex64].
+- **strideX**: stride length for `x`.
+- **w**: output [`Complex64Array`][@stdlib/array/complex64].
+- **strideW**: stride length for `w`.
+
+The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to subtract `alpha` from every other element in `x` and assign the results to every other element in `w`:
+
+```javascript
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+
+var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
+var w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+
+var alpha = new Complex64( 5.0, 3.0 );
+
+cwxsa( 2, alpha, x, 2, w, 2 );
+// w => [ -4.0, -1.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0 ]
+```
+
+Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
+
+
+
+```javascript
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+
+// Initial arrays...
+var x0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 ] );
+var w0 = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+
+// Create offset views...
+var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
+var w1 = new Complex64Array( w0.buffer, w0.BYTES_PER_ELEMENT*2 ); // start at 3rd element
+
+var alpha = new Complex64( 5.0, 3.0 );
+
+cwxsa( 3, alpha, x1, 1, w1, 1 );
+// w0 => [ 0.0, 0.0, 0.0, 0.0, -2.0, 1.0, 0.0, 3.0, 2.0, 5.0 ]
+```
+
+#### cwxsa.ndarray( N, alpha, x, strideX, offsetX, w, strideW, offsetW )
+
+Subtracts a scalar constant from each element in a single-precision complex floating-point strided array `x` and assigns the results to elements in a single-precision complex floating-point strided array `w` using alternative indexing semantics.
+
+```javascript
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+
+var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
+var w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+var alpha = new Complex64( 5.0, 3.0 );
+
+cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1, 0 );
+// w => [ -4.0, -1.0, -2.0, 1.0, 0.0, 3.0, 2.0, 5.0 ]
+```
+
+The function has the following additional parameters:
+
+- **offsetX**: starting index for `x`.
+- **offsetW**: starting index for `w`.
+
+While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to subtract `alpha` from the last three elements of `x` and assign the results to the last three elements of `w`:
+
+
+
+```javascript
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+
+var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 ] );
+var w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+
+var alpha = new Complex64( 5.0, 3.0 );
+
+cwxsa.ndarray( 3, alpha, x, 1, x.length-3, w, 1, w.length-3 );
+// w => [ 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 2.0, 5.0, 4.0, 7.0 ]
+```
+
+
+
+
+
+
+
+## Notes
+
+- If `N <= 0`, both functions return `w` unchanged.
+
+
+
+
+
+
+
+## Examples
+
+
+
+```javascript
+var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+var logEach = require( '@stdlib/console/log-each' );
+var cwxsa = require( '@stdlib/blas/ext/base/cwxsa' );
+
+var xbuf = discreteUniform( 20, -100, 100, {
+ 'dtype': 'float32'
+});
+var wbuf = discreteUniform( 20, -100, 100, {
+ 'dtype': 'float32'
+});
+var x = new Complex64Array( xbuf.buffer );
+var w = new Complex64Array( wbuf.buffer );
+var alpha = new Complex64( 5.0, 3.0 );
+
+cwxsa( x.length, alpha, x, 1, w, 1 );
+logEach( '%s', w );
+```
+
+
+
+
+
+
+
+* * *
+
+
+
+## C APIs
+
+
+
+
+
+
+
+
+
+
+
+### Usage
+
+```c
+#include "stdlib/blas/ext/base/cwxsa.h"
+```
+
+#### stdlib_strided_cwxsa( N, alpha, \*X, strideX, \*W, strideW )
+
+Subtracts a scalar constant from each element in a single-precision complex floating-point strided array `X` and assigns the results to elements in a single-precision complex floating-point strided array `W`.
+
+```c
+#include "stdlib/complex/float32/ctor.h"
+
+const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
+float w[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
+const stdlib_complex64_t alpha = stdlib_complex64( 5.0f, 3.0f );
+
+stdlib_strided_cwxsa( 4, alpha, (const stdlib_complex64_t *)x, 1, (stdlib_complex64_t *)w, 1 );
+```
+
+The function accepts the following arguments:
+
+- **N**: `[in] CBLAS_INT` number of indexed elements.
+- **alpha**: `[in] stdlib_complex64_t` scalar constant.
+- **X**: `[in] stdlib_complex64_t*` input array.
+- **strideX**: `[in] CBLAS_INT` stride length for `X`.
+- **W**: `[out] stdlib_complex64_t*` output array.
+- **strideW**: `[in] CBLAS_INT` stride length for `W`.
+
+```c
+void stdlib_strided_cwxsa( const CBLAS_INT N, const stdlib_complex64_t alpha, const stdlib_complex64_t *X, const CBLAS_INT strideX, stdlib_complex64_t *W, const CBLAS_INT strideW );
+```
+
+
+
+#### stdlib_strided_cwxsa_ndarray( N, alpha, \*X, strideX, offsetX, \*W, strideW, offsetW )
+
+
+
+Subtracts a scalar constant from each element in a single-precision complex floating-point strided array `X` and assigns the results to elements in a single-precision complex floating-point strided array `W` using alternative indexing semantics.
+
+```c
+#include "stdlib/complex/float32/ctor.h"
+
+const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
+float w[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
+const stdlib_complex64_t alpha = stdlib_complex64( 5.0f, 3.0f );
+
+stdlib_strided_cwxsa_ndarray( 4, alpha, (const stdlib_complex64_t *)x, 1, 0, (stdlib_complex64_t *)w, 1, 0 );
+```
+
+The function accepts the following arguments:
+
+- **N**: `[in] CBLAS_INT` number of indexed elements.
+- **alpha**: `[in] stdlib_complex64_t` scalar constant.
+- **X**: `[in] stdlib_complex64_t*` input array.
+- **strideX**: `[in] CBLAS_INT` stride length for `X`.
+- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
+- **W**: `[out] stdlib_complex64_t*` output array.
+- **strideW**: `[in] CBLAS_INT` stride length for `W`.
+- **offsetW**: `[in] CBLAS_INT` starting index for `W`.
+
+```c
+void stdlib_strided_cwxsa_ndarray( const CBLAS_INT N, const stdlib_complex64_t alpha, const stdlib_complex64_t *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, stdlib_complex64_t *W, const CBLAS_INT strideW, const CBLAS_INT offsetW );
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+### Examples
+
+```c
+#include "stdlib/blas/ext/base/cwxsa.h"
+#include "stdlib/complex/float32/ctor.h"
+#include "stdlib/complex/float32/real.h"
+#include "stdlib/complex/float32/imag.h"
+#include
+
+int main( void ) {
+ // Create strided arrays:
+ const stdlib_complex64_t x[] = {
+ stdlib_complex64( 1.0f, 2.0f ),
+ stdlib_complex64( 3.0f, 4.0f ),
+ stdlib_complex64( 5.0f, 6.0f ),
+ stdlib_complex64( 7.0f, 8.0f )
+ };
+ stdlib_complex64_t w[] = {
+ stdlib_complex64( 0.0f, 0.0f ),
+ stdlib_complex64( 0.0f, 0.0f ),
+ stdlib_complex64( 0.0f, 0.0f ),
+ stdlib_complex64( 0.0f, 0.0f )
+ };
+
+ // Specify the number of indexed elements:
+ const int N = 4;
+
+ // Specify strides:
+ const int strideX = 1;
+ const int strideW = 1;
+
+ // Define a scalar constant:
+ stdlib_complex64_t alpha = stdlib_complex64( 5.0f, 3.0f );
+
+ // Subtract a constant from each element in `x` and assign to `w`:
+ stdlib_strided_cwxsa( N, alpha, x, strideX, w, strideW );
+
+ // Print the result:
+ for ( int i = 0; i < N; i++ ) {
+ printf( "w[ %i ] = %f + %fi\n", i, stdlib_complex64_real( w[ i ] ), stdlib_complex64_imag( w[ i ] ) );
+ }
+}
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[@stdlib/array/complex64]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/complex64
+
+[@stdlib/blas/ext/base/cxsa]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/cxsa
+
+[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
+
+
+
+
+
+
+
+
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/benchmark.js
new file mode 100644
index 000000000000..9f66dc0ea7d2
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/benchmark.js
@@ -0,0 +1,116 @@
+/**
+* @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 uniform = require( '@stdlib/random/array/uniform' );
+var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
+var pow = require( '@stdlib/math/base/special/pow' );
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+var format = require( '@stdlib/string/format' );
+var pkg = require( './../package.json' ).name;
+var cwxsa = require( './../lib/cwxsa.js' );
+
+
+// VARIABLES //
+
+var options = {
+ 'dtype': 'float32'
+};
+
+
+// FUNCTIONS //
+
+/**
+* Create a benchmark function.
+*
+* @private
+* @param {PositiveInteger} len - array length
+* @returns {Function} benchmark function
+*/
+function createBenchmark( len ) {
+ var alpha;
+ var xbuf;
+ var wbuf;
+ var x;
+ var w;
+
+ xbuf = uniform( len*2, -100.0, 100.0, options );
+ wbuf = uniform( len*2, -100.0, 100.0, options );
+ x = new Complex64Array( xbuf.buffer );
+ w = new Complex64Array( wbuf.buffer );
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ cwxsa( x.length, alpha, x, 1, w, 1 );
+ if ( isnanf( wbuf[ i%(len*2) ] ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ }
+ b.toc();
+ if ( isnanf( wbuf[ i%(len*2) ] ) ) {
+ 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 = 1; // 10^min
+ max = 6; // 10^max
+
+ for ( i = min; i <= max; i++ ) {
+ len = pow( 10, i );
+ f = createBenchmark( len );
+ bench( format( '%s:len=%d', pkg, len ), f );
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/benchmark.native.js
new file mode 100644
index 000000000000..19cff568429e
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/benchmark.native.js
@@ -0,0 +1,121 @@
+/**
+* @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 resolve = require( 'path' ).resolve;
+var bench = require( '@stdlib/bench' );
+var uniform = require( '@stdlib/random/array/uniform' );
+var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
+var pow = require( '@stdlib/math/base/special/pow' );
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+var tryRequire = require( '@stdlib/utils/try-require' );
+var format = require( '@stdlib/string/format' );
+var pkg = require( './../package.json' ).name;
+
+
+// VARIABLES //
+
+var cwxsa = tryRequire( resolve( __dirname, './../lib/cwxsa.native.js' ) );
+var opts = {
+ 'skip': ( cwxsa instanceof Error )
+};
+var options = {
+ 'dtype': 'float32'
+};
+
+
+// FUNCTIONS //
+
+/**
+* Create a benchmark function.
+*
+* @private
+* @param {PositiveInteger} len - array length
+* @returns {Function} benchmark function
+*/
+function createBenchmark( len ) {
+ var alpha;
+ var xbuf;
+ var wbuf;
+ var x;
+ var w;
+
+ xbuf = uniform( len*2, -100.0, 100.0, options );
+ wbuf = uniform( len*2, -100.0, 100.0, options );
+ x = new Complex64Array( xbuf.buffer );
+ w = new Complex64Array( wbuf.buffer );
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ cwxsa( x.length, alpha, x, 1, w, 1 );
+ if ( isnanf( wbuf[ i%(len*2) ] ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ }
+ b.toc();
+ if ( isnanf( wbuf[ i%(len*2) ] ) ) {
+ 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 = 1; // 10^min
+ max = 6; // 10^max
+
+ for ( i = min; i <= max; i++ ) {
+ len = pow( 10, i );
+ f = createBenchmark( len );
+ bench( format( '%s::native:len=%d', pkg, len ), opts, f );
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/benchmark.ndarray.js
new file mode 100644
index 000000000000..fb03747afbab
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/benchmark.ndarray.js
@@ -0,0 +1,116 @@
+/**
+* @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 uniform = require( '@stdlib/random/array/uniform' );
+var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
+var pow = require( '@stdlib/math/base/special/pow' );
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+var format = require( '@stdlib/string/format' );
+var pkg = require( './../package.json' ).name;
+var cwxsa = require( './../lib/ndarray.js' );
+
+
+// VARIABLES //
+
+var options = {
+ 'dtype': 'float32'
+};
+
+
+// FUNCTIONS //
+
+/**
+* Create a benchmark function.
+*
+* @private
+* @param {PositiveInteger} len - array length
+* @returns {Function} benchmark function
+*/
+function createBenchmark( len ) {
+ var alpha;
+ var xbuf;
+ var wbuf;
+ var x;
+ var w;
+
+ xbuf = uniform( len*2, -100.0, 100.0, options );
+ wbuf = uniform( len*2, -100.0, 100.0, options );
+ x = new Complex64Array( xbuf.buffer );
+ w = new Complex64Array( wbuf.buffer );
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+ if ( isnanf( wbuf[ i%(len*2) ] ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ }
+ b.toc();
+ if ( isnanf( wbuf[ i%(len*2) ] ) ) {
+ 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 = 1; // 10^min
+ max = 6; // 10^max
+
+ for ( i = min; i <= max; i++ ) {
+ len = pow( 10, i );
+ f = createBenchmark( len );
+ bench( format( '%s:ndarray:len=%d', pkg, len ), f );
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/benchmark.ndarray.native.js
new file mode 100644
index 000000000000..27447b2d106a
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/benchmark.ndarray.native.js
@@ -0,0 +1,121 @@
+/**
+* @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 resolve = require( 'path' ).resolve;
+var bench = require( '@stdlib/bench' );
+var uniform = require( '@stdlib/random/array/uniform' );
+var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
+var pow = require( '@stdlib/math/base/special/pow' );
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+var tryRequire = require( '@stdlib/utils/try-require' );
+var format = require( '@stdlib/string/format' );
+var pkg = require( './../package.json' ).name;
+
+
+// VARIABLES //
+
+var cwxsa = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) );
+var opts = {
+ 'skip': ( cwxsa instanceof Error )
+};
+var options = {
+ 'dtype': 'float32'
+};
+
+
+// FUNCTIONS //
+
+/**
+* Create a benchmark function.
+*
+* @private
+* @param {PositiveInteger} len - array length
+* @returns {Function} benchmark function
+*/
+function createBenchmark( len ) {
+ var alpha;
+ var xbuf;
+ var wbuf;
+ var x;
+ var w;
+
+ xbuf = uniform( len*2, -100.0, 100.0, options );
+ wbuf = uniform( len*2, -100.0, 100.0, options );
+ x = new Complex64Array( xbuf.buffer );
+ w = new Complex64Array( wbuf.buffer );
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+ if ( isnanf( wbuf[ i%(len*2) ] ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ }
+ b.toc();
+ if ( isnanf( wbuf[ i%(len*2) ] ) ) {
+ 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 = 1; // 10^min
+ max = 6; // 10^max
+
+ for ( i = min; i <= max; i++ ) {
+ len = pow( 10, i );
+ f = createBenchmark( len );
+ bench( format( '%s::native:ndarray:len=%d', pkg, len ), opts, f );
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/c/Makefile
new file mode 100644
index 000000000000..0756dc7da20a
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/c/Makefile
@@ -0,0 +1,146 @@
+#/
+# @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.
+#/
+
+# VARIABLES #
+
+ifndef VERBOSE
+ QUIET := @
+else
+ QUIET :=
+endif
+
+# Determine the OS ([1][1], [2][2]).
+#
+# [1]: https://en.wikipedia.org/wiki/Uname#Examples
+# [2]: http://stackoverflow.com/a/27776822/2225624
+OS ?= $(shell uname)
+ifneq (, $(findstring MINGW,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring MSYS,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring CYGWIN,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring Windows_NT,$(OS)))
+ OS := WINNT
+endif
+endif
+endif
+endif
+
+# Define the program used for compiling C source files:
+ifdef C_COMPILER
+ CC := $(C_COMPILER)
+else
+ CC := gcc
+endif
+
+# Define the command-line options when compiling C files:
+CFLAGS ?= \
+ -std=c99 \
+ -O3 \
+ -Wall \
+ -pedantic
+
+# Determine whether to generate position independent code ([1][1], [2][2]).
+#
+# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options
+# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option
+ifeq ($(OS), WINNT)
+ fPIC ?=
+else
+ fPIC ?= -fPIC
+endif
+
+# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`):
+INCLUDE ?=
+
+# List of source files:
+SOURCE_FILES ?=
+
+# List of libraries (e.g., `-lopenblas -lpthread`):
+LIBRARIES ?=
+
+# List of library paths (e.g., `-L /foo/bar -L /beep/boop`):
+LIBPATH ?=
+
+# List of C targets:
+c_targets := benchmark.length.out
+
+
+# RULES #
+
+#/
+# Compiles source files.
+#
+# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`)
+# @param {string} [CFLAGS] - C compiler options
+# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`)
+# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`)
+# @param {string} [SOURCE_FILES] - list of source files
+# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`)
+# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`)
+#
+# @example
+# make
+#
+# @example
+# make all
+#/
+all: $(c_targets)
+
+.PHONY: all
+
+#/
+# Compiles C source files.
+#
+# @private
+# @param {string} CC - C compiler (e.g., `gcc`)
+# @param {string} CFLAGS - C compiler options
+# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`)
+# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`)
+# @param {string} SOURCE_FILES - list of source files
+# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`)
+# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`)
+#/
+$(c_targets): %.out: %.c
+ $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES)
+
+#/
+# Runs compiled benchmarks.
+#
+# @example
+# make run
+#/
+run: $(c_targets)
+ $(QUIET) ./$<
+
+.PHONY: run
+
+#/
+# Removes generated files.
+#
+# @example
+# make clean
+#/
+clean:
+ $(QUIET) -rm -f *.o *.out
+
+.PHONY: clean
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/c/benchmark.length.c
new file mode 100644
index 000000000000..71689d13c57f
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/benchmark/c/benchmark.length.c
@@ -0,0 +1,214 @@
+/**
+* @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.
+*/
+
+#include "stdlib/blas/ext/base/cwxsa.h"
+#include "stdlib/complex/float32/ctor.h"
+#include
+#include
+#include
+#include
+#include
+
+#define NAME "cwxsa"
+#define ITERATIONS 10000000
+#define REPEATS 3
+#define MIN 1
+#define MAX 6
+
+/**
+* Prints the TAP version.
+*/
+static void print_version( void ) {
+ printf( "TAP version 13\n" );
+}
+
+/**
+* Prints the TAP summary.
+*
+* @param total total number of tests
+* @param passing total number of passing tests
+*/
+static void print_summary( int total, int passing ) {
+ printf( "#\n" );
+ printf( "1..%d\n", total ); // TAP plan
+ printf( "# total %d\n", total );
+ printf( "# pass %d\n", passing );
+ printf( "#\n" );
+ printf( "# ok\n" );
+}
+
+/**
+* Prints benchmarks results.
+*
+* @param iterations number of iterations
+* @param elapsed elapsed time in seconds
+*/
+static void print_results( int iterations, double elapsed ) {
+ double rate = (double)iterations / elapsed;
+ printf( " ---\n" );
+ printf( " iterations: %d\n", iterations );
+ printf( " elapsed: %0.9f\n", elapsed );
+ printf( " rate: %0.9f\n", rate );
+ printf( " ...\n" );
+}
+
+/**
+* Returns a clock time.
+*
+* @return clock time
+*/
+static double tic( void ) {
+ struct timeval now;
+ gettimeofday( &now, NULL );
+ return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
+}
+
+/**
+* Generates a random number on the interval [min,max).
+*
+* @param min minimum value (inclusive)
+* @param max maximum value (exclusive)
+* @return random number
+*/
+static float random_uniform( const float min, const float max ) {
+ float v = (float)rand() / ( (float)RAND_MAX + 1.0f );
+ return min + ( v*(max-min) );
+}
+
+/**
+* Runs a benchmark.
+*
+* @param iterations number of iterations
+* @param len array length
+* @return elapsed time in seconds
+*/
+static double benchmark1( int iterations, int len ) {
+ stdlib_complex64_t alpha;
+ double elapsed;
+ double t;
+ float *x;
+ float *w;
+ int i;
+
+ x = (float *)malloc( len * 2 * sizeof( float ) );
+ w = (float *)malloc( len * 2 * sizeof( float ) );
+
+ alpha = stdlib_complex64( 5.0f, 3.0f );
+ for ( i = 0; i < len*2; i++ ) {
+ x[ i ] = random_uniform( -100.0f, 100.0f );
+ w[ i ] = random_uniform( -100.0f, 100.0f );
+ }
+ t = tic();
+ for ( i = 0; i < iterations; i++ ) {
+ // cppcheck-suppress uninitvar
+ stdlib_strided_cwxsa( len, alpha, (const stdlib_complex64_t *)x, 1, (stdlib_complex64_t *)w, 1 );
+ if ( w[ 0 ] != w[ 0 ] ) {
+ printf( "should not return NaN\n" );
+ break;
+ }
+ }
+ elapsed = tic() - t;
+ if ( w[ 0 ] != w[ 0 ] ) {
+ printf( "should not return NaN\n" );
+ }
+ free( x );
+ free( w );
+ return elapsed;
+}
+
+/**
+* Runs a benchmark.
+*
+* @param iterations number of iterations
+* @param len array length
+* @return elapsed time in seconds
+*/
+static double benchmark2( int iterations, int len ) {
+ stdlib_complex64_t alpha;
+ double elapsed;
+ double t;
+ float *x;
+ float *w;
+ int i;
+
+ x = (float *)malloc( len * 2 * sizeof( float ) );
+ w = (float *)malloc( len * 2 * sizeof( float ) );
+
+ alpha = stdlib_complex64( 5.0f, 3.0f );
+ for ( i = 0; i < len*2; i++ ) {
+ x[ i ] = random_uniform( -100.0f, 100.0f );
+ w[ i ] = random_uniform( -100.0f, 100.0f );
+ }
+ t = tic();
+ for ( i = 0; i < iterations; i++ ) {
+ // cppcheck-suppress uninitvar
+ stdlib_strided_cwxsa_ndarray( len, alpha, (const stdlib_complex64_t *)x, 1, 0, (stdlib_complex64_t *)w, 1, 0 );
+ if ( w[ 0 ] != w[ 0 ] ) {
+ printf( "should not return NaN\n" );
+ break;
+ }
+ }
+ elapsed = tic() - t;
+ if ( w[ 0 ] != w[ 0 ] ) {
+ printf( "should not return NaN\n" );
+ }
+ free( x );
+ free( w );
+ return elapsed;
+}
+
+/**
+* Main execution sequence.
+*/
+int main( void ) {
+ double elapsed;
+ int count;
+ int iter;
+ int len;
+ int i;
+ int j;
+
+ // Use the current time to seed the random number generator:
+ srand( time( NULL ) );
+
+ print_version();
+ count = 0;
+ for ( i = MIN; i <= MAX; i++ ) {
+ len = pow( 10, i );
+ iter = ITERATIONS / pow( 10, i-1 );
+ for ( j = 0; j < REPEATS; j++ ) {
+ count += 1;
+ printf( "# c::%s:len=%d\n", NAME, len );
+ elapsed = benchmark1( iter, len );
+ print_results( iter, elapsed );
+ printf( "ok %d benchmark finished\n", count );
+ }
+ }
+ for ( i = MIN; i <= MAX; i++ ) {
+ len = pow( 10, i );
+ iter = ITERATIONS / pow( 10, i-1 );
+ for ( j = 0; j < REPEATS; j++ ) {
+ count += 1;
+ printf( "# c::%s:ndarray:len=%d\n", NAME, len );
+ elapsed = benchmark2( iter, len );
+ print_results( iter, elapsed );
+ printf( "ok %d benchmark finished\n", count );
+ }
+ }
+ print_summary( count, count );
+}
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/binding.gyp b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/binding.gyp
new file mode 100644
index 000000000000..60dce9d0b31a
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/binding.gyp
@@ -0,0 +1,265 @@
+# @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.
+
+# A `.gyp` file for building a Node.js native add-on.
+#
+# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md
+# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md
+{
+ # List of files to include in this file:
+ 'includes': [
+ './include.gypi',
+ ],
+
+ # Define variables to be used throughout the configuration for all targets:
+ 'variables': {
+ # Target name should match the add-on export name:
+ 'addon_target_name%': 'addon',
+
+ # Fortran compiler (to override -Dfortran_compiler=):
+ 'fortran_compiler%': 'gfortran',
+
+ # Fortran compiler flags:
+ 'fflags': [
+ # Specify the Fortran standard to which a program is expected to conform:
+ '-std=f95',
+
+ # Indicate that the layout is free-form source code:
+ '-ffree-form',
+
+ # Aggressive optimization:
+ '-O3',
+
+ # Enable commonly used warning options:
+ '-Wall',
+
+ # Warn if source code contains problematic language features:
+ '-Wextra',
+
+ # Warn if a procedure is called without an explicit interface:
+ '-Wimplicit-interface',
+
+ # Do not transform names of entities specified in Fortran source files by appending underscores (i.e., don't mangle names, thus allowing easier usage in C wrappers):
+ '-fno-underscoring',
+
+ # Warn if source code contains Fortran 95 extensions and C-language constructs:
+ '-pedantic',
+
+ # Compile but do not link (output is an object file):
+ '-c',
+ ],
+
+ # Set variables based on the host OS:
+ 'conditions': [
+ [
+ 'OS=="win"',
+ {
+ # Define the object file suffix:
+ 'obj': 'obj',
+ },
+ {
+ # Define the object file suffix:
+ 'obj': 'o',
+ }
+ ], # end condition (OS=="win")
+ ], # end conditions
+ }, # end variables
+
+ # Define compile targets:
+ 'targets': [
+
+ # Target to generate an add-on:
+ {
+ # The target name should match the add-on export name:
+ 'target_name': '<(addon_target_name)',
+
+ # Define dependencies:
+ 'dependencies': [],
+
+ # Define directories which contain relevant include headers:
+ 'include_dirs': [
+ # Local include directory:
+ '<@(include_dirs)',
+ ],
+
+ # List of source files:
+ 'sources': [
+ '<@(src_files)',
+ ],
+
+ # Settings which should be applied when a target's object files are used as linker input:
+ 'link_settings': {
+ # Define libraries:
+ 'libraries': [
+ '<@(libraries)',
+ ],
+
+ # Define library directories:
+ 'library_dirs': [
+ '<@(library_dirs)',
+ ],
+ },
+
+ # C/C++ compiler flags:
+ 'cflags': [
+ # Enable commonly used warning options:
+ '-Wall',
+
+ # Aggressive optimization:
+ '-O3',
+ ],
+
+ # C specific compiler flags:
+ 'cflags_c': [
+ # Specify the C standard to which a program is expected to conform:
+ '-std=c99',
+ ],
+
+ # C++ specific compiler flags:
+ 'cflags_cpp': [
+ # Specify the C++ standard to which a program is expected to conform:
+ '-std=c++11',
+ ],
+
+ # Linker flags:
+ 'ldflags': [],
+
+ # Apply conditions based on the host OS:
+ 'conditions': [
+ [
+ 'OS=="mac"',
+ {
+ # Linker flags:
+ 'ldflags': [
+ '-undefined dynamic_lookup',
+ '-Wl,-no-pie',
+ '-Wl,-search_paths_first',
+ ],
+ },
+ ], # end condition (OS=="mac")
+ [
+ 'OS!="win"',
+ {
+ # C/C++ flags:
+ 'cflags': [
+ # Generate platform-independent code:
+ '-fPIC',
+ ],
+ },
+ ], # end condition (OS!="win")
+ ], # end conditions
+
+ # Define custom build actions for particular inputs:
+ 'rules': [
+ {
+ # Define a rule for processing Fortran files:
+ 'extension': 'f',
+
+ # Define the pathnames to be used as inputs when performing processing:
+ 'inputs': [
+ # Full path of the current input:
+ '<(RULE_INPUT_PATH)'
+ ],
+
+ # Define the outputs produced during processing:
+ 'outputs': [
+ # Store an output object file in a directory for placing intermediate results (only accessible within a single target):
+ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).<(obj)'
+ ],
+
+ # Define the rule for compiling Fortran based on the host OS:
+ 'conditions': [
+ [
+ 'OS=="win"',
+
+ # Rule to compile Fortran on Windows:
+ {
+ 'rule_name': 'compile_fortran_windows',
+ 'message': 'Compiling Fortran file <(RULE_INPUT_PATH) on Windows...',
+
+ 'process_outputs_as_sources': 0,
+
+ # Define the command-line invocation:
+ 'action': [
+ '<(fortran_compiler)',
+ '<@(fflags)',
+ '<@(_inputs)',
+ '-o',
+ '<@(_outputs)',
+ ],
+ },
+
+ # Rule to compile Fortran on non-Windows:
+ {
+ 'rule_name': 'compile_fortran_linux',
+ 'message': 'Compiling Fortran file <(RULE_INPUT_PATH) on Linux...',
+
+ 'process_outputs_as_sources': 1,
+
+ # Define the command-line invocation:
+ 'action': [
+ '<(fortran_compiler)',
+ '<@(fflags)',
+ '-fPIC', # generate platform-independent code
+ '<@(_inputs)',
+ '-o',
+ '<@(_outputs)',
+ ],
+ }
+ ], # end condition (OS=="win")
+ ], # end conditions
+ }, # end rule (extension=="f")
+ ], # end rules
+ }, # end target <(addon_target_name)
+
+ # Target to copy a generated add-on to a standard location:
+ {
+ 'target_name': 'copy_addon',
+
+ # Declare that the output of this target is not linked:
+ 'type': 'none',
+
+ # Define dependencies:
+ 'dependencies': [
+ # Require that the add-on be generated before building this target:
+ '<(addon_target_name)',
+ ],
+
+ # Define a list of actions:
+ 'actions': [
+ {
+ 'action_name': 'copy_addon',
+ 'message': 'Copying addon...',
+
+ # Explicitly list the inputs in the command-line invocation below:
+ 'inputs': [],
+
+ # Declare the expected outputs:
+ 'outputs': [
+ '<(addon_output_dir)/<(addon_target_name).node',
+ ],
+
+ # Define the command-line invocation:
+ 'action': [
+ 'cp',
+ '<(PRODUCT_DIR)/<(addon_target_name).node',
+ '<(addon_output_dir)/<(addon_target_name).node',
+ ],
+ },
+ ], # end actions
+ }, # end target copy_addon
+ ], # end targets
+}
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/docs/repl.txt
new file mode 100644
index 000000000000..0299cbea4225
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/docs/repl.txt
@@ -0,0 +1,138 @@
+
+{{alias}}( N, alpha, x, strideX, w, strideW )
+ Subtracts a scalar constant from each element in a single-precision complex
+ floating-point strided array `x` and assigns the results to elements in a
+ single-precision complex floating-point strided array `w`.
+
+ The `N` and stride parameters determine which elements in the strided
+ arrays are accessed at runtime.
+
+ Indexing is relative to the first index. To introduce an offset, use typed
+ array views.
+
+ If `N <= 0`, the function returns `w` unchanged.
+
+ Parameters
+ ----------
+ N: integer
+ Number of indexed elements.
+
+ alpha: Complex64
+ Scalar constant.
+
+ x: Complex64Array
+ Input array.
+
+ strideX: integer
+ Stride length for `x`.
+
+ w: Complex64Array
+ Output array.
+
+ strideW: integer
+ Stride length for `w`.
+
+ Returns
+ -------
+ w: Complex64Array
+ Output array.
+
+ Examples
+ --------
+ // Standard Usage:
+ > var bufX = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
+ > var bufW = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
+ > var x = new {{alias:@stdlib/array/complex64}}( bufX );
+ > var w = new {{alias:@stdlib/array/complex64}}( bufW );
+ > var alpha = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 );
+ > {{alias}}( x.length, alpha, x, 1, w, 1 )
+ [ -4.0, -1.0, -2.0, 1.0, 0.0, 3.0 ]
+
+ // Using `N` and stride parameters:
+ > bufX = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ];
+ > x = new {{alias:@stdlib/array/complex64}}( bufX );
+ > bufW = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
+ > w = new {{alias:@stdlib/array/complex64}}( bufW );
+ > alpha = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 );
+ > {{alias}}( 2, alpha, x, 2, w, 2 )
+ [ -4.0, -1.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0 ]
+
+ // Using view offsets:
+ > var bufX = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 ];
+ > var bufW = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
+ > var x0 = new {{alias:@stdlib/array/complex64}}( bufX );
+ > var w0 = new {{alias:@stdlib/array/complex64}}( bufW );
+ > var offsetX = x0.BYTES_PER_ELEMENT * 1;
+ > var offsetW = w0.BYTES_PER_ELEMENT * 2;
+ > var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, offsetX );
+ > var w1 = new {{alias:@stdlib/array/complex64}}( w0.buffer, offsetW );
+ > alpha = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 );
+ > {{alias}}( 3, alpha, x1, 1, w1, 1 )
+ [ -2.0, 1.0, 0.0, 3.0, 2.0, 5.0 ]
+ > w0
+ [ 0.0, 0.0, 0.0, 0.0, -2.0, 1.0, 0.0, 3.0, 2.0, 5.0 ]
+
+
+{{alias}}.ndarray( N, alpha, x, strideX, offsetX, w, strideW, offsetW )
+ Subtracts a scalar constant from each element in a single-precision complex
+ floating-point strided array `x` and assigns the results to elements in a
+ single-precision complex floating-point strided array `w` using alternative
+ indexing semantics.
+
+ While typed array views mandate a view offset based on the underlying
+ buffer, the offset parameters support indexing semantics based on starting
+ indices.
+
+ Parameters
+ ----------
+ N: integer
+ Number of indexed elements.
+
+ alpha: Complex64
+ Scalar constant.
+
+ x: Complex64Array
+ Input array.
+
+ strideX: integer
+ Stride length for `x`.
+
+ offsetX: integer
+ Starting index for `x`.
+
+ w: Complex64Array
+ Output array.
+
+ strideW: integer
+ Stride length for `w`.
+
+ offsetW: integer
+ Starting index for `w`.
+
+ Returns
+ -------
+ w: Complex64Array
+ Output array.
+
+ Examples
+ --------
+ // Standard Usage:
+ > var bufX = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
+ > var bufW = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
+ > var x = new {{alias:@stdlib/array/complex64}}( bufX );
+ > var w = new {{alias:@stdlib/array/complex64}}( bufW );
+ > var alpha = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 );
+ > {{alias}}.ndarray( x.length, alpha, x, 1, 0, w, 1, 0 )
+ [ -4.0, -1.0, -2.0, 1.0, 0.0, 3.0 ]
+
+ // Using index offsets:
+ > bufX = [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0, 5.0, 0.0 ];
+ > x = new {{alias:@stdlib/array/complex64}}( bufX );
+ > bufW = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
+ > w = new {{alias:@stdlib/array/complex64}}( bufW );
+ > alpha = new {{alias:@stdlib/complex/float32/ctor}}( 2.0, 1.0 );
+ > {{alias}}.ndarray( 3, alpha, x, 1, x.length-3, w, 1, w.length-3 )
+ [ 0.0, 0.0, 0.0, 0.0, 1.0, -1.0, 2.0, -1.0, 3.0, -1.0 ]
+
+ See Also
+ --------
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/docs/types/index.d.ts
new file mode 100644
index 000000000000..0d8ebb51b6f6
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/docs/types/index.d.ts
@@ -0,0 +1,123 @@
+/*
+* @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 { Complex64Array } from '@stdlib/types/array';
+import { Complex64 } from '@stdlib/types/complex';
+
+/**
+* Interface describing `cwxsa`.
+*/
+interface Routine {
+ /**
+ * Subtracts a scalar constant from each element in a single-precision complex floating-point strided array `x` and assigns the results to elements in a single-precision complex floating-point strided array `w`.
+ *
+ * @param N - number of indexed elements
+ * @param alpha - scalar constant
+ * @param x - input array
+ * @param strideX - `x` stride length
+ * @param w - output array
+ * @param strideW - `w` stride length
+ * @returns `w`
+ *
+ * @example
+ * var Complex64Array = require( '@stdlib/array/complex64' );
+ * var Complex64 = require( '@stdlib/complex/float32/ctor' );
+ *
+ * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
+ * var w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+ *
+ * var alpha = new Complex64( 5.0, 3.0 );
+ *
+ * cwxsa( x.length, alpha, x, 1, w, 1 );
+ * // w => [ -4.0, -1.0, -2.0, 1.0, 0.0, 3.0, 2.0, 5.0 ]
+ */
+ ( N: number, alpha: Complex64, x: Complex64Array, strideX: number, w: Complex64Array, strideW: number ): Complex64Array;
+
+ /**
+ * Subtracts a scalar constant from each element in a single-precision complex floating-point strided array `x` and assigns the results to elements in a single-precision complex floating-point strided array `w` using alternative indexing semantics.
+ *
+ * @param N - number of indexed elements
+ * @param alpha - scalar constant
+ * @param x - input array
+ * @param strideX - `x` stride length
+ * @param offsetX - starting index for `x`
+ * @param w - output array
+ * @param strideW - `w` stride length
+ * @param offsetW - starting index for `w`
+ * @returns `w`
+ *
+ * @example
+ * var Complex64Array = require( '@stdlib/array/complex64' );
+ * var Complex64 = require( '@stdlib/complex/float32/ctor' );
+ *
+ * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
+ * var w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+ *
+ * var alpha = new Complex64( 5.0, 3.0 );
+ *
+ * cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1, 0 );
+ * // w => [ -4.0, -1.0, -2.0, 1.0, 0.0, 3.0, 2.0, 5.0 ]
+ */
+ ndarray( N: number, alpha: Complex64, x: Complex64Array, strideX: number, offsetX: number, w: Complex64Array, strideW: number, offsetW: number ): Complex64Array;
+}
+
+/**
+* Subtracts a scalar constant from each element in a single-precision complex floating-point strided array `x` and assigns the results to elements in a single-precision complex floating-point strided array `w`.
+*
+* @param N - number of indexed elements
+* @param alpha - scalar constant
+* @param x - input array
+* @param strideX - `x` stride length
+* @param w - output array
+* @param strideW - `w` stride length
+* @returns `w`
+*
+* @example
+* var Complex64Array = require( '@stdlib/array/complex64' );
+* var Complex64 = require( '@stdlib/complex/float32/ctor' );
+*
+* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
+* var w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+*
+* var alpha = new Complex64( 5.0, 3.0 );
+*
+* cwxsa( x.length, alpha, x, 1, w, 1 );
+* // w => [ -4.0, -1.0, -2.0, 1.0, 0.0, 3.0, 2.0, 5.0 ]
+*
+* @example
+* var Complex64Array = require( '@stdlib/array/complex64' );
+* var Complex64 = require( '@stdlib/complex/float32/ctor' );
+*
+* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
+* var w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+*
+* var alpha = new Complex64( 5.0, 3.0 );
+*
+* cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1, 0 );
+* // w => [ -4.0, -1.0, -2.0, 1.0, 0.0, 3.0, 2.0, 5.0 ]
+*/
+declare var cwxsa: Routine;
+
+
+// EXPORTS //
+
+export = cwxsa;
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/docs/types/test.ts
new file mode 100644
index 000000000000..8185727a537a
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/docs/types/test.ts
@@ -0,0 +1,298 @@
+/*
+* @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.
+*/
+
+import Complex64Array = require( '@stdlib/array/complex64' );
+import Complex64 = require( '@stdlib/complex/float32/ctor' );
+import cwxsa = require( './index' );
+
+
+// TESTS //
+
+// The function returns a Complex64Array...
+{
+ const x = new Complex64Array( 10 );
+ const w = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa( x.length, alpha, x, 1, w, 1 ); // $ExpectType Complex64Array
+}
+
+// The compiler throws an error if the function is provided a first argument which is not a number...
+{
+ const x = new Complex64Array( 10 );
+ const w = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa( '10', alpha, x, 1, w, 1 ); // $ExpectError
+ cwxsa( true, alpha, x, 1, w, 1 ); // $ExpectError
+ cwxsa( false, alpha, x, 1, w, 1 ); // $ExpectError
+ cwxsa( null, alpha, x, 1, w, 1 ); // $ExpectError
+ cwxsa( undefined, alpha, x, 1, w, 1 ); // $ExpectError
+ cwxsa( [], alpha, x, 1, w, 1 ); // $ExpectError
+ cwxsa( {}, alpha, x, 1, w, 1 ); // $ExpectError
+ cwxsa( ( x: number ): number => x, alpha, x, 1, w, 1 ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a second argument which is not a complex-like...
+{
+ const x = new Complex64Array( 10 );
+ const w = new Complex64Array( 10 );
+
+ cwxsa( x.length, 10, x, 1, w, 1 ); // $ExpectError
+ cwxsa( x.length, '10', x, 1, w, 1 ); // $ExpectError
+ cwxsa( x.length, true, x, 1, w, 1 ); // $ExpectError
+ cwxsa( x.length, false, x, 1, w, 1 ); // $ExpectError
+ cwxsa( x.length, null, x, 1, w, 1 ); // $ExpectError
+ cwxsa( x.length, undefined, x, 1, w, 1 ); // $ExpectError
+ cwxsa( x.length, [], x, 1, w, 1 ); // $ExpectError
+ cwxsa( x.length, {}, x, 1, w, 1 ); // $ExpectError
+ cwxsa( x.length, ( x: number ): number => x, x, 1, w, 1 ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a third argument which is not a Complex64Array...
+{
+ const w = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa( 10, alpha, 10, 1, w, 1 ); // $ExpectError
+ cwxsa( 10, alpha, '10', 1, w, 1 ); // $ExpectError
+ cwxsa( 10, alpha, true, 1, w, 1 ); // $ExpectError
+ cwxsa( 10, alpha, false, 1, w, 1 ); // $ExpectError
+ cwxsa( 10, alpha, null, 1, w, 1 ); // $ExpectError
+ cwxsa( 10, alpha, undefined, 1, w, 1 ); // $ExpectError
+ cwxsa( 10, alpha, [ '1' ], 1, w, 1 ); // $ExpectError
+ cwxsa( 10, alpha, {}, 1, w, 1 ); // $ExpectError
+ cwxsa( 10, alpha, ( x: number ): number => x, 1, w, 1 ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a fourth argument which is not a number...
+{
+ const x = new Complex64Array( 10 );
+ const w = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa( x.length, alpha, x, '10', w, 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, true, w, 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, false, w, 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, null, w, 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, undefined, w, 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, [], w, 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, {}, w, 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, ( x: number ): number => x, w, 1 ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a fifth argument which is not a Complex64Array...
+{
+ const x = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa( x.length, alpha, x, 1, 10, 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, '10', 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, true, 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, false, 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, null, 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, undefined, 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, [ '1' ], 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, {}, 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, ( x: number ): number => x, 1 ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a sixth argument which is not a number...
+{
+ const x = new Complex64Array( 10 );
+ const w = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa( x.length, alpha, x, 1, w, '10' ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, w, true ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, w, false ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, w, null ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, w, undefined ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, w, [] ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, w, {} ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, w, ( x: number ): number => x ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ const x = new Complex64Array( 10 );
+ const w = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa(); // $ExpectError
+ cwxsa( x.length ); // $ExpectError
+ cwxsa( x.length, alpha ); // $ExpectError
+ cwxsa( x.length, alpha, x ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1 ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, w ); // $ExpectError
+ cwxsa( x.length, alpha, x, 1, w, 1, 10 ); // $ExpectError
+}
+
+// Attached to main export is an `ndarray` method which returns a Complex64Array...
+{
+ const x = new Complex64Array( 10 );
+ const w = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1, 0 ); // $ExpectType Complex64Array
+}
+
+// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
+{
+ const x = new Complex64Array( 10 );
+ const w = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa.ndarray( '10', alpha, x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( true, alpha, x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( false, alpha, x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( null, alpha, x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( undefined, alpha, x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( [], alpha, x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( {}, alpha, x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( ( x: number ): number => x, alpha, x, 1, 0, w, 1, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided a second argument which is not a complex-like...
+{
+ const x = new Complex64Array( 10 );
+ const w = new Complex64Array( 10 );
+
+ cwxsa.ndarray( x.length, 10, x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, '10', x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, true, x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, false, x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, null, x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, undefined, x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, [], x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, {}, x, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, ( x: number ): number => x, x, 1, 0, w, 1, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided a third argument which is not a Complex64Array...
+{
+ const w = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa.ndarray( 10, alpha, 10, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( 10, alpha, '10', 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( 10, alpha, true, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( 10, alpha, false, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( 10, alpha, null, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( 10, alpha, undefined, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( 10, alpha, [ '1' ], 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( 10, alpha, {}, 1, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( 10, alpha, ( x: number ): number => x, 1, 0, w, 1, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number...
+{
+ const x = new Complex64Array( 10 );
+ const w = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa.ndarray( x.length, alpha, x, '10', 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, true, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, false, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, null, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, undefined, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, [], 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, {}, 0, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, ( x: number ): number => x, 0, w, 1, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a number...
+{
+ const x = new Complex64Array( 10 );
+ const w = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa.ndarray( x.length, alpha, x, 1, '10', w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, true, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, false, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, null, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, undefined, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, [], w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, {}, w, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, ( x: number ): number => x, w, 1, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a Complex64Array...
+{
+ const x = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, 10, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, '10', 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, true, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, false, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, null, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, undefined, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, [ '1' ], 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, {}, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a number...
+{
+ const x = new Complex64Array( 10 );
+ const w = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, '10', 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, true, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, false, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, null, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, undefined, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, [], 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, {}, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, ( x: number ): number => x, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided an eighth argument which is not a number...
+{
+ const x = new Complex64Array( 10 );
+ const w = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1, '10' ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1, true ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1, false ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1, null ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1, undefined ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1, [] ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1, {} ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1, ( x: number ): number => x ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments...
+{
+ const x = new Complex64Array( 10 );
+ const w = new Complex64Array( 10 );
+ const alpha = new Complex64( 5.0, 3.0 );
+
+ cwxsa.ndarray(); // $ExpectError
+ cwxsa.ndarray( x.length ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1 ); // $ExpectError
+ cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1, 0, 10 ); // $ExpectError
+}
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/examples/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/examples/c/Makefile
new file mode 100644
index 000000000000..c8f8e9a1517b
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/examples/c/Makefile
@@ -0,0 +1,146 @@
+#/
+# @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.
+#/
+
+# VARIABLES #
+
+ifndef VERBOSE
+ QUIET := @
+else
+ QUIET :=
+endif
+
+# Determine the OS ([1][1], [2][2]).
+#
+# [1]: https://en.wikipedia.org/wiki/Uname#Examples
+# [2]: http://stackoverflow.com/a/27776822/2225624
+OS ?= $(shell uname)
+ifneq (, $(findstring MINGW,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring MSYS,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring CYGWIN,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring Windows_NT,$(OS)))
+ OS := WINNT
+endif
+endif
+endif
+endif
+
+# Define the program used for compiling C source files:
+ifdef C_COMPILER
+ CC := $(C_COMPILER)
+else
+ CC := gcc
+endif
+
+# Define the command-line options when compiling C files:
+CFLAGS ?= \
+ -std=c99 \
+ -O3 \
+ -Wall \
+ -pedantic
+
+# Determine whether to generate position independent code ([1][1], [2][2]).
+#
+# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options
+# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option
+ifeq ($(OS), WINNT)
+ fPIC ?=
+else
+ fPIC ?= -fPIC
+endif
+
+# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`):
+INCLUDE ?=
+
+# List of source files:
+SOURCE_FILES ?=
+
+# List of libraries (e.g., `-lopenblas -lpthread`):
+LIBRARIES ?=
+
+# List of library paths (e.g., `-L /foo/bar -L /beep/boop`):
+LIBPATH ?=
+
+# List of C targets:
+c_targets := example.out
+
+
+# RULES #
+
+#/
+# Compiles source files.
+#
+# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`)
+# @param {string} [CFLAGS] - C compiler options
+# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`)
+# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`)
+# @param {string} [SOURCE_FILES] - list of source files
+# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`)
+# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`)
+#
+# @example
+# make
+#
+# @example
+# make all
+#/
+all: $(c_targets)
+
+.PHONY: all
+
+#/
+# Compiles C source files.
+#
+# @private
+# @param {string} CC - C compiler (e.g., `gcc`)
+# @param {string} CFLAGS - C compiler options
+# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`)
+# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`)
+# @param {string} SOURCE_FILES - list of source files
+# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`)
+# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`)
+#/
+$(c_targets): %.out: %.c
+ $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES)
+
+#/
+# Runs compiled examples.
+#
+# @example
+# make run
+#/
+run: $(c_targets)
+ $(QUIET) ./$<
+
+.PHONY: run
+
+#/
+# Removes generated files.
+#
+# @example
+# make clean
+#/
+clean:
+ $(QUIET) -rm -f *.o *.out
+
+.PHONY: clean
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/examples/c/example.c
new file mode 100644
index 000000000000..a1fc5de00c32
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/examples/c/example.c
@@ -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.
+*/
+
+#include "stdlib/blas/ext/base/cwxsa.h"
+#include "stdlib/complex/float32/ctor.h"
+#include "stdlib/complex/float32/real.h"
+#include "stdlib/complex/float32/imag.h"
+#include
+
+int main( void ) {
+ // Create strided arrays:
+ const stdlib_complex64_t x[] = {
+ stdlib_complex64( 1.0f, 2.0f ),
+ stdlib_complex64( 3.0f, 4.0f ),
+ stdlib_complex64( 5.0f, 6.0f ),
+ stdlib_complex64( 7.0f, 8.0f )
+ };
+ stdlib_complex64_t w[] = {
+ stdlib_complex64( 0.0f, 0.0f ),
+ stdlib_complex64( 0.0f, 0.0f ),
+ stdlib_complex64( 0.0f, 0.0f ),
+ stdlib_complex64( 0.0f, 0.0f )
+ };
+
+ // Specify the number of indexed elements:
+ const int N = 4;
+
+ // Specify strides:
+ const int strideX = 1;
+ const int strideW = 1;
+
+ // Define a scalar constant:
+ stdlib_complex64_t alpha = stdlib_complex64( 5.0f, 3.0f );
+
+ // Subtract a constant from each element in `x` and assign to `w`:
+ stdlib_strided_cwxsa( N, alpha, x, strideX, w, strideW );
+
+ // Print the result:
+ for ( int i = 0; i < N; i++ ) {
+ printf( "w[ %i ] = %f + %fi\n", i, stdlib_complex64_real( w[ i ] ), stdlib_complex64_imag( w[ i ] ) );
+ }
+}
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/examples/index.js
new file mode 100644
index 000000000000..5da8ae3d0e3a
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/examples/index.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';
+
+var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+var logEach = require( '@stdlib/console/log-each' );
+var cwxsa = require( './../lib' );
+
+var xbuf = discreteUniform( 20, -100, 100, {
+ 'dtype': 'float32'
+});
+var wbuf = discreteUniform( 20, -100, 100, {
+ 'dtype': 'float32'
+});
+var x = new Complex64Array( xbuf.buffer );
+var w = new Complex64Array( wbuf.buffer );
+var alpha = new Complex64( 5.0, 3.0 );
+
+cwxsa( x.length, alpha, x, 1, w, 1 );
+logEach( '%s', w );
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/include.gypi b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/include.gypi
new file mode 100644
index 000000000000..bee8d41a2caf
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/include.gypi
@@ -0,0 +1,53 @@
+# @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.
+
+# A GYP include file for building a Node.js native add-on.
+#
+# Main documentation:
+#
+# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md
+# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md
+{
+ # Define variables to be used throughout the configuration for all targets:
+ 'variables': {
+ # Source directory:
+ 'src_dir': './src',
+
+ # Include directories:
+ 'include_dirs': [
+ ' [ -4.0, -1.0, -2.0, 1.0, 0.0, 3.0 ]
+*/
+function cwxsa( N, alpha, x, strideX, w, strideW ) {
+ return ndarray( N, alpha, x, strideX, stride2offset( N, strideX ), w, strideW, stride2offset( N, strideW ) ); // eslint-disable-line max-len
+}
+
+
+// EXPORTS //
+
+module.exports = cwxsa;
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/cwxsa.native.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/cwxsa.native.js
new file mode 100644
index 000000000000..4788bac45330
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/cwxsa.native.js
@@ -0,0 +1,61 @@
+/**
+* @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 reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' );
+var addon = require( './../src/addon.node' );
+
+
+// MAIN //
+
+/**
+* Subtracts a scalar constant from each element in a single-precision complex floating-point strided array `x` and assigns the results to elements in a single-precision complex floating-point strided array `w`.
+*
+* @param {PositiveInteger} N - number of indexed elements
+* @param {Complex64} alpha - scalar constant
+* @param {Complex64Array} x - input array
+* @param {integer} strideX - `x` stride length
+* @param {Complex64Array} w - output array
+* @param {integer} strideW - `w` stride length
+* @returns {Complex64Array} output array
+*
+* @example
+* var Complex64Array = require( '@stdlib/array/complex64' );
+* var Complex64 = require( '@stdlib/complex/float32/ctor' );
+*
+* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+* var w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+* var alpha = new Complex64( 5.0, 3.0 );
+*
+* cwxsa( x.length, alpha, x, 1, w, 1 );
+* // w => [ -4.0, -1.0, -2.0, 1.0, 0.0, 3.0 ]
+*/
+function cwxsa( N, alpha, x, strideX, w, strideW ) {
+ var viewX = reinterpret( x, 0 );
+ var viewW = reinterpret( w, 0 );
+ addon( N, alpha, viewX, strideX, viewW, strideW );
+ return w;
+}
+
+
+// EXPORTS //
+
+module.exports = cwxsa;
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/index.js
new file mode 100644
index 000000000000..80faf40f3fd3
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/index.js
@@ -0,0 +1,74 @@
+/**
+* @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';
+
+/**
+* Subtract a scalar constant from each element in a single-precision complex floating-point strided array `x` and assign the results to elements in a single-precision complex floating-point strided array `w`.
+*
+* @module @stdlib/blas/ext/base/cwxsa
+*
+* @example
+* var Complex64Array = require( '@stdlib/array/complex64' );
+* var Complex64 = require( '@stdlib/complex/float32/ctor' );
+* var cwxsa = require( '@stdlib/blas/ext/base/cwxsa' );
+*
+* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
+* var w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+* var alpha = new Complex64( 2.0, 2.0 );
+*
+* cwxsa( x.length, alpha, x, 1, w, 1 );
+* // w => [ -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
+*
+* @example
+* var Complex64Array = require( '@stdlib/array/complex64' );
+* var Complex64 = require( '@stdlib/complex/float32/ctor' );
+* var cwxsa = require( '@stdlib/blas/ext/base/cwxsa' );
+*
+* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
+* var w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+* var alpha = new Complex64( 2.0, 2.0 );
+*
+* cwxsa.ndarray( x.length, alpha, x, 1, 0, w, 1, 0 );
+* // w => [ -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
+*/
+
+// MODULES //
+
+var join = require( 'path' ).join;
+var tryRequire = require( '@stdlib/utils/try-require' );
+var isError = require( '@stdlib/assert/is-error' );
+var main = require( './main.js' );
+
+
+// MAIN //
+
+var cwxsa;
+var tmp = tryRequire( join( __dirname, './native.js' ) );
+if ( isError( tmp ) ) {
+ cwxsa = main;
+} else {
+ cwxsa = tmp;
+}
+
+
+// EXPORTS //
+
+module.exports = cwxsa;
+
+// exports: { "ndarray": "cwxsa.ndarray" }
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/main.js
new file mode 100644
index 000000000000..f4bd0aaf235c
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/main.js
@@ -0,0 +1,35 @@
+/**
+* @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 setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
+var cwxsa = require( './cwxsa.js' );
+var ndarray = require( './ndarray.js' );
+
+
+// MAIN //
+
+setReadOnly( cwxsa, 'ndarray', ndarray );
+
+
+// EXPORTS //
+
+module.exports = cwxsa;
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/native.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/native.js
new file mode 100644
index 000000000000..a6e12bf24384
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/native.js
@@ -0,0 +1,35 @@
+/**
+* @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 setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
+var cwxsa = require( './cwxsa.native.js' );
+var ndarray = require( './ndarray.native.js' );
+
+
+// MAIN //
+
+setReadOnly( cwxsa, 'ndarray', ndarray );
+
+
+// EXPORTS //
+
+module.exports = cwxsa;
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/ndarray.js
new file mode 100644
index 000000000000..b04330ec82e5
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/ndarray.js
@@ -0,0 +1,139 @@
+/**
+* @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 reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' );
+var realf = require( '@stdlib/complex/float32/real' );
+var imagf = require( '@stdlib/complex/float32/imag' );
+var ccopy = require( '@stdlib/blas/base/ccopy' ).ndarray;
+
+
+// VARIABLES //
+
+var M = 5;
+
+
+// MAIN //
+
+/**
+* Subtracts a scalar constant from each element in a single-precision complex floating-point strided array `x` and assigns the results to elements in a single-precision complex floating-point strided array `w` using alternative indexing semantics.
+*
+* @param {PositiveInteger} N - number of indexed elements
+* @param {Complex64} alpha - scalar constant
+* @param {Complex64Array} x - input array
+* @param {integer} strideX - `x` stride length
+* @param {NonNegativeInteger} offsetX - starting `x` index
+* @param {Complex64Array} w - output array
+* @param {integer} strideW - `w` stride length
+* @param {NonNegativeInteger} offsetW - starting `w` index
+* @returns {Complex64Array} output array
+*
+* @example
+* var Complex64Array = require( '@stdlib/array/complex64' );
+* var Complex64 = require( '@stdlib/complex/float32/ctor' );
+*
+* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+* var w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+* var alpha = new Complex64( 5.0, 3.0 );
+*
+* cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+* // w => [ -4.0, -1.0, -2.0, 1.0, 0.0, 3.0 ]
+*/
+function cwxsa( N, alpha, x, strideX, offsetX, w, strideW, offsetW ) {
+ var xview;
+ var wview;
+ var are;
+ var aim;
+ var ix;
+ var iw;
+ var sx;
+ var sw;
+ var m;
+ var i;
+
+ if ( N <= 0 ) {
+ return w;
+ }
+
+ // Decompose the constant into its real and imaginary components:
+ are = realf( alpha );
+ aim = imagf( alpha );
+
+ // Fast path: when alpha = 0+0i, delegate to ccopy (w = x)
+ if ( are === 0.0 && aim === 0.0 ) {
+ return ccopy( N, x, strideX, offsetX, w, strideW, offsetW );
+ }
+
+ // Reinterpret the complex input arrays as real-valued arrays:
+ xview = reinterpret( x, 0 );
+ wview = reinterpret( w, 0 );
+
+ // Adjust the strides and offsets according to the real-valued arrays:
+ ix = offsetX * 2;
+ iw = offsetW * 2;
+ sx = strideX * 2;
+ sw = strideW * 2;
+
+ // Use loop unrolling if both strides are equal to `1`...
+ if ( strideX === 1 && strideW === 1 ) {
+ m = N % M;
+
+ // If we have a remainder, run a clean-up loop...
+ if ( m > 0 ) {
+ for ( i = 0; i < m; i++ ) {
+ wview[ iw ] = xview[ ix ] - are;
+ wview[ iw+1 ] = xview[ ix+1 ] - aim;
+ ix += sx;
+ iw += sw;
+ }
+ }
+ if ( N < M ) {
+ return w;
+ }
+ for ( i = m; i < N; i += M ) {
+ wview[ iw ] = xview[ ix ] - are;
+ wview[ iw+1 ] = xview[ ix+1 ] - aim;
+ wview[ iw+2 ] = xview[ ix+2 ] - are;
+ wview[ iw+3 ] = xview[ ix+3 ] - aim;
+ wview[ iw+4 ] = xview[ ix+4 ] - are;
+ wview[ iw+5 ] = xview[ ix+5 ] - aim;
+ wview[ iw+6 ] = xview[ ix+6 ] - are;
+ wview[ iw+7 ] = xview[ ix+7 ] - aim;
+ wview[ iw+8 ] = xview[ ix+8 ] - are;
+ wview[ iw+9 ] = xview[ ix+9 ] - aim;
+ ix += M * 2;
+ iw += M * 2;
+ }
+ return w;
+ }
+ for ( i = 0; i < N; i++ ) {
+ wview[ iw ] = xview[ ix ] - are;
+ wview[ iw+1 ] = xview[ ix+1 ] - aim;
+ ix += sx;
+ iw += sw;
+ }
+ return w;
+}
+
+
+// EXPORTS //
+
+module.exports = cwxsa;
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/ndarray.native.js
new file mode 100644
index 000000000000..34e7e2e962ce
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/lib/ndarray.native.js
@@ -0,0 +1,63 @@
+/**
+* @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 reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' );
+var addon = require( './../src/addon.node' );
+
+
+// MAIN //
+
+/**
+* Subtracts a scalar constant from each element in a single-precision complex floating-point strided array `x` and assigns the results to elements in a single-precision complex floating-point strided array `w` using alternative indexing semantics.
+*
+* @param {PositiveInteger} N - number of indexed elements
+* @param {Complex64} alpha - scalar constant
+* @param {Complex64Array} x - input array
+* @param {integer} strideX - `x` stride length
+* @param {NonNegativeInteger} offsetX - starting `x` index
+* @param {Complex64Array} w - output array
+* @param {integer} strideW - `w` stride length
+* @param {NonNegativeInteger} offsetW - starting `w` index
+* @returns {Complex64Array} output array
+*
+* @example
+* var Complex64Array = require( '@stdlib/array/complex64' );
+* var Complex64 = require( '@stdlib/complex/float32/ctor' );
+*
+* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+* var w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+* var alpha = new Complex64( 5.0, 3.0 );
+*
+* cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+* // w => [ -4.0, -1.0, -2.0, 1.0, 0.0, 3.0 ]
+*/
+function cwxsa( N, alpha, x, strideX, offsetX, w, strideW, offsetW ) {
+ var viewX = reinterpret( x, 0 );
+ var viewW = reinterpret( w, 0 );
+ addon.ndarray( N, alpha, viewX, strideX, offsetX, viewW, strideW, offsetW );
+ return w;
+}
+
+
+// EXPORTS //
+
+module.exports = cwxsa;
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/manifest.json
new file mode 100644
index 000000000000..a135f1b5a01f
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/manifest.json
@@ -0,0 +1,94 @@
+{
+ "options": {
+ "task": "build"
+ },
+ "fields": [
+ {
+ "field": "src",
+ "resolve": true,
+ "relative": true
+ },
+ {
+ "field": "include",
+ "resolve": true,
+ "relative": true
+ },
+ {
+ "field": "libraries",
+ "resolve": false,
+ "relative": false
+ },
+ {
+ "field": "libpath",
+ "resolve": true,
+ "relative": false
+ }
+ ],
+ "confs": [
+ {
+ "task": "build",
+ "src": [
+ "./src/main.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/blas/base/ccopy",
+ "@stdlib/complex/float32/base/sub",
+ "@stdlib/complex/float32/real",
+ "@stdlib/complex/float32/imag",
+ "@stdlib/complex/float32/ctor",
+ "@stdlib/strided/base/stride2offset",
+ "@stdlib/napi/export",
+ "@stdlib/napi/argv",
+ "@stdlib/napi/argv-complex64",
+ "@stdlib/napi/argv-int64",
+ "@stdlib/napi/argv-strided-complex64array"
+ ]
+ },
+ {
+ "task": "benchmark",
+ "src": [
+ "./src/main.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/blas/base/ccopy",
+ "@stdlib/complex/float32/base/sub",
+ "@stdlib/complex/float32/real",
+ "@stdlib/complex/float32/imag",
+ "@stdlib/complex/float32/ctor",
+ "@stdlib/strided/base/stride2offset"
+ ]
+ },
+ {
+ "task": "examples",
+ "src": [
+ "./src/main.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/blas/base/ccopy",
+ "@stdlib/complex/float32/base/sub",
+ "@stdlib/complex/float32/real",
+ "@stdlib/complex/float32/imag",
+ "@stdlib/complex/float32/ctor",
+ "@stdlib/strided/base/stride2offset"
+ ]
+ }
+ ]
+}
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/package.json b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/package.json
new file mode 100644
index 000000000000..a5fee4068cd0
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/package.json
@@ -0,0 +1,78 @@
+{
+ "name": "@stdlib/blas/ext/base/cwxsa",
+ "version": "0.0.0",
+ "description": "Subtract a scalar constant from each element in a single-precision complex floating-point strided array `x` and assign the results to elements in a single-precision complex floating-point strided array `w`.",
+ "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",
+ "browser": "./lib/main.js",
+ "gypfile": true,
+ "directories": {
+ "benchmark": "./benchmark",
+ "doc": "./docs",
+ "example": "./examples",
+ "include": "./include",
+ "lib": "./lib",
+ "src": "./src",
+ "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",
+ "subtract",
+ "subtraction",
+ "scale",
+ "translate",
+ "strided",
+ "array",
+ "ndarray",
+ "cwxsa",
+ "complex",
+ "complex64",
+ "complex64array",
+ "float32"
+ ],
+ "__stdlib__": {
+ "wasm": false
+ }
+}
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/src/Makefile b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/src/Makefile
new file mode 100644
index 000000000000..2caf905cedbe
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/src/Makefile
@@ -0,0 +1,70 @@
+#/
+# @license Apache-2.0
+#
+# Copyright (c) 2026 The Stdlib Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#/
+
+# VARIABLES #
+
+ifndef VERBOSE
+ QUIET := @
+else
+ QUIET :=
+endif
+
+# Determine the OS ([1][1], [2][2]).
+#
+# [1]: https://en.wikipedia.org/wiki/Uname#Examples
+# [2]: http://stackoverflow.com/a/27776822/2225624
+OS ?= $(shell uname)
+ifneq (, $(findstring MINGW,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring MSYS,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring CYGWIN,$(OS)))
+ OS := WINNT
+else
+ifneq (, $(findstring Windows_NT,$(OS)))
+ OS := WINNT
+endif
+endif
+endif
+endif
+
+
+# RULES #
+
+#/
+# Removes generated files for building an add-on.
+#
+# @example
+# make clean-addon
+#/
+clean-addon:
+ $(QUIET) -rm -f *.o *.node
+
+.PHONY: clean-addon
+
+#/
+# Removes generated files.
+#
+# @example
+# make clean
+#/
+clean: clean-addon
+
+.PHONY: clean
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/src/addon.c
new file mode 100644
index 000000000000..dc0ba0b1a82e
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/src/addon.c
@@ -0,0 +1,69 @@
+/**
+* @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.
+*/
+
+#include "stdlib/blas/ext/base/cwxsa.h"
+#include "stdlib/blas/base/shared.h"
+#include "stdlib/napi/export.h"
+#include "stdlib/napi/argv.h"
+#include "stdlib/napi/argv_complex64.h"
+#include "stdlib/napi/argv_int64.h"
+#include "stdlib/napi/argv_strided_complex64array.h"
+#include "stdlib/complex/float32/ctor.h"
+#include
+
+/**
+* Receives JavaScript callback invocation data.
+*
+* @param env environment under which the function is invoked
+* @param info callback data
+* @return Node-API value
+*/
+static napi_value addon( napi_env env, napi_callback_info info ) {
+ STDLIB_NAPI_ARGV( env, info, argv, argc, 6 );
+ STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
+ STDLIB_NAPI_ARGV_COMPLEX64( env, alpha, argv, 1 );
+ STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 );
+ STDLIB_NAPI_ARGV_INT64( env, strideW, argv, 5 );
+ STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 2 );
+ STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, W, N, strideW, argv, 4 );
+ API_SUFFIX(stdlib_strided_cwxsa)( N, alpha, (const stdlib_complex64_t *)X, strideX, (stdlib_complex64_t *)W, strideW );
+ return NULL;
+}
+
+/**
+* Receives JavaScript callback invocation data.
+*
+* @param env environment under which the function is invoked
+* @param info callback data
+* @return Node-API value
+*/
+static napi_value addon_method( napi_env env, napi_callback_info info ) {
+ STDLIB_NAPI_ARGV( env, info, argv, argc, 8 );
+ STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
+ STDLIB_NAPI_ARGV_COMPLEX64( env, alpha, argv, 1 );
+ STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 );
+ STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 4 );
+ STDLIB_NAPI_ARGV_INT64( env, strideW, argv, 6 );
+ STDLIB_NAPI_ARGV_INT64( env, offsetW, argv, 7 );
+ STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 2 );
+ STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, W, N, strideW, argv, 5 );
+ API_SUFFIX(stdlib_strided_cwxsa_ndarray)( N, alpha, (const stdlib_complex64_t *)X, strideX, offsetX, (stdlib_complex64_t *)W, strideW, offsetW );
+ return NULL;
+}
+
+STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "ndarray", addon_method )
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/src/main.c b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/src/main.c
new file mode 100644
index 000000000000..9fd3a8df36f0
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/src/main.c
@@ -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.
+*/
+
+#include "stdlib/blas/ext/base/cwxsa.h"
+#include "stdlib/blas/base/ccopy.h"
+#include "stdlib/blas/base/shared.h"
+#include "stdlib/complex/float32/real.h"
+#include "stdlib/complex/float32/imag.h"
+#include "stdlib/complex/float32/base/sub.h"
+#include "stdlib/strided/base/stride2offset.h"
+
+static const CBLAS_INT M = 5;
+
+/**
+* Subtracts a scalar constant from each element in a single-precision complex floating-point strided array `X` and assigns the results to elements in a single-precision complex floating-point strided array `W`.
+*
+* @param N number of indexed elements
+* @param alpha scalar constant
+* @param X input array
+* @param strideX stride length for `X`
+* @param W output array
+* @param strideW stride length for `W`
+*/
+void API_SUFFIX(stdlib_strided_cwxsa)( const CBLAS_INT N, const stdlib_complex64_t alpha, const stdlib_complex64_t *X, const CBLAS_INT strideX, stdlib_complex64_t *W, const CBLAS_INT strideW ) {
+ CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX );
+ CBLAS_INT ow = stdlib_strided_stride2offset( N, strideW );
+ API_SUFFIX(stdlib_strided_cwxsa_ndarray)( N, alpha, X, strideX, ox, W, strideW, ow );
+}
+
+/**
+* Subtracts a scalar constant from each element in a single-precision complex floating-point strided array `X` and assigns the results to elements in a single-precision complex floating-point strided array `W` using alternative indexing semantics.
+*
+* @param N number of indexed elements
+* @param alpha scalar constant
+* @param X input array
+* @param strideX stride length for `X`
+* @param offsetX starting index for `X`
+* @param W output array
+* @param strideW stride length for `W`
+* @param offsetW starting index for `W`
+*/
+void API_SUFFIX(stdlib_strided_cwxsa_ndarray)( const CBLAS_INT N, const stdlib_complex64_t alpha, const stdlib_complex64_t *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, stdlib_complex64_t *W, const CBLAS_INT strideW, const CBLAS_INT offsetW ) {
+ CBLAS_INT ix;
+ CBLAS_INT iw;
+ CBLAS_INT m;
+ CBLAS_INT i;
+
+ if ( N <= 0 ) {
+ return;
+ }
+ // Fast path: when alpha = 0+0i, delegate to ccopy (w = x)
+ if ( stdlib_complex64_real( alpha ) == 0.0f && stdlib_complex64_imag( alpha ) == 0.0f ) {
+ API_SUFFIX(c_ccopy_ndarray)( N, X, strideX, offsetX, W, strideW, offsetW );
+ return;
+ }
+ ix = offsetX;
+ iw = offsetW;
+
+ // Use loop unrolling if both strides are equal to `1`...
+ if ( strideX == 1 && strideW == 1 ) {
+ m = N % M;
+
+ // If we have a remainder, run a clean-up loop...
+ if ( m > 0 ) {
+ for ( i = 0; i < m; i++ ) {
+ W[ iw ] = stdlib_base_complex64_sub( X[ ix ], alpha );
+ ix += strideX;
+ iw += strideW;
+ }
+ }
+ if ( N < M ) {
+ return;
+ }
+ for ( i = m; i < N; i += M ) {
+ W[ iw ] = stdlib_base_complex64_sub( X[ ix ], alpha );
+ W[ iw+1 ] = stdlib_base_complex64_sub( X[ ix+1 ], alpha );
+ W[ iw+2 ] = stdlib_base_complex64_sub( X[ ix+2 ], alpha );
+ W[ iw+3 ] = stdlib_base_complex64_sub( X[ ix+3 ], alpha );
+ W[ iw+4 ] = stdlib_base_complex64_sub( X[ ix+4 ], alpha );
+ ix += M;
+ iw += M;
+ }
+ return;
+ }
+ for ( i = 0; i < N; i++ ) {
+ W[ iw ] = stdlib_base_complex64_sub( X[ ix ], alpha );
+ ix += strideX;
+ iw += strideW;
+ }
+ return;
+}
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.cwxsa.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.cwxsa.js
new file mode 100644
index 000000000000..0b82d3809785
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.cwxsa.js
@@ -0,0 +1,372 @@
+/**
+* @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 stdlib/empty-line-before-comment */
+
+'use strict';
+
+// MODULES //
+
+var tape = require( 'tape' );
+var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' );
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+var sub = require( '@stdlib/complex/float32/base/sub' );
+var cwxsa = require( './../lib/cwxsa.js' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof cwxsa, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function has an arity of 6', function test( t ) {
+ t.strictEqual( cwxsa.length, 6, 'has expected arity' );
+ t.end();
+});
+
+tape( 'the function subtracts a scalar constant from each element in a strided array `x` and assigns the results to elements in a strided array `w`', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 4.0,
+ 2.0,
+ -3.0,
+ 5.0,
+ -1.0,
+ 2.0,
+ -5.0,
+ 6.0
+ ]);
+ w = new Complex64Array( x.length );
+ expected = new Complex64Array([
+ // (4.0+2.0i) - (5.0+3.0i)
+ -1.0,
+ -1.0,
+ // (-3.0+5.0i) - (5.0+3.0i)
+ -8.0,
+ 2.0,
+ // (-1.0+2.0i) - (5.0+3.0i)
+ -6.0,
+ -1.0,
+ // (-5.0+6.0i) - (5.0+3.0i)
+ -10.0,
+ 3.0
+ ]);
+
+ cwxsa( x.length, alpha, x, 1, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
+ w = new Complex64Array( x.length );
+ expected = new Complex64Array([
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0
+ ]);
+
+ cwxsa( x.length, alpha, x, 1, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns a reference to the output array', function test( t ) {
+ var alpha;
+ var out;
+ var x;
+ var w;
+
+ alpha = new Complex64( 3.0, 2.0 );
+ x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 ] ); // eslint-disable-line max-len
+ w = new Complex64Array( x.length );
+ out = cwxsa( x.length, alpha, x, 1, w, 1 );
+
+ t.strictEqual( out, w, 'same reference' );
+ t.end();
+});
+
+tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `w` unchanged', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+ x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] );
+ w = new Complex64Array( [ 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] );
+ expected = new Complex64Array( [ 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] );
+
+ cwxsa( 0, alpha, x, 1, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ cwxsa( -4, alpha, x, 1, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'if `alpha` equals `0`, the function assigns `x` to `w`', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 0.0, 0.0 );
+ x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] );
+ w = new Complex64Array( x.length );
+ expected = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); // w = x
+
+ cwxsa( x.length, alpha, x, 1, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports an `x` stride', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 1.0, // 0
+ 2.0, // 0
+ 3.0,
+ 4.0,
+ 5.0, // 1
+ 6.0, // 1
+ 7.0,
+ 8.0,
+ 9.0, // 2
+ 10.0 // 2
+ ]);
+ w = new Complex64Array( 3 );
+ expected = new Complex64Array([
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0,
+ // (9.0+10.0i) - (5.0+3.0i)
+ 4.0,
+ 7.0
+ ]);
+
+ cwxsa( 3, alpha, x, 2, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports a `w` stride', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 1.0,
+ 2.0,
+ 3.0,
+ 4.0,
+ 5.0,
+ 6.0
+ ]);
+ w = new Complex64Array([
+ 0.0, // 0
+ 0.0, // 0
+ 30.0,
+ 40.0,
+ 0.0, // 1
+ 0.0, // 1
+ 10.0,
+ 20.0,
+ 0.0, // 2
+ 0.0 // 2
+ ]);
+ expected = new Complex64Array([
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ 30.0,
+ 40.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0,
+ 10.0,
+ 20.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0
+ ]);
+
+ cwxsa( 3, alpha, x, 1, w, 2 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports negative strides', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 2.0, // 2
+ 3.0, // 2
+ 4.0,
+ 5.0,
+ -5.0, // 1
+ -6.0, // 1
+ 7.0,
+ 8.0,
+ 6.0, // 0
+ 9.0 // 0
+ ]);
+ w = new Complex64Array( 5 );
+ expected = new Complex64Array([
+ // (2.0+3.0i) - (5.0+3.0i)
+ -3.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ // (-5.0-6.0i) - (5.0+3.0i)
+ -10.0,
+ -9.0,
+ 0.0,
+ 0.0,
+ // (6.0+9.0i) - (5.0+3.0i)
+ 1.0,
+ 6.0
+ ]);
+
+ cwxsa( 3, alpha, x, -2, w, -2 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports view offsets', function test( t ) {
+ var expected;
+ var alpha;
+ var x0;
+ var w0;
+ var x1;
+ var w1;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x0 = new Complex64Array([
+ 1.0,
+ 2.0,
+ 3.0, // 0
+ 4.0, // 0
+ 5.0, // 1
+ 6.0, // 1
+ 7.0, // 2
+ 8.0, // 2
+ 9.0,
+ 10.0
+ ]);
+ w0 = new Complex64Array([
+ 10.0,
+ 11.0,
+ 12.0,
+ 13.0,
+ 0.0, // 0
+ 0.0, // 0
+ 0.0, // 1
+ 0.0, // 1
+ 0.0, // 2
+ 0.0 // 2
+ ]);
+
+ x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
+ w1 = new Complex64Array( w0.buffer, w0.BYTES_PER_ELEMENT*2 );
+
+ expected = new Complex64Array([
+ 10.0,
+ 11.0,
+ 12.0,
+ 13.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0,
+ // (7.0+8.0i) - (5.0+3.0i)
+ 2.0,
+ 5.0
+ ]);
+
+ cwxsa( 3, alpha, x1, 1, w1, 1 );
+ t.strictEqual( isSameComplex64Array( w0, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'if both strides are equal to `1`, the function efficiently subtracts a constant from each element of a strided array', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+ var z;
+ var i;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array( 100 );
+ w = new Complex64Array( 100 );
+ expected = new Complex64Array( x.length );
+ for ( i = 0; i < x.length; i++ ) {
+ z = new Complex64( i, i + 1 );
+ x.set( z, i );
+ expected.set( sub( z, alpha ), i );
+ }
+ cwxsa( x.length, alpha, x, 1, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ x = new Complex64Array( 240 );
+ w = new Complex64Array( 240 );
+ expected = new Complex64Array( x.length );
+ for ( i = 0; i < x.length; i++ ) {
+ z = new Complex64( i, i + 1 );
+ x.set( z, i );
+ expected.set( sub( z, alpha ), i );
+ }
+ cwxsa( x.length, alpha, x, 1, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ t.end();
+});
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.cwxsa.native.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.cwxsa.native.js
new file mode 100644
index 000000000000..d53fc582dc0c
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.cwxsa.native.js
@@ -0,0 +1,381 @@
+/**
+* @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 stdlib/empty-line-before-comment */
+
+'use strict';
+
+// MODULES //
+
+var resolve = require( 'path' ).resolve;
+var tape = require( 'tape' );
+var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' );
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+var sub = require( '@stdlib/complex/float32/base/sub' );
+var tryRequire = require( '@stdlib/utils/try-require' );
+
+
+// VARIABLES //
+
+var cwxsa = tryRequire( resolve( __dirname, './../lib/cwxsa.native.js' ) );
+var opts = {
+ 'skip': ( cwxsa instanceof Error )
+};
+
+
+// TESTS //
+
+tape( 'main export is a function', opts, function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof cwxsa, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function has an arity of 6', opts, function test( t ) {
+ t.strictEqual( cwxsa.length, 6, 'has expected arity' );
+ t.end();
+});
+
+tape( 'the function subtracts a scalar constant from each element in a strided array `x` and assigns the results to elements in a strided array `w`', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 4.0,
+ 2.0,
+ -3.0,
+ 5.0,
+ -1.0,
+ 2.0,
+ -5.0,
+ 6.0
+ ]);
+ w = new Complex64Array( x.length );
+ expected = new Complex64Array([
+ // (4.0+2.0i) - (5.0+3.0i)
+ -1.0,
+ -1.0,
+ // (-3.0+5.0i) - (5.0+3.0i)
+ -8.0,
+ 2.0,
+ // (-1.0+2.0i) - (5.0+3.0i)
+ -6.0,
+ -1.0,
+ // (-5.0+6.0i) - (5.0+3.0i)
+ -10.0,
+ 3.0
+ ]);
+
+ cwxsa( x.length, alpha, x, 1, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
+ w = new Complex64Array( x.length );
+ expected = new Complex64Array([
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0
+ ]);
+
+ cwxsa( x.length, alpha, x, 1, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns a reference to the output array', opts, function test( t ) {
+ var alpha;
+ var out;
+ var x;
+ var w;
+
+ alpha = new Complex64( 3.0, 2.0 );
+ x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 ] ); // eslint-disable-line max-len
+ w = new Complex64Array( x.length );
+ out = cwxsa( x.length, alpha, x, 1, w, 1 );
+
+ t.strictEqual( out, w, 'same reference' );
+ t.end();
+});
+
+tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `w` unchanged', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+ x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] );
+ w = new Complex64Array( [ 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] );
+ expected = new Complex64Array( [ 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] );
+
+ cwxsa( 0, alpha, x, 1, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ cwxsa( -4, alpha, x, 1, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'if `alpha` equals `0`, the function assigns `x` to `w`', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 0.0, 0.0 );
+ x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] );
+ w = new Complex64Array( x.length );
+ expected = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); // w = x
+
+ cwxsa( x.length, alpha, x, 1, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports an `x` stride', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 1.0, // 0
+ 2.0, // 0
+ 3.0,
+ 4.0,
+ 5.0, // 1
+ 6.0, // 1
+ 7.0,
+ 8.0,
+ 9.0, // 2
+ 10.0 // 2
+ ]);
+ w = new Complex64Array( 3 );
+ expected = new Complex64Array([
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0,
+ // (9.0+10.0i) - (5.0+3.0i)
+ 4.0,
+ 7.0
+ ]);
+
+ cwxsa( 3, alpha, x, 2, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports a `w` stride', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 1.0,
+ 2.0,
+ 3.0,
+ 4.0,
+ 5.0,
+ 6.0
+ ]);
+ w = new Complex64Array([
+ 0.0, // 0
+ 0.0, // 0
+ 30.0,
+ 40.0,
+ 0.0, // 1
+ 0.0, // 1
+ 10.0,
+ 20.0,
+ 0.0, // 2
+ 0.0 // 2
+ ]);
+ expected = new Complex64Array([
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ 30.0,
+ 40.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0,
+ 10.0,
+ 20.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0
+ ]);
+
+ cwxsa( 3, alpha, x, 1, w, 2 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports negative strides', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 2.0, // 2
+ 3.0, // 2
+ 4.0,
+ 5.0,
+ -5.0, // 1
+ -6.0, // 1
+ 7.0,
+ 8.0,
+ 6.0, // 0
+ 9.0 // 0
+ ]);
+ w = new Complex64Array( 5 );
+ expected = new Complex64Array([
+ // (2.0+3.0i) - (5.0+3.0i)
+ -3.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ // (-5.0-6.0i) - (5.0+3.0i)
+ -10.0,
+ -9.0,
+ 0.0,
+ 0.0,
+ // (6.0+9.0i) - (5.0+3.0i)
+ 1.0,
+ 6.0
+ ]);
+
+ cwxsa( 3, alpha, x, -2, w, -2 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports view offsets', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x0;
+ var w0;
+ var x1;
+ var w1;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x0 = new Complex64Array([
+ 1.0,
+ 2.0,
+ 3.0, // 0
+ 4.0, // 0
+ 5.0, // 1
+ 6.0, // 1
+ 7.0, // 2
+ 8.0, // 2
+ 9.0,
+ 10.0
+ ]);
+ w0 = new Complex64Array([
+ 10.0,
+ 11.0,
+ 12.0,
+ 13.0,
+ 0.0, // 0
+ 0.0, // 0
+ 0.0, // 1
+ 0.0, // 1
+ 0.0, // 2
+ 0.0 // 2
+ ]);
+
+ x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
+ w1 = new Complex64Array( w0.buffer, w0.BYTES_PER_ELEMENT*2 );
+
+ expected = new Complex64Array([
+ 10.0,
+ 11.0,
+ 12.0,
+ 13.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0,
+ // (7.0+8.0i) - (5.0+3.0i)
+ 2.0,
+ 5.0
+ ]);
+
+ cwxsa( 3, alpha, x1, 1, w1, 1 );
+ t.strictEqual( isSameComplex64Array( w0, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'if both strides are equal to `1`, the function efficiently subtracts a constant from each element of a strided array', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+ var z;
+ var i;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array( 100 );
+ w = new Complex64Array( 100 );
+ expected = new Complex64Array( x.length );
+ for ( i = 0; i < x.length; i++ ) {
+ z = new Complex64( i, i + 1 );
+ x.set( z, i );
+ expected.set( sub( z, alpha ), i );
+ }
+ cwxsa( x.length, alpha, x, 1, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ x = new Complex64Array( 240 );
+ w = new Complex64Array( 240 );
+ expected = new Complex64Array( x.length );
+ for ( i = 0; i < x.length; i++ ) {
+ z = new Complex64( i, i + 1 );
+ x.set( z, i );
+ expected.set( sub( z, alpha ), i );
+ }
+ cwxsa( x.length, alpha, x, 1, w, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ t.end();
+});
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.js
new file mode 100644
index 000000000000..4bca9cb26092
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.js
@@ -0,0 +1,77 @@
+/**
+* @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 proxyquire = require( 'proxyquire' );
+var IS_BROWSER = require( '@stdlib/assert/is-browser' );
+var cwxsa = require( './../lib' );
+
+
+// VARIABLES //
+
+var opts = {
+ 'skip': IS_BROWSER
+};
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof cwxsa, '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 cwxsa.ndarray, 'function', 'method is a function' );
+ t.end();
+});
+
+tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) {
+ var cwxsa = proxyquire( './../lib', {
+ '@stdlib/utils/try-require': tryRequire
+ });
+
+ t.strictEqual( cwxsa, mock, 'returns native implementation' );
+ t.end();
+
+ function tryRequire() {
+ return mock;
+ }
+
+ function mock() {
+ // Mock...
+ }
+});
+
+tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) {
+ var cwxsa = proxyquire( './../lib', {
+ '@stdlib/utils/try-require': tryRequire
+ });
+
+ t.strictEqual( cwxsa, require( './../lib/main.js' ), 'returns JS implementation' );
+ t.end();
+
+ function tryRequire() {
+ return new Error( 'Cannot find module' );
+ }
+});
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.ndarray.js
new file mode 100644
index 000000000000..b8a81e70a352
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.ndarray.js
@@ -0,0 +1,462 @@
+/**
+* @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 stdlib/empty-line-before-comment */
+
+'use strict';
+
+// MODULES //
+
+var tape = require( 'tape' );
+var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' );
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+var sub = require( '@stdlib/complex/float32/base/sub' );
+var cwxsa = require( './../lib/ndarray.js' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof cwxsa, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function has an arity of 8', function test( t ) {
+ t.strictEqual( cwxsa.length, 8, 'has expected arity' );
+ t.end();
+});
+
+tape( 'the function subtracts a scalar constant from each element in a strided array `x` and assigns the results to elements in a strided array `w`', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 4.0,
+ 2.0,
+ -3.0,
+ 5.0,
+ -1.0,
+ 2.0,
+ -5.0,
+ 6.0
+ ]);
+ w = new Complex64Array( x.length );
+ expected = new Complex64Array([
+ // (4.0+2.0i) - (5.0+3.0i)
+ -1.0,
+ -1.0,
+ // (-3.0+5.0i) - (5.0+3.0i)
+ -8.0,
+ 2.0,
+ // (-1.0+2.0i) - (5.0+3.0i)
+ -6.0,
+ -1.0,
+ // (-5.0+6.0i) - (5.0+3.0i)
+ -10.0,
+ 3.0
+ ]);
+
+ cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
+ w = new Complex64Array( x.length );
+ expected = new Complex64Array([
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0
+ ]);
+
+ cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns a reference to the output array', function test( t ) {
+ var alpha;
+ var out;
+ var x;
+ var w;
+
+ alpha = new Complex64( 3.0, 2.0 );
+ x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 ] ); // eslint-disable-line max-len
+ w = new Complex64Array( x.length );
+ out = cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+
+ t.strictEqual( out, w, 'same reference' );
+ t.end();
+});
+
+tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `w` unchanged', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+ x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] );
+ w = new Complex64Array( [ 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] );
+ expected = new Complex64Array( [ 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] );
+
+ cwxsa( 0, alpha, x, 1, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ cwxsa( -4, alpha, x, 1, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'if `alpha` equals `0`, the function assigns `x` to `w`', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 0.0, 0.0 );
+ x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] );
+ w = new Complex64Array( x.length );
+ expected = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); // w = x
+
+ cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports an `x` stride', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 1.0, // 0
+ 2.0, // 0
+ 3.0,
+ 4.0,
+ 5.0, // 1
+ 6.0, // 1
+ 7.0,
+ 8.0,
+ 9.0, // 2
+ 10.0 // 2
+ ]);
+ w = new Complex64Array([
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]);
+ expected = new Complex64Array([
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0,
+ // (9.0+10.0i) - (5.0+3.0i)
+ 4.0,
+ 7.0
+ ]);
+
+ cwxsa( 3, alpha, x, 2, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports a `w` stride', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 1.0,
+ 2.0,
+ 3.0,
+ 4.0,
+ 5.0,
+ 6.0
+ ]);
+ w = new Complex64Array([
+ 0.0, // 0
+ 0.0, // 0
+ 0.0,
+ 0.0,
+ 0.0, // 1
+ 0.0, // 1
+ 0.0,
+ 0.0,
+ 0.0, // 2
+ 0.0 // 2
+ ]);
+ expected = new Complex64Array([
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ 0.0,
+ 0.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0
+ ]);
+
+ cwxsa( 3, alpha, x, 1, 0, w, 2, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports negative strides', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 2.0, // 2
+ 3.0, // 2
+ 4.0,
+ 5.0,
+ -5.0, // 1
+ -6.0, // 1
+ 7.0,
+ 8.0,
+ 6.0, // 0
+ 9.0 // 0
+ ]);
+ w = new Complex64Array([
+ 0.0, // 2
+ 0.0, // 2
+ 0.0, // 1
+ 0.0, // 1
+ 0.0, // 0
+ 0.0 // 0
+ ]);
+ expected = new Complex64Array([
+ // (2.0+3.0i) - (5.0+3.0i)
+ -3.0,
+ 0.0,
+ // (-5.0-6.0i) - (5.0+3.0i)
+ -10.0,
+ -9.0,
+ // (6.0+9.0i) - (5.0+3.0i)
+ 1.0,
+ 6.0
+ ]);
+
+ cwxsa( 3, alpha, x, -2, x.length-1, w, -1, w.length-1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports an `x` offset', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 0.0,
+ 0.0,
+ 1.0, // 0
+ 2.0, // 0
+ 0.0,
+ 0.0,
+ 3.0, // 1
+ 4.0, // 1
+ 0.0,
+ 0.0,
+ 5.0, // 2
+ 6.0 // 2
+ ]);
+ w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+ expected = new Complex64Array([
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0
+ ]);
+
+ cwxsa( 3, alpha, x, 2, 1, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports a `w` offset', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ w = new Complex64Array([
+ 0.0,
+ 0.0,
+ 0.0, // 0
+ 0.0, // 0
+ 0.0, // 1
+ 0.0, // 1
+ 0.0, // 2
+ 0.0 // 2
+ ]);
+ expected = new Complex64Array([
+ 0.0,
+ 0.0,
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0
+ ]);
+
+ cwxsa( 3, alpha, x, 1, 0, w, 1, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports complex access patterns', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 0.0,
+ 0.0,
+ 1.0, // 0
+ 2.0, // 0
+ 0.0,
+ 0.0,
+ 3.0, // 1
+ 4.0, // 1
+ 0.0,
+ 0.0,
+ 5.0, // 2
+ 6.0, // 2
+ 0.0,
+ 0.0
+ ]);
+ w = new Complex64Array([
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0, // 0
+ 0.0, // 0
+ 0.0, // 1
+ 0.0, // 1
+ 0.0, // 2
+ 0.0, // 2
+ 0.0,
+ 0.0
+ ]);
+ expected = new Complex64Array([
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0,
+ 0.0,
+ 0.0
+ ]);
+
+ cwxsa( 3, alpha, x, 2, 1, w, 1, 2 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'if both strides are equal to `1`, the function efficiently subtracts a constant from each element of a strided array', function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+ var z;
+ var i;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array( 100 );
+ w = new Complex64Array( 100 );
+ expected = new Complex64Array( x.length );
+ for ( i = 0; i < x.length; i++ ) {
+ z = new Complex64( i, i + 1 );
+ x.set( z, i );
+ expected.set( sub( z, alpha ), i );
+ }
+ cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ x = new Complex64Array( 240 );
+ w = new Complex64Array( 240 );
+ expected = new Complex64Array( x.length );
+ for ( i = 0; i < x.length; i++ ) {
+ z = new Complex64( i, i + 1 );
+ x.set( z, i );
+ expected.set( sub( z, alpha ), i );
+ }
+ cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ t.end();
+});
diff --git a/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.ndarray.native.js
new file mode 100644
index 000000000000..535fdaab9f98
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/ext/base/cwxsa/test/test.ndarray.native.js
@@ -0,0 +1,471 @@
+/**
+* @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 stdlib/empty-line-before-comment */
+
+'use strict';
+
+// MODULES //
+
+var resolve = require( 'path' ).resolve;
+var tape = require( 'tape' );
+var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' );
+var Complex64Array = require( '@stdlib/array/complex64' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+var sub = require( '@stdlib/complex/float32/base/sub' );
+var tryRequire = require( '@stdlib/utils/try-require' );
+
+
+// VARIABLES //
+
+var cwxsa = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) );
+var opts = {
+ 'skip': ( cwxsa instanceof Error )
+};
+
+
+// TESTS //
+
+tape( 'main export is a function', opts, function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof cwxsa, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function has an arity of 8', opts, function test( t ) {
+ t.strictEqual( cwxsa.length, 8, 'has expected arity' );
+ t.end();
+});
+
+tape( 'the function subtracts a scalar constant from each element in a strided array `x` and assigns the results to elements in a strided array `w`', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 4.0,
+ 2.0,
+ -3.0,
+ 5.0,
+ -1.0,
+ 2.0,
+ -5.0,
+ 6.0
+ ]);
+ w = new Complex64Array( x.length );
+ expected = new Complex64Array([
+ // (4.0+2.0i) - (5.0+3.0i)
+ -1.0,
+ -1.0,
+ // (-3.0+5.0i) - (5.0+3.0i)
+ -8.0,
+ 2.0,
+ // (-1.0+2.0i) - (5.0+3.0i)
+ -6.0,
+ -1.0,
+ // (-5.0+6.0i) - (5.0+3.0i)
+ -10.0,
+ 3.0
+ ]);
+
+ cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
+ w = new Complex64Array( x.length );
+ expected = new Complex64Array([
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0
+ ]);
+
+ cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns a reference to the output array', opts, function test( t ) {
+ var alpha;
+ var out;
+ var x;
+ var w;
+
+ alpha = new Complex64( 3.0, 2.0 );
+ x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 ] ); // eslint-disable-line max-len
+ w = new Complex64Array( x.length );
+ out = cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+
+ t.strictEqual( out, w, 'same reference' );
+ t.end();
+});
+
+tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `w` unchanged', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+ x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] );
+ w = new Complex64Array( [ 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] );
+ expected = new Complex64Array( [ 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] );
+
+ cwxsa( 0, alpha, x, 1, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ cwxsa( -4, alpha, x, 1, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'if `alpha` equals `0`, the function assigns `x` to `w`', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 0.0, 0.0 );
+ x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] );
+ w = new Complex64Array( x.length );
+ expected = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); // w = x
+
+ cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports an `x` stride', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 1.0, // 0
+ 2.0, // 0
+ 3.0,
+ 4.0,
+ 5.0, // 1
+ 6.0, // 1
+ 7.0,
+ 8.0,
+ 9.0, // 2
+ 10.0 // 2
+ ]);
+ w = new Complex64Array([
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]);
+ expected = new Complex64Array([
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0,
+ // (9.0+10.0i) - (5.0+3.0i)
+ 4.0,
+ 7.0
+ ]);
+
+ cwxsa( 3, alpha, x, 2, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports a `w` stride', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 1.0,
+ 2.0,
+ 3.0,
+ 4.0,
+ 5.0,
+ 6.0
+ ]);
+ w = new Complex64Array([
+ 0.0, // 0
+ 0.0, // 0
+ 0.0,
+ 0.0,
+ 0.0, // 1
+ 0.0, // 1
+ 0.0,
+ 0.0,
+ 0.0, // 2
+ 0.0 // 2
+ ]);
+ expected = new Complex64Array([
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ 0.0,
+ 0.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0
+ ]);
+
+ cwxsa( 3, alpha, x, 1, 0, w, 2, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports negative strides', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 2.0, // 2
+ 3.0, // 2
+ 4.0,
+ 5.0,
+ -5.0, // 1
+ -6.0, // 1
+ 7.0,
+ 8.0,
+ 6.0, // 0
+ 9.0 // 0
+ ]);
+ w = new Complex64Array([
+ 0.0, // 2
+ 0.0, // 2
+ 0.0, // 1
+ 0.0, // 1
+ 0.0, // 0
+ 0.0 // 0
+ ]);
+ expected = new Complex64Array([
+ // (2.0+3.0i) - (5.0+3.0i)
+ -3.0,
+ 0.0,
+ // (-5.0-6.0i) - (5.0+3.0i)
+ -10.0,
+ -9.0,
+ // (6.0+9.0i) - (5.0+3.0i)
+ 1.0,
+ 6.0
+ ]);
+
+ cwxsa( 3, alpha, x, -2, x.length-1, w, -1, w.length-1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports an `x` offset', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 0.0,
+ 0.0,
+ 1.0, // 0
+ 2.0, // 0
+ 0.0,
+ 0.0,
+ 3.0, // 1
+ 4.0, // 1
+ 0.0,
+ 0.0,
+ 5.0, // 2
+ 6.0 // 2
+ ]);
+ w = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
+ expected = new Complex64Array([
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0
+ ]);
+
+ cwxsa( 3, alpha, x, 2, 1, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports a `w` offset', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ w = new Complex64Array([
+ 0.0,
+ 0.0,
+ 0.0, // 0
+ 0.0, // 0
+ 0.0, // 1
+ 0.0, // 1
+ 0.0, // 2
+ 0.0 // 2
+ ]);
+ expected = new Complex64Array([
+ 0.0,
+ 0.0,
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0
+ ]);
+
+ cwxsa( 3, alpha, x, 1, 0, w, 1, 1 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function supports complex access patterns', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array([
+ 0.0,
+ 0.0,
+ 1.0, // 0
+ 2.0, // 0
+ 0.0,
+ 0.0,
+ 3.0, // 1
+ 4.0, // 1
+ 0.0,
+ 0.0,
+ 5.0, // 2
+ 6.0, // 2
+ 0.0,
+ 0.0
+ ]);
+ w = new Complex64Array([
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0, // 0
+ 0.0, // 0
+ 0.0, // 1
+ 0.0, // 1
+ 0.0, // 2
+ 0.0, // 2
+ 0.0,
+ 0.0
+ ]);
+ expected = new Complex64Array([
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ // (1.0+2.0i) - (5.0+3.0i)
+ -4.0,
+ -1.0,
+ // (3.0+4.0i) - (5.0+3.0i)
+ -2.0,
+ 1.0,
+ // (5.0+6.0i) - (5.0+3.0i)
+ 0.0,
+ 3.0,
+ 0.0,
+ 0.0
+ ]);
+
+ cwxsa( 3, alpha, x, 2, 1, w, 1, 2 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+ t.end();
+});
+
+tape( 'if both strides are equal to `1`, the function efficiently subtracts a constant from each element of a strided array', opts, function test( t ) {
+ var expected;
+ var alpha;
+ var x;
+ var w;
+ var z;
+ var i;
+
+ alpha = new Complex64( 5.0, 3.0 );
+
+ x = new Complex64Array( 100 );
+ w = new Complex64Array( 100 );
+ expected = new Complex64Array( x.length );
+ for ( i = 0; i < x.length; i++ ) {
+ z = new Complex64( i, i + 1 );
+ x.set( z, i );
+ expected.set( sub( z, alpha ), i );
+ }
+ cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ x = new Complex64Array( 240 );
+ w = new Complex64Array( 240 );
+ expected = new Complex64Array( x.length );
+ for ( i = 0; i < x.length; i++ ) {
+ z = new Complex64( i, i + 1 );
+ x.set( z, i );
+ expected.set( sub( z, alpha ), i );
+ }
+ cwxsa( x.length, alpha, x, 1, 0, w, 1, 0 );
+ t.strictEqual( isSameComplex64Array( w, expected ), true, 'returns expected value' );
+
+ t.end();
+});