diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/README.md b/lib/node_modules/@stdlib/blas/base/scnrm2/README.md
new file mode 100644
index 000000000000..8c21f4eab599
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/README.md
@@ -0,0 +1,267 @@
+
+
+# scnrm2
+
+> Compute the L2-norm of a complex single-precision floating-point vector.
+
+
+
+## Usage
+
+```javascript
+var scnrm2 = require( '@stdlib/blas/base/scnrm2' );
+```
+
+#### scnrm2( N, cx, strideX )
+
+Computes the L2-norm of a complex single-precision floating-point vector.
+
+```javascript
+var Complex64Array = require( '@stdlib/array/complex64' );
+
+var cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] );
+
+var norm = scnrm2( 4, cx, 1 );
+// returns ~0.8
+```
+
+The function has the following parameters:
+
+- **N**: number of indexed elements.
+- **cx**: input [`Complex64Array`][@stdlib/array/complex64].
+- **strideX**: index increment for `cx`.
+
+The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to traverse every other value,
+
+```javascript
+var Complex64Array = require( '@stdlib/array/complex64' );
+
+var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
+
+var norm = scnrm2( 2, cx, 2 );
+// returns ~4.6
+```
+
+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' );
+
+// Initial array:
+var cx0 = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
+
+// Create an offset view:
+var cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
+
+// Compute the L2-norm:
+var norm = scnrm2( 2, cx1, 1 );
+// returns ~9.3
+```
+
+#### scnrm2.ndarray( N, cx, strideX, offset )
+
+Computes the L2-norm of a complex single-precision floating-point vector using alternative indexing semantics.
+
+```javascript
+var Complex64Array = require( '@stdlib/array/complex64' );
+
+var cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] );
+
+var norm = scnrm2.ndarray( 4, cx, 1, 0 );
+// returns ~0.8
+```
+
+The function has the following additional parameters:
+
+- **offsetX**: starting index.
+
+While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to start from the second index,
+
+```javascript
+var Complex64Array = require( '@stdlib/array/complex64' );
+
+var cx = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
+
+var norm = scnrm2.ndarray( 2, cx, 1, 1 );
+// returns ~9.3
+```
+
+
+
+
+
+
+
+## Notes
+
+- If `N <= 0`, both functions return `0.0`.
+- `scnrm2()` corresponds to the [BLAS][blas] level 1 function [`scnrm2`][scnrm2].
+
+
+
+
+
+
+
+## Examples
+
+
+
+```javascript
+var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
+var filledarrayBy = require( '@stdlib/array/filled-by' );
+var Complex64 = require( '@stdlib/complex/float32' );
+var scnrm2 = require( '@stdlib/blas/base/scnrm2' );
+
+function rand() {
+ return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) );
+}
+
+var cx = filledarrayBy( 10, 'complex64', rand );
+console.log( cx.toString() );
+
+// Compute the L2-norm:
+var norm = scnrm2( cx.length, cx, 1 );
+console.log( norm );
+```
+
+
+
+
+
+
+
+* * *
+
+
+
+## C APIs
+
+
+
+
+
+
+
+
+
+
+
+### Usage
+
+```c
+#include "stdlib/blas/base/scnrm2.h"
+```
+
+#### c_scnrm2( N, \*CX, strideX )
+
+Computes the L2-norm of a complex single-precision floating-point vector.
+
+```c
+const float cx[] = { 0.3f, 0.1f, 0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.2f };
+
+float norm = c_scnrm2( 4, (void *)cx, 1 );
+// returns 0.8
+```
+
+The function accepts the following arguments:
+
+- **N**: `[in] CBLAS_INT` number of indexed elements.
+- **CX**: `[in] void*` input array.
+- **strideX**: `[in] CBLAS_INT` index increment for `CX`.
+
+```c
+float c_scnrm2( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX );
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+### Examples
+
+```c
+#include "stdlib/blas/base/scnrm2.h"
+#include
+
+int main( void ) {
+ // Create a strided array of interleaved real and imaginary components:
+ const float cx[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
+
+ // Specify the number of elements:
+ const int N = 4;
+
+ // Specify stride length:
+ const int strideX = 1;
+
+ // Compute the L2-norm:
+ c_scnrm2( N, (void *)cx, strideX );
+
+ // Print the result:
+ printf( "L2-norm: %f\n", norm );
+}
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[blas]: http://www.netlib.org/blas
+
+[scnrm2]: https://www.netlib.org/lapack/explore-html/d1/d2a/group__nrm2_gaee5779d5d216a7cd8cf83488fb6bb175.html#gaee5779d5d216a7cd8cf83488fb6bb175
+
+[@stdlib/array/complex64]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/complex64
+
+[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
+
+
+
+
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.js
new file mode 100644
index 000000000000..88b0f0d3102e
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.js
@@ -0,0 +1,92 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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 pkg = require( './../package.json' ).name;
+var scnrm2 = require( './../lib/scnrm2.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 cx = new Complex64Array( uniform( len*2, -10.0, 10.0, options ) );
+ return benchmark;
+
+ function benchmark( b ) {
+ var norm;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ norm = scnrm2( cx.length, cx, 1 );
+ if ( isnanf( norm ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ }
+ b.toc();
+ if ( isnanf( norm ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+ }
+}
+
+
+// MAIN //
+
+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( pkg+':len='+len, f );
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.native.js
new file mode 100644
index 000000000000..7eef75c0bb9f
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.native.js
@@ -0,0 +1,97 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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 tryRequire = require( '@stdlib/utils/try-require' );
+var pkg = require( './../package.json' ).name;
+
+
+// VARIABLES //
+
+var scnrm2 = tryRequire( resolve( __dirname, './../lib/scnrm2.native.js' ) );
+var opts = {
+ 'skip': ( scnrm2 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 cx = new Complex64Array( uniform( len*2, -10.0, 10.0, options ) );
+ return benchmark;
+
+ function benchmark( b ) {
+ var norm;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ norm = scnrm2( cx.length, cx, 1 );
+ if ( isnanf( norm ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ }
+ b.toc();
+ if ( isnanf( norm ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+ }
+}
+
+
+// MAIN //
+
+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( pkg+'::native:len='+len, opts, f );
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.js
new file mode 100644
index 000000000000..69868a754941
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.js
@@ -0,0 +1,92 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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 pkg = require( './../package.json' ).name;
+var scnrm2 = 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 cx = new Complex64Array( uniform( len*2, -10.0, 10.0, options ) );
+ return benchmark;
+
+ function benchmark( b ) {
+ var norm;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ norm = scnrm2( cx.length, cx, 1, 0 );
+ if ( isnanf( norm ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ }
+ b.toc();
+ if ( isnanf( norm ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+ }
+}
+
+
+// MAIN //
+
+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( pkg+':ndarray:len='+len, f );
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.native.js
new file mode 100644
index 000000000000..d0a25a4d636c
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.native.js
@@ -0,0 +1,97 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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 tryRequire = require( '@stdlib/utils/try-require' );
+var pkg = require( './../package.json' ).name;
+
+
+// VARIABLES //
+
+var scnrm2 = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) );
+var opts = {
+ 'skip': ( scnrm2 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 cx = new Complex64Array( uniform( len*2, -10.0, 10.0, options ) );
+ return benchmark;
+
+ function benchmark( b ) {
+ var norm;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ norm = scnrm2( cx.length, cx, 1, 0 );
+ if ( isnanf( norm ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ }
+ b.toc();
+ if ( isnanf( norm ) ) {
+ b.fail( 'should not return NaN' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+ }
+}
+
+
+// MAIN //
+
+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( pkg+'::native:ndarray:len='+len, opts, f );
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/c/Makefile
new file mode 100644
index 000000000000..9f97140e7cb0
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/c/Makefile
@@ -0,0 +1,146 @@
+#/
+# @license Apache-2.0
+#
+# Copyright (c) 2024 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/base/scnrm2/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/c/benchmark.length.c
new file mode 100644
index 000000000000..f033f174a4f2
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/c/benchmark.length.c
@@ -0,0 +1,155 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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.
+*/
+
+/**
+* Benchmark `scnrm2`.
+*/
+#include "stdlib/blas/base/scnrm2.h"
+#include
+#include
+#include
+#include
+#include
+
+#define NAME "scnrm2"
+#define ITERATIONS 10000000
+#define REPEATS 3
+#define MIN 1
+#define MAX 6
+
+/**
+* Prints the TAP version.
+*/
+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
+*/
+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
+*/
+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
+*/
+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 [0,1].
+*
+* @return random number
+*/
+float rand_float( void ) {
+ int r = rand();
+ return (float)r / ( (float)RAND_MAX + 1.0f );
+}
+
+/**
+* Runs a benchmark.
+*
+* @param iterations number of iterations
+* @param len array length
+* @return elapsed time in seconds
+*/
+double benchmark( int iterations, int len ) {
+ float cx[ len*2 ];
+ double elapsed;
+ float norm;
+ double t;
+ int i;
+
+ for ( i = 0; i < len*2; i += 2 ) {
+ cx[ i ] = ( rand_float()*10000.0f ) - 5000.0f;
+ cx[ i+1 ] = ( rand_float()*10000.0f ) - 5000.0f;
+ }
+ norm = 0.0f;
+ t = tic();
+ for ( i = 0; i < iterations; i++ ) {
+ norm = c_scnrm2( len, (void *)cx, 1 );
+ if ( norm != norm ) {
+ printf( "should not return NaN\n" );
+ break;
+ }
+ }
+ elapsed = tic() - t;
+ if ( norm != norm ) {
+ printf( "should not return NaN\n" );
+ }
+ 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 = benchmark( 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/base/scnrm2/benchmark/fortran/Makefile b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/fortran/Makefile
new file mode 100644
index 000000000000..b03b92f41090
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/fortran/Makefile
@@ -0,0 +1,141 @@
+#/
+# @license Apache-2.0
+#
+# Copyright (c) 2024 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 Fortran source files:
+ifdef FORTRAN_COMPILER
+ FC := $(FORTRAN_COMPILER)
+else
+ FC := gfortran
+endif
+
+# Define the command-line options when compiling Fortran files:
+FFLAGS ?= \
+ -std=f95 \
+ -ffree-form \
+ -O3 \
+ -Wall \
+ -Wextra \
+ -Wno-compare-reals \
+ -Wimplicit-interface \
+ -fno-underscoring \
+ -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 ?=
+
+# List of Fortran source files:
+SOURCE_FILES ?= ../../src/scnrm2.f
+
+# List of Fortran targets:
+f_targets := benchmark.length.out
+
+
+# RULES #
+
+#/
+# Compiles Fortran source files.
+#
+# @param {string} SOURCE_FILES - list of Fortran source files
+# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop`)
+# @param {string} [FORTRAN_COMPILER] - Fortran compiler
+# @param {string} [FFLAGS] - Fortran compiler flags
+# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code
+#
+# @example
+# make
+#
+# @example
+# make all
+#/
+all: $(f_targets)
+
+.PHONY: all
+
+#/
+# Compiles Fortran source files.
+#
+# @private
+# @param {string} SOURCE_FILES - list of Fortran source files
+# @param {(string|void)} INCLUDE - list of includes (e.g., `-I /foo/bar -I /beep/boop`)
+# @param {string} FC - Fortran compiler
+# @param {string} FFLAGS - Fortran compiler flags
+# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code
+#/
+$(f_targets): %.out: %.f
+ $(QUIET) $(FC) $(FFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $<
+
+#/
+# Runs compiled benchmarks.
+#
+# @example
+# make run
+#/
+run: $(f_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/base/scnrm2/benchmark/fortran/benchmark.length.f b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/fortran/benchmark.length.f
new file mode 100644
index 000000000000..33ae3e38b0b7
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/fortran/benchmark.length.f
@@ -0,0 +1,220 @@
+!>
+! @license Apache-2.0
+!
+! Copyright (c) 2024 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.
+!<
+
+!> Benchmark `scnrm2`.
+!
+! ## Notes
+!
+! - Written in "free form" Fortran 95.
+!
+!<
+program bench
+ implicit none
+ ! ..
+ ! Local constants:
+ character(6), parameter :: name = 'scnrm2' ! if changed, be sure to adjust length
+ integer, parameter :: iterations = 10000000
+ integer, parameter :: repeats = 3
+ integer, parameter :: min = 1
+ integer, parameter :: max = 6
+ ! ..
+ ! Run the benchmarks:
+ call main()
+ ! ..
+ ! Functions:
+contains
+ ! ..
+ ! Prints the TAP version.
+ ! ..
+ subroutine print_version()
+ print '(A)', 'TAP version 13'
+ end subroutine print_version
+ ! ..
+ ! Prints the TAP summary.
+ !
+ ! @param {integer} total - total number of tests
+ ! @param {integer} passing - total number of passing tests
+ ! ..
+ subroutine print_summary( total, passing )
+ ! ..
+ ! Scalar arguments:
+ integer, intent(in) :: total, passing
+ ! ..
+ ! Local variables:
+ character(len=999) :: str, tmp
+ ! ..
+ ! Intrinsic functions:
+ intrinsic adjustl, trim
+ ! ..
+ print '(A)', '#'
+ ! ..
+ write (str, '(I15)') total ! TAP plan
+ tmp = adjustl( str )
+ print '(A,A)', '1..', trim( tmp )
+ ! ..
+ print '(A,A)', '# total ', trim( tmp )
+ ! ..
+ write (str, '(I15)') passing
+ tmp = adjustl( str )
+ print '(A,A)', '# pass ', trim( tmp )
+ ! ..
+ print '(A)', '#'
+ print '(A)', '# ok'
+ end subroutine print_summary
+ ! ..
+ ! Prints benchmarks results.
+ !
+ ! @param {integer} iterations - number of iterations
+ ! @param {double} elapsed - elapsed time in seconds
+ ! ..
+ subroutine print_results( iterations, elapsed )
+ ! ..
+ ! Scalar arguments:
+ double precision, intent(in) :: elapsed
+ integer, intent(in) :: iterations
+ ! ..
+ ! Local variables:
+ double precision :: rate
+ character(len=999) :: str, tmp
+ ! ..
+ ! Intrinsic functions:
+ intrinsic dble, adjustl, trim
+ ! ..
+ rate = dble( iterations ) / elapsed
+ ! ..
+ print '(A)', ' ---'
+ ! ..
+ write (str, '(I15)') iterations
+ tmp = adjustl( str )
+ print '(A,A)', ' iterations: ', trim( tmp )
+ ! ..
+ write (str, '(f0.9)') elapsed
+ tmp = adjustl( str )
+ print '(A,A)', ' elapsed: ', trim( tmp )
+ ! ..
+ write( str, '(f0.9)') rate
+ tmp = adjustl( str )
+ print '(A,A)', ' rate: ', trim( tmp )
+ ! ..
+ print '(A)', ' ...'
+ end subroutine print_results
+ ! ..
+ ! Runs a benchmark.
+ !
+ ! @param {integer} iterations - number of iterations
+ ! @param {integer} len - array length
+ ! @return {double} elapsed time in seconds
+ ! ..
+ double precision function benchmark( iterations, len )
+ ! ..
+ ! External functions:
+ interface
+ real function scnrm2( N, cx, strideX )
+ complex :: cx(*)
+ integer :: strideX, N
+ end function scnrm2
+ end interface
+ ! ..
+ ! Scalar arguments:
+ integer, intent(in) :: iterations, len
+ ! ..
+ ! Local scalars:
+ double precision :: elapsed, r1, r2
+ real :: t1, t2, y
+ integer :: i
+ ! ..
+ ! Local arrays:
+ complex, allocatable :: x(:)
+ ! ..
+ ! Intrinsic functions:
+ intrinsic random_number, cpu_time, cmplx
+ ! ..
+ ! Allocate arrays:
+ allocate( x(len) )
+ ! ..
+ call random_number( r1 )
+ call random_number( r2 )
+ do i = 1, len
+ call random_number( r1 )
+ call random_number( r2 )
+ x( i ) = cmplx( (real(r1)*10000.0)-5000.0, (real(r2)*10000.0)-5000.0 )
+ end do
+ ! ..
+ y = 0.0e0
+ ! ..
+ call cpu_time( t1 )
+ ! ..
+ do i = 1, iterations
+ y = scnrm2( len, x, 1 );
+ if ( y /= y ) then
+ print '(A)', 'should not return NaN'
+ exit
+ end if
+ end do
+ ! ..
+ call cpu_time( t2 )
+ ! ..
+ elapsed = t2 - t1
+ ! ..
+ if ( y /= y ) then
+ print '(A)', 'should not return NaN'
+ end if
+ ! ..
+ ! Deallocate arrays:
+ deallocate( x )
+ ! ..
+ benchmark = elapsed
+ return
+ end function benchmark
+ ! ..
+ ! Main execution sequence.
+ ! ..
+ subroutine main()
+ ! ..
+ ! Local variables:
+ integer :: count, iter, len, i, j
+ double precision :: elapsed
+ character(len=999) :: str, tmp
+ ! ..
+ ! Intrinsic functions:
+ intrinsic adjustl, trim
+ ! ..
+ call print_version()
+ count = 0
+ do i = min, max
+ len = 10**i
+ iter = iterations / 10**(i-1)
+ do j = 1, repeats
+ count = count + 1
+ ! ..
+ write (str, '(I15)') len
+ tmp = adjustl( str )
+ print '(A,A,A,A)', '# fortran::native::', name, ':len=', trim( tmp )
+ ! ..
+ elapsed = benchmark( iter, len )
+ ! ..
+ call print_results( iter, elapsed )
+ ! ..
+ write (str, '(I15)') count
+ tmp = adjustl( str )
+ print '(A,A,A)', 'ok ', trim( tmp ), ' benchmark finished'
+ end do
+ end do
+ call print_summary( count, count )
+ end subroutine main
+end program bench
\ No newline at end of file
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/binding.gyp b/lib/node_modules/@stdlib/blas/base/scnrm2/binding.gyp
new file mode 100644
index 000000000000..02a2799da097
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/binding.gyp
@@ -0,0 +1,265 @@
+# @license Apache-2.0
+#
+# Copyright (c) 2024 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/base/scnrm2/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/scnrm2/docs/repl.txt
new file mode 100644
index 000000000000..521874c9d53d
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/docs/repl.txt
@@ -0,0 +1,89 @@
+
+{{alias}}( N, cx, strideX )
+ Computes the L2-norm of a complex single-precision floating-point vector.
+
+ The `N` and stride parameters determine which elements in the strided array
+ 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 `0.0`.
+
+ Parameters
+ ----------
+ N: integer
+ Number of indexed elements.
+
+ cx: Complex64Array
+ Input array.
+
+ strideX: integer
+ Index increment for `cx`.
+
+ Returns
+ -------
+ out: number
+ L2-norm.
+
+ Examples
+ --------
+ // Standard Usage:
+ > var cx = new {{alias:@stdlib/array/complex64}}( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] );
+ > var out = {{alias}}( 4, cx, 1 )
+ ~0.8
+
+ // Using `N` and stride parameters:
+ > cx = new {{alias:@stdlib/array/complex64}}( [ 3.0, -4.0, 0.0, 0.0, 5.0, -6.0 ] );
+ > out = {{alias}}( 2, cx, 2 )
+ ~9.3
+
+ // Using view offsets:
+ > var cx0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
+ > var cx1 = new {{alias:@stdlib/array/complex64}}( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 );
+ > out = {{alias}}( 2, cx1, 1 )
+ ~9.3
+
+
+{{alias}}.ndarray( N, cx, strideX, offsetX )
+ Computes the L2-norm of a complex single-precision floating-point vector
+ using alternative indexing semantics.
+
+ While typed array views mandate a view offset based on the underlying
+ buffer, the offset parameter supports indexing semantics based on a starting
+ index.
+
+ Parameters
+ ----------
+ N: integer
+ Number of indexed elements.
+
+ cx: Complex64Array
+ Input array.
+
+ strideX: integer
+ Index increment for `cx`.
+
+ offsetX: integer
+ Starting index of `cx`.
+
+ Returns
+ -------
+ out: number
+ L2-norm.
+
+ Examples
+ --------
+ // Standard Usage:
+ > var cx = new {{alias:@stdlib/array/complex64}}( [ 3.0, -4.0, 0.0, 0.0, 5.0, -6.0 ] );
+ > var out = {{alias}}.ndarray( 2, cx, 2, 0 )
+ ~9.3
+
+ // Using an index offset:
+ > cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
+ > out = {{alias}}.ndarray( 2, cx, 1, 1 )
+ ~9.3
+
+ See Also
+ --------
+
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/scnrm2/docs/types/index.d.ts
new file mode 100644
index 000000000000..2b9715175239
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/docs/types/index.d.ts
@@ -0,0 +1,96 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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';
+
+/**
+* Interface describing `scnrm2`.
+*/
+interface Routine {
+ /**
+ * Computes the L2-norm of a complex single-precision floating-point vector.
+ *
+ * @param N - number of indexed elements
+ * @param cx - input array
+ * @param strideX - stride length for `cx`
+ * @returns L2-norm
+ *
+ * @example
+ * var Complex64Array = require( '@stdlib/array/complex64' );
+ *
+ * var cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] );
+ *
+ * var norm = scnrm2( 4, cx, 1 );
+ * // returns ~0.8
+ */
+ ( N: number, x: Complex64Array, strideX: number ): number;
+
+ /**
+ * Computes the L2-norm of a complex single-precision floating-point vector using alternative indexing semantics.
+ *
+ * @param N - number of indexed elements
+ * @param cx - input array
+ * @param strideX - stride length for `cx`
+ * @param offsetX - starting index for `cx`
+ * @returns L2-norm
+ *
+ * @example
+ * var Complex64Array = require( '@stdlib/array/complex64' );
+ *
+ * var cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] );
+ *
+ * var norm = scnrm2.ndarray( 4, cx, 1, 0 );
+ * // returns ~0.8
+ */
+ ndarray( N: number, x: Complex64Array, strideX: number, offsetX: number ): number;
+}
+
+/**
+* Computes the L2-norm of a complex single-precision floating-point vector.
+*
+* @param N - number of indexed elements
+* @param cx - input array
+* @param strideX - stride length for `cx`
+* @returns L2-norm
+*
+* @example
+* var Complex64Array = require( '@stdlib/array/complex64' );
+*
+* var cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] );
+*
+* var norm = scnrm2( 4, cx, 1 );
+* // returns ~0.8
+*
+* @example
+* var Complex64Array = require( '@stdlib/array/complex64' );
+*
+* var cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] );
+*
+* var norm = scnrm2.ndarray( 4, cx, 1, 0 );
+* // returns ~0.8
+*/
+declare var scnrm2: Routine;
+
+
+// EXPORTS //
+
+export = scnrm2;
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/scnrm2/docs/types/test.ts
new file mode 100644
index 000000000000..dffd6ac98860
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/docs/types/test.ts
@@ -0,0 +1,158 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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 scnrm2 = require( './index' );
+
+
+// TESTS //
+
+// The function returns a number...
+{
+ const cx = new Complex64Array( 10 );
+
+ scnrm2( cx.length, cx, 1 ); // $ExpectType number
+}
+
+// The compiler throws an error if the function is provided a first argument which is not a number...
+{
+ const cx = new Complex64Array( 10 );
+
+ scnrm2( '10', cx, 1 ); // $ExpectError
+ scnrm2( true, cx, 1 ); // $ExpectError
+ scnrm2( false, cx, 1 ); // $ExpectError
+ scnrm2( null, cx, 1 ); // $ExpectError
+ scnrm2( undefined, cx, 1 ); // $ExpectError
+ scnrm2( [], cx, 1 ); // $ExpectError
+ scnrm2( {}, cx, 1 ); // $ExpectError
+ scnrm2( ( cx: number ): number => cx, cx, 1 ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a second argument which is not a Complex64Array...
+{
+ const cx = new Complex64Array( 10 );
+
+ scnrm2( cx.length, 10, 1 ); // $ExpectError
+ scnrm2( cx.length, '10', 1 ); // $ExpectError
+ scnrm2( cx.length, true, 1 ); // $ExpectError
+ scnrm2( cx.length, false, 1 ); // $ExpectError
+ scnrm2( cx.length, null, 1 ); // $ExpectError
+ scnrm2( cx.length, undefined, 1 ); // $ExpectError
+ scnrm2( cx.length, [], 1 ); // $ExpectError
+ scnrm2( cx.length, {}, 1 ); // $ExpectError
+ scnrm2( cx.length, ( cx: number ): number => cx, 1 ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a third argument which is not a number...
+{
+ const cx = new Complex64Array( 10 );
+
+ scnrm2( cx.length, cx, '10' ); // $ExpectError
+ scnrm2( cx.length, cx, true ); // $ExpectError
+ scnrm2( cx.length, cx, false ); // $ExpectError
+ scnrm2( cx.length, cx, null ); // $ExpectError
+ scnrm2( cx.length, cx, undefined ); // $ExpectError
+ scnrm2( cx.length, cx, [] ); // $ExpectError
+ scnrm2( cx.length, cx, {} ); // $ExpectError
+ scnrm2( cx.length, cx, ( cx: number ): number => cx ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ const cx = new Complex64Array( 10 );
+
+ scnrm2(); // $ExpectError
+ scnrm2( cx.length ); // $ExpectError
+ scnrm2( cx.length, cx ); // $ExpectError
+ scnrm2( cx.length, cx, 1, 10 ); // $ExpectError
+}
+
+// Attached to main export is an `ndarray` method which returns a number...
+{
+ const cx = new Complex64Array( 10 );
+
+ scnrm2.ndarray( cx.length, cx, 1, 0 ); // $ExpectType number
+}
+
+// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
+{
+ const cx = new Complex64Array( 10 );
+
+ scnrm2.ndarray( '10', cx, 1, 0 ); // $ExpectError
+ scnrm2.ndarray( true, cx, 1, 0 ); // $ExpectError
+ scnrm2.ndarray( false, cx, 1, 0 ); // $ExpectError
+ scnrm2.ndarray( null, cx, 1, 0 ); // $ExpectError
+ scnrm2.ndarray( undefined, cx, 1, 0 ); // $ExpectError
+ scnrm2.ndarray( [], cx, 1, 0 ); // $ExpectError
+ scnrm2.ndarray( {}, cx, 1, 0 ); // $ExpectError
+ scnrm2.ndarray( ( cx: number ): number => cx, cx, 1, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided a second argument which is not a Complex64Array...
+{
+ const cx = new Complex64Array( 10 );
+
+ scnrm2.ndarray( cx.length, 10, 1, 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, '10', 1, 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, true, 1, 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, false, 1, 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, null, 1, 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, undefined, 1, 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, [], 1, 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, {}, 1, 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, ( cx: number ): number => cx, 1, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided a third argument which is not a number...
+{
+ const cx = new Complex64Array( 10 );
+
+ scnrm2.ndarray( cx.length, cx, '10', 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, true, 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, false, 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, null, 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, undefined, 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, [], 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, {}, 0 ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, ( cx: number ): number => cx, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number...
+{
+ const cx = new Complex64Array( 10 );
+
+ scnrm2.ndarray( cx.length, cx, 1, '10' ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, 1, true ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, 1, false ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, 1, null ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, 1, undefined ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, 1, [] ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, 1, {} ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, 1, ( cx: number ): number => cx ); // $ExpectError
+}
+
+// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments...
+{
+ const cx = new Complex64Array( 10 );
+
+ scnrm2.ndarray(); // $ExpectError
+ scnrm2.ndarray( cx.length ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, 1 ); // $ExpectError
+ scnrm2.ndarray( cx.length, cx, 1, 0, 10 ); // $ExpectError
+}
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/examples/c/Makefile b/lib/node_modules/@stdlib/blas/base/scnrm2/examples/c/Makefile
new file mode 100644
index 000000000000..6aed70daf167
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/examples/c/Makefile
@@ -0,0 +1,146 @@
+#/
+# @license Apache-2.0
+#
+# Copyright (c) 2024 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/base/scnrm2/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/scnrm2/examples/c/example.c
new file mode 100644
index 000000000000..c018f3a0d8d4
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/examples/c/example.c
@@ -0,0 +1,37 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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/base/scnrm2.h"
+#include
+
+int main( void ) {
+ // Create a strided array of interleaved real and imaginary components:
+ const float cx[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
+
+ // Specify the number of elements:
+ const int N = 4;
+
+ // Specify stride length:
+ const int strideX = 1;
+
+ // Compute the L2-norm:
+ float norm = c_scnrm2( N, (void *)cx, strideX );
+
+ // Print the result:
+ printf( "L2-norm: %f\n", norm );
+}
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/examples/index.js b/lib/node_modules/@stdlib/blas/base/scnrm2/examples/index.js
new file mode 100644
index 000000000000..557ed6bcfb8b
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/examples/index.js
@@ -0,0 +1,35 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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/base/discrete-uniform' );
+var filledarrayBy = require( '@stdlib/array/filled-by' );
+var Complex64 = require( '@stdlib/complex/float32/ctor' );
+var scnrm2 = require( './../lib' );
+
+function rand() {
+ return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) );
+}
+
+var cx = filledarrayBy( 10, 'complex64', rand );
+console.log( cx.toString() );
+
+// Compute the L2-norm:
+var norm = scnrm2( cx.length, cx, 1 );
+console.log( norm );
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/include.gypi b/lib/node_modules/@stdlib/blas/base/scnrm2/include.gypi
new file mode 100644
index 000000000000..497aeca15320
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/include.gypi
@@ -0,0 +1,70 @@
+# @license Apache-2.0
+#
+# Copyright (c) 2024 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.
+#
+# Note that nesting variables is required due to how GYP processes a configuration. Any variables defined within a nested 'variables' section is defined in the outer scope. Thus, conditions in the outer variable scope are free to use these variables without running into "variable undefined" errors.
+#
+# Main documentation:
+#
+# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md
+# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md
+#
+# Variable nesting hacks:
+#
+# [3]: https://chromium.googlesource.com/external/skia/gyp/+/master/common_variables.gypi
+# [4]: https://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?revision=127004
+{
+ # Define variables to be used throughout the configuration for all targets:
+ 'variables': {
+ 'variables': {
+ # Host BLAS library (to override -Dblas=):
+ 'blas%': '',
+
+ # Path to BLAS library (to override -Dblas_dir=):
+ 'blas_dir%': '',
+ }, # end variables
+
+ # Source directory:
+ 'src_dir': './src',
+
+ # Include directories:
+ 'include_dirs': [
+ '<@(blas_dir)',
+ ' tbig ) {
+ abig = f32( abig + abs2f( ax * sbig ) );
+ notbig = false;
+ } else if ( ax < tsml ) {
+ if ( notbig ) {
+ asml = f32( asml + abs2f( ax * ssml ) );
+ }
+ } else {
+ amed = f32( amed + f32( ax * ax ) );
+ }
+ ax = absf( viewX[ ix + 1 ] );
+ if ( ax > tbig ) {
+ abig = f32( abig + abs2f( ax * sbig ) );
+ notbig = false;
+ } else if ( ax < tsml ) {
+ if ( notbig ) {
+ asml = f32( asml + abs2f( ax * ssml ) );
+ }
+ } else {
+ amed = f32( amed + f32( ax * ax ) );
+ }
+ ix += sx;
+ }
+ // Combine `abig` and `amed` or `amed` and `asml` if more than one accumulator was used...
+ if ( abig > 0.0 ) {
+ // Combine `abig` and `amed` if `abig` > 0...
+ if ( amed > 0.0 || ( amed > FLOAT32_MAX ) || ( amed !== amed ) ) {
+ abig = f32( abig + f32( f32( amed * sbig ) * sbig ) );
+ }
+ scl = f32( 1.0 / sbig );
+ sumsq = abig;
+ } else if ( asml > 0.0 ) {
+ // Combine `amed` and `asml` if `asml` > 0...
+ if ( amed > 0.0 || amed > FLOAT32_MAX || ( amed !== amed ) ) {
+ amed = sqrtf( amed );
+ asml = f32( sqrtf( asml ) / ssml );
+ if ( asml > amed ) {
+ ymin = amed;
+ ymax = asml;
+ } else {
+ ymin = asml;
+ ymax = amed;
+ }
+ scl = 1.0;
+ sumsq = f32( f32( ymax * ymax ) * f32( 1.0 + abs2f( ymin / ymax ) ) ); // eslint-disable-line max-len
+ } else {
+ scl = f32( 1.0 / ssml );
+ sumsq = asml;
+ }
+ } else {
+ // All values are mid-range...
+ scl = 1.0;
+ sumsq = amed;
+ }
+ return f32( sqrtf( sumsq ) * scl );
+}
+
+
+// EXPORTS //
+
+module.exports = scnrm2;
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/scnrm2/lib/ndarray.native.js
new file mode 100644
index 000000000000..e34af47ce9d9
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/lib/ndarray.native.js
@@ -0,0 +1,58 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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 minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' );
+var addon = require( './../src/addon.node' );
+
+
+// MAIN //
+
+/**
+* Computes the L2-norm of a complex single-precision floating-point vector.
+*
+* @param {PositiveInteger} N - number of indexed elements
+* @param {Complex64Array} cx - input array
+* @param {integer} strideX - `cx` stride length
+* @param {NonNegativeInteger} offsetX - starting `cx` index
+* @returns {number} L2-norm
+*
+* @example
+* var Complex64Array = require( '@stdlib/array/complex64' );
+* var scnrm2 = require( '@stdlib/blas/base/scnrm2' );
+*
+* var cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] );
+*
+* var norm = scnrm2( 4, cx, 1 );
+* // returns ~0.8
+*/
+function scnrm2( N, cx, strideX, offsetX ) {
+ var viewCX;
+ offsetX = minViewBufferIndex( N, strideX, offsetX );
+ viewCX = reinterpret( cx, offsetX );
+ return addon( N, viewCX, strideX );
+}
+
+
+// EXPORTS //
+
+module.exports = scnrm2;
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/lib/scnrm2.js b/lib/node_modules/@stdlib/blas/base/scnrm2/lib/scnrm2.js
new file mode 100644
index 000000000000..4f3f43946101
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/lib/scnrm2.js
@@ -0,0 +1,60 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var ndarray = require( './ndarray.js' );
+
+
+// MAIN //
+
+/**
+* Computes the L2-norm of a complex single-precision floating-point vector.
+*
+* @param {PositiveInteger} N - number of indexed elements
+* @param {Complex64Array} cx - input array
+* @param {integer} strideX - `cx` stride length
+* @returns {number} L2-norm
+*
+* @example
+* var Complex64Array = require( '@stdlib/array/complex64' );
+*
+* var cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] );
+*
+* var norm = scnrm2( 4, cx, 1 );
+* // returns ~0.8
+*/
+function scnrm2( N, cx, strideX ) {
+ var ox;
+ if ( N <= 0 ) {
+ return 0.0;
+ }
+ if ( strideX < 0 ) {
+ ox = ( 1 - N ) * strideX;
+ } else {
+ ox = 0;
+ }
+ return ndarray( N, cx, strideX, ox );
+}
+
+
+// EXPORTS //
+
+module.exports = scnrm2;
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/lib/scnrm2.native.js b/lib/node_modules/@stdlib/blas/base/scnrm2/lib/scnrm2.native.js
new file mode 100644
index 000000000000..6793f05b5542
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/lib/scnrm2.native.js
@@ -0,0 +1,54 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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 //
+
+/**
+* Computes the L2-norm of a complex single-precision floating-point vector.
+*
+* @param {PositiveInteger} N - number of indexed elements
+* @param {Complex64Array} cx - input array
+* @param {integer} strideX - `cx` stride length
+* @returns {number} L2-norm
+*
+* @example
+* var Complex64Array = require( '@stdlib/array/complex64' );
+* var scnrm2 = require( '@stdlib/blas/base/scnrm2' );
+*
+* var cx = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] );
+*
+* var norm = scnrm2( 4, cx, 1 );
+* // returns ~0.8
+*/
+function scnrm2( N, cx, strideX ) {
+ var viewCX = reinterpret( cx, 0 );
+ return addon( N, viewCX, strideX );
+}
+
+
+// EXPORTS //
+
+module.exports = scnrm2;
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/manifest.json b/lib/node_modules/@stdlib/blas/base/scnrm2/manifest.json
new file mode 100644
index 000000000000..17152eac553d
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/manifest.json
@@ -0,0 +1,451 @@
+{
+ "options": {
+ "task": "build",
+ "os": "linux",
+ "blas": "",
+ "wasm": false
+ },
+ "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",
+ "os": "linux",
+ "blas": "",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2.f",
+ "./src/scnrm2sub.f",
+ "./src/scnrm2_f.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/napi/export",
+ "@stdlib/napi/argv",
+ "@stdlib/napi/argv-int64",
+ "@stdlib/napi/argv-strided-complex64array",
+ "@stdlib/napi/create-double"
+ ]
+ },
+ {
+ "task": "benchmark",
+ "os": "linux",
+ "blas": "",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/math/base/special/absf",
+ "@stdlib/math/base/special/abs2f",
+ "@stdlib/math/base/special/sqrtf",
+ "@stdlib/constants/float32/max"
+ ]
+ },
+ {
+ "task": "examples",
+ "os": "linux",
+ "blas": "",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/math/base/special/absf",
+ "@stdlib/math/base/special/abs2f",
+ "@stdlib/math/base/special/sqrtf",
+ "@stdlib/constants/float32/max"
+ ]
+ },
+
+ {
+ "task": "build",
+ "os": "linux",
+ "blas": "openblas",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2_cblas.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [
+ "-lopenblas",
+ "-lpthread"
+ ],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/napi/export",
+ "@stdlib/napi/argv",
+ "@stdlib/napi/argv-int64",
+ "@stdlib/napi/argv-strided-complex64array",
+ "@stdlib/napi/create-double"
+ ]
+ },
+ {
+ "task": "benchmark",
+ "os": "linux",
+ "blas": "openblas",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2_cblas.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [
+ "-lopenblas",
+ "-lpthread"
+ ],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared"
+ ]
+ },
+ {
+ "task": "examples",
+ "os": "linux",
+ "blas": "openblas",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2_cblas.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [
+ "-lopenblas",
+ "-lpthread"
+ ],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared"
+ ]
+ },
+
+ {
+ "task": "build",
+ "os": "mac",
+ "blas": "",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2.f",
+ "./src/scnrm2sub.f",
+ "./src/scnrm2_f.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/napi/export",
+ "@stdlib/napi/argv",
+ "@stdlib/napi/argv-int64",
+ "@stdlib/napi/argv-strided-complex64array",
+ "@stdlib/napi/create-double"
+ ]
+ },
+ {
+ "task": "benchmark",
+ "os": "mac",
+ "blas": "",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/math/base/special/absf",
+ "@stdlib/math/base/special/abs2f",
+ "@stdlib/math/base/special/sqrtf",
+ "@stdlib/constants/float32/max"
+ ]
+ },
+ {
+ "task": "examples",
+ "os": "mac",
+ "blas": "",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/math/base/special/absf",
+ "@stdlib/math/base/special/abs2f",
+ "@stdlib/math/base/special/sqrtf",
+ "@stdlib/constants/float32/max"
+ ]
+ },
+
+ {
+ "task": "build",
+ "os": "mac",
+ "blas": "apple_accelerate_framework",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2_cblas.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [
+ "-lblas"
+ ],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/napi/export",
+ "@stdlib/napi/argv",
+ "@stdlib/napi/argv-int64",
+ "@stdlib/napi/argv-strided-complex64array",
+ "@stdlib/napi/create-double"
+ ]
+ },
+ {
+ "task": "benchmark",
+ "os": "mac",
+ "blas": "apple_accelerate_framework",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2_cblas.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [
+ "-lblas"
+ ],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared"
+ ]
+ },
+ {
+ "task": "examples",
+ "os": "mac",
+ "blas": "apple_accelerate_framework",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2_cblas.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [
+ "-lblas"
+ ],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared"
+ ]
+ },
+
+ {
+ "task": "build",
+ "os": "mac",
+ "blas": "openblas",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2_cblas.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [
+ "-lopenblas",
+ "-lpthread"
+ ],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/napi/export",
+ "@stdlib/napi/argv",
+ "@stdlib/napi/argv-int64",
+ "@stdlib/napi/argv-strided-complex64array",
+ "@stdlib/napi/create-double"
+ ]
+ },
+ {
+ "task": "benchmark",
+ "os": "mac",
+ "blas": "openblas",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2_cblas.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [
+ "-lopenblas",
+ "-lpthread"
+ ],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared"
+ ]
+ },
+ {
+ "task": "examples",
+ "os": "mac",
+ "blas": "openblas",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2_cblas.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [
+ "-lopenblas",
+ "-lpthread"
+ ],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared"
+ ]
+ },
+
+ {
+ "task": "build",
+ "os": "win",
+ "blas": "",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/napi/export",
+ "@stdlib/napi/argv",
+ "@stdlib/napi/argv-int64",
+ "@stdlib/napi/argv-strided-complex64array",
+ "@stdlib/napi/create-double",
+ "@stdlib/math/base/special/absf",
+ "@stdlib/math/base/special/abs2f",
+ "@stdlib/math/base/special/sqrtf",
+ "@stdlib/constants/float32/max"
+ ]
+ },
+ {
+ "task": "benchmark",
+ "os": "win",
+ "blas": "",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/math/base/special/absf",
+ "@stdlib/math/base/special/abs2f",
+ "@stdlib/math/base/special/sqrtf",
+ "@stdlib/constants/float32/max"
+ ]
+ },
+ {
+ "task": "examples",
+ "os": "win",
+ "blas": "",
+ "wasm": false,
+ "src": [
+ "./src/scnrm2.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/math/base/special/absf",
+ "@stdlib/math/base/special/abs2f",
+ "@stdlib/math/base/special/sqrtf",
+ "@stdlib/constants/float32/max"
+ ]
+ },
+
+ {
+ "task": "build",
+ "os": "",
+ "blas": "",
+ "wasm": true,
+ "src": [
+ "./src/scnrm2.c"
+ ],
+ "include": [
+ "./include"
+ ],
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/math/base/special/absf",
+ "@stdlib/math/base/special/abs2f",
+ "@stdlib/math/base/special/sqrtf",
+ "@stdlib/constants/float32/max"
+ ]
+ }
+ ]
+}
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/package.json b/lib/node_modules/@stdlib/blas/base/scnrm2/package.json
new file mode 100644
index 000000000000..39b8dd118f1a
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/package.json
@@ -0,0 +1,76 @@
+{
+ "name": "@stdlib/blas/base/scnrm2",
+ "version": "0.0.0",
+ "description": "Compute the L2-norm of a complex single-precision floating-point vector.",
+ "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",
+ "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",
+ "level 1",
+ "scnrm2",
+ "euclidean",
+ "norm",
+ "euclidean-norm",
+ "linear",
+ "algebra",
+ "subroutines",
+ "vector",
+ "array",
+ "ndarray",
+ "float32",
+ "float",
+ "single",
+ "float32array"
+ ]
+}
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/src/Makefile b/lib/node_modules/@stdlib/blas/base/scnrm2/src/Makefile
new file mode 100644
index 000000000000..bcf18aa46655
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/Makefile
@@ -0,0 +1,70 @@
+#/
+# @license Apache-2.0
+#
+# Copyright (c) 2024 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/base/scnrm2/src/addon.c b/lib/node_modules/@stdlib/blas/base/scnrm2/src/addon.c
new file mode 100644
index 000000000000..082e9a12ea12
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/addon.c
@@ -0,0 +1,45 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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/base/scnrm2.h"
+#include "stdlib/blas/base/shared.h"
+#include "stdlib/napi/export.h"
+#include "stdlib/napi/argv.h"
+#include "stdlib/napi/argv_int64.h"
+#include "stdlib/napi/argv_strided_complex64array.h"
+#include "stdlib/napi/create_double.h"
+#include
+
+/**
+* Receives JavaScript callback invocation data.
+*
+* @private
+* @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, 3 );
+ STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
+ STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 );
+ STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, CX, N, strideX, argv, 1 );
+ STDLIB_NAPI_CREATE_DOUBLE( env, (double)API_SUFFIX(c_scnrm2)( N, CX, strideX ), norm );
+ return norm;
+}
+
+STDLIB_NAPI_MODULE_EXPORT_FCN( addon )
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.c b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.c
new file mode 100644
index 000000000000..8c17b8dc0e0a
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.c
@@ -0,0 +1,127 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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/base/scnrm2.h"
+#include "stdlib/blas/base/shared.h"
+#include "stdlib/math/base/special/absf.h"
+#include "stdlib/math/base/special/abs2f.h"
+#include "stdlib/math/base/special/sqrtf.h"
+#include "stdlib/constants/float32/max.h"
+#include
+
+// Blue's scaling constants...
+static const float tsml = 1.08420217E-19f;
+static const float tbig = 4.50359963E+15f;
+static const float ssml = 3.77789319E+22f;
+static const float sbig = 1.32348898E-23f;
+
+/**
+* Computes the L2-norm of a complex single-precision floating-point vector.
+*
+* @param N number of indexed elements
+* @param CX input array
+* @param strideX CX stride length
+*/
+float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX ) {
+ float *x = (float *)CX;
+ CBLAS_INT sx;
+ CBLAS_INT ix;
+ bool notbig;
+ CBLAS_INT i;
+ float sumsq;
+ float abig;
+ float amed;
+ float asml;
+ float ymax;
+ float ymin;
+ float scl;
+ float ax;
+
+ if ( N <= 0 ) {
+ return 0.0f;
+ }
+ sx = strideX * 2;
+ if ( sx < 0 ) {
+ ix = ( 1 - N ) * sx;
+ } else {
+ ix = 0;
+ }
+ // Compute the sum of squares using 3 accumulators--`abig` (sum of squares scaled down to avoid overflow), `asml` (sum of squares scaled up to avoid underflow), `amed` (sum of squares that do not require scaling)--and thresholds and multipliers--`tbig` (values bigger than this are scaled down by `sbig`) and `tsml` (values smaller than this are scaled up by `ssml`)...
+ notbig = true;
+ sumsq = 0.0f;
+ abig = 0.0f;
+ amed = 0.0f;
+ asml = 0.0f;
+ for ( i = 0; i < N; i++ ) {
+ ax = stdlib_base_absf( x[ ix ] );
+ if ( ax > tbig ) {
+ abig += stdlib_base_abs2f( ax * sbig );
+ notbig = false;
+ } else if ( ax < tsml ) {
+ if ( notbig ) {
+ asml += stdlib_base_abs2f( ax * ssml );
+ }
+ } else {
+ amed += stdlib_base_abs2f( ax );
+ }
+ ax = stdlib_base_absf( x[ ix + 1 ] );
+ if ( ax > tbig ) {
+ abig += stdlib_base_abs2f( ax * sbig );
+ notbig = false;
+ } else if ( ax < tsml ) {
+ if ( notbig ) {
+ asml += stdlib_base_abs2f( ax * ssml );
+ }
+ } else {
+ amed += stdlib_base_abs2f( ax );
+ }
+ ix += sx;
+ }
+ // Combine `abig` and `amed` or `amed` and `asml` if more than one accumulator was used...
+ if ( abig > 0.0f ) {
+ // Combine `abig` and `amed` if `abig` > 0...
+ if ( amed > 0.0f || ( amed > STDLIB_CONSTANT_FLOAT32_MAX ) || ( amed != amed ) ) {
+ abig += ( amed * sbig ) * sbig;
+ }
+ scl = 1.0f / sbig;
+ sumsq = abig;
+ } else if ( asml > 0.0f ) {
+ // Combine `amed` and `asml` if `asml` > 0...
+ if ( amed > 0.0f || amed > STDLIB_CONSTANT_FLOAT32_MAX || ( amed != amed ) ) {
+ amed = stdlib_base_sqrtf( amed );
+ asml = stdlib_base_sqrtf( asml ) / ssml;
+ if ( asml > amed ) {
+ ymin = amed;
+ ymax = asml;
+ } else {
+ ymin = asml;
+ ymax = amed;
+ }
+ scl = 1.0f;
+ sumsq = stdlib_base_abs2f( ymax ) * ( 1.0 + stdlib_base_abs2f( ymin / ymax ) );
+ } else {
+ scl = 1.0f / ssml;
+ sumsq = asml;
+ }
+ } else {
+ // All values are mid-range...
+ scl = 1.0f;
+ sumsq = amed;
+ }
+ return stdlib_base_sqrtf( sumsq ) * scl;
+}
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.f b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.f
new file mode 100644
index 000000000000..6ac53d953b73
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.f
@@ -0,0 +1,165 @@
+!>
+! @license Apache-2.0
+!
+! Copyright (c) 2024 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.
+!<
+
+!> Computes the L2-norm of a complex single-precision floating-point vector.
+!
+! ## Notes
+!
+! * Modified version of reference BLAS level1 routine (version 3.8.0). Updated to "free form" Fortran 95.
+!
+! ## Authors
+!
+! * Edward Anderson, Lockheed Martin
+! * Weslley Pereira, University of Colorado Denver, USA
+!
+! ## History
+!
+! * Original version written on August 2016.
+!
+! ## License
+!
+! From :
+!
+! > The reference BLAS is a freely-available software package. It is available from netlib via anonymous ftp and the World Wide Web. Thus, it can be included in commercial software packages (and has been). We only ask that proper credit be given to the authors.
+! >
+! > Like all software, it is copyrighted. It is not trademarked, but we do ask the following:
+! >
+! > * If you modify the source for these routines we ask that you change the name of the routine and comment the changes made to the original.
+! >
+! > * We will gladly answer any questions regarding the software. If a modification is done, however, it is the responsibility of the person who modified the routine to provide support.
+!
+! @param {integer} N - number of indexed elements
+! @param {Array} cx - array
+! @param {integer} strideX - `cx` stride length
+! @returns {real} L2-norm
+!<
+real function scnrm2( N, cx, strideX )
+ implicit none
+ ! ..
+ ! Define a kind parameter for single precision:
+ integer, parameter :: wp = kind( 1.0e0 )
+ ! ..
+ ! Define constants:
+ real( wp ), parameter :: zero = 0.0_wp
+ real( wp ), parameter :: one = 1.0_wp
+ real( wp ), parameter :: maxN = huge( 0.0_wp )
+ ! ..
+ ! Blue's scaling constants:
+ real(wp), parameter :: tsml = 1.08420217e-19_wp
+ real(wp), parameter :: tbig = 4.50359963e15_wp
+ real(wp), parameter :: ssml = 3.77789319e22_wp
+ real(wp), parameter :: sbig = 1.32348898e-23_wp
+ !..
+ ! Scalar arguments:
+ integer :: N, strideX
+ ! ..
+ ! Array arguments:
+ complex( wp ) :: cx( * )
+ ! ..
+ ! Local scalars:
+ integer :: i, ix
+ logical :: notbig
+ real( wp ) :: abig, amed, asml, ax, scl, sumsq, ymax, ymin
+ ! ..
+ ! Intrinsic functions:
+ intrinsic abs, sqrt
+ ! ..
+ scnrm2 = zero
+ ! ..
+ if ( N <= 0 ) return
+ ! ..
+ scl = one
+ sumsq = zero
+ ! ..
+ ! Compute the sum of squares in 3 accumulators:
+ ! abig -- sums of squares scaled down to avoid overflow
+ ! asml -- sums of squares scaled up to avoid underflow
+ ! amed -- sums of squares that do not require scaling
+ ! Thresholds and multipliers:
+ ! tbig -- values bigger than this are scaled down by sbig
+ ! tsml -- values smaller than this are scaled up by ssml
+ ! ..
+ notbig = .true.
+ asml = zero
+ amed = zero
+ abig = zero
+ ix = 1
+ if ( strideX < 0 ) then
+ ix = 1 - ( N - 1 ) * strideX
+ end if
+ ! ..
+ do i = 1, N
+ ax = abs( real( cx( ix ) ) )
+ if ( ax > tbig ) then
+ abig = abig + ( ax * sbig )**2
+ notbig = .false.
+ else if ( ax < tsml ) then
+ if ( notbig ) then
+ asml = asml + ( ax * ssml )**2
+ end if
+ else
+ amed = amed + ax**2
+ end if
+ ax = abs( aimag( cx( ix ) ) )
+ if ( ax > tbig ) then
+ abig = abig + ( ax * sbig )**2
+ notbig = .false.
+ else if ( ax < tsml ) then
+ if ( notbig ) then
+ asml = asml + ( ax * ssml )**2
+ end if
+ else
+ amed = amed + ( ax**2 )
+ end if
+ ix = ix + strideX
+ end do
+ ! ..
+ ! Combine abig and amed or amed and asml if more than one accumulator was used:
+ if ( abig > zero ) then
+ ! Combine abig and amed if abig > 0...
+ if ( ( amed > zero ) .or. ( amed > maxN ) .or. ( amed /= amed ) ) then
+ abig = abig + ( amed * sbig ) * sbig
+ end if
+ scl = one / sbig
+ sumsq = abig
+ else if ( asml > zero ) then
+ ! Combine amed and asml if asml > 0...
+ if ( ( amed > zero ) .or. ( amed > maxN ) .or. ( amed /= amed ) ) then
+ amed = sqrt( amed )
+ asml = sqrt( asml ) / ssml
+ if ( asml > amed ) then
+ ymin = amed
+ ymax = asml
+ else
+ ymin = asml
+ ymax = amed
+ end if
+ scl = one
+ sumsq = ymax**2 * ( one + ( ymin / ymax )**2 )
+ else
+ scl = one / ssml
+ sumsq = asml
+ end if
+ else
+ ! All values are mid-range...
+ scl = one
+ sumsq = amed
+ end if
+ scnrm2 = scl * sqrt( sumsq )
+ return
+end function scnrm2
\ No newline at end of file
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_cblas.c b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_cblas.c
new file mode 100644
index 000000000000..532a7000fd18
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_cblas.c
@@ -0,0 +1,32 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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/base/scnrm2.h"
+#include "stdlib/blas/base/scnrm2_cblas.h"
+#include "stdlib/blas/base/shared.h"
+
+/**
+* Computes the L2-norm of a complex single-precision floating-point vector.
+*
+* @param N number of indexed elements
+* @param CX input array
+* @param strideX CX stride length
+*/
+float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX ) {
+ return API_SUFFIX(cblas_scnrm2)( N, CX, strideX );
+}
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_f.c b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_f.c
new file mode 100644
index 000000000000..d7332f87cadd
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_f.c
@@ -0,0 +1,35 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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/base/scnrm2.h"
+#include "stdlib/blas/base/scnrm2_fortran.h"
+#include "stdlib/blas/base/shared.h"
+
+/**
+* Computes the L2-norm of a complex single-precision floating-point vector.
+*
+* @param N number of indexed elements
+* @param CX input array
+* @param strideX CX stride length
+* @return L2-norm
+*/
+float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX ) {
+ float nrm2;
+ scnrm2sub( &N, CX, &strideX, &nrm2 );
+ return nrm2;
+}
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2sub.f b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2sub.f
new file mode 100644
index 000000000000..eb2fc946fdbd
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2sub.f
@@ -0,0 +1,47 @@
+!>
+! @license Apache-2.0
+!
+! Copyright (c) 2024 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.
+!<
+
+!> Wraps `scnrm2` as a subroutine.
+!
+! @param {integer} N - number of indexed elements
+! @param {Array} cx - input array
+! @param {integer} strideX - `cx` stride length
+! @param {real} nrm2 - output variable reference
+!<
+subroutine scnrm2sub( N, cx, strideX, nrm2 )
+ implicit none
+ ! ..
+ ! External functions:
+ interface
+ real function scnrm2( N, cx, strideX )
+ complex :: cx(*)
+ integer :: strideX, N
+ end function scnrm2
+ end interface
+ ! ..
+ ! Scalar arguments:
+ integer :: strideX, N
+ real :: nrm2
+ ! ..
+ ! Array arguments:
+ complex :: cx(*)
+ ! ..
+ ! Compute the L2-norm:
+ nrm2 = scnrm2( N, cx, strideX )
+ return
+end subroutine scnrm2sub
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.js b/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.js
new file mode 100644
index 000000000000..1b86c01e265e
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.js
@@ -0,0 +1,82 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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 isBrowser = require( '@stdlib/assert/is-browser' );
+var scnrm2 = require( './../lib' );
+
+
+// VARIABLES //
+
+var opts = {
+ 'skip': isBrowser
+};
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof scnrm2, '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 scnrm2.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 scnrm2 = proxyquire( './../lib', {
+ '@stdlib/utils/try-require': tryRequire
+ });
+
+ t.strictEqual( scnrm2, 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 scnrm2;
+ var main;
+
+ main = require( './../lib/scnrm2.js' );
+
+ scnrm2 = proxyquire( './../lib', {
+ '@stdlib/utils/try-require': tryRequire
+ });
+
+ t.strictEqual( scnrm2, main, 'returns JavaScript implementation' );
+ t.end();
+
+ function tryRequire() {
+ return new Error( 'Cannot find module' );
+ }
+});
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.ndarray.js
new file mode 100644
index 000000000000..623b713a6c11
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.ndarray.js
@@ -0,0 +1,212 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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 Complex64Array = require( '@stdlib/array/complex64' );
+var EPS = require( '@stdlib/constants/float64/eps' );
+var abs = require( '@stdlib/math/base/special/abs' );
+var scnrm2 = require( './../lib/ndarray.js' );
+
+
+// FUNCTIONS //
+
+/**
+* Tests for element-wise approximate equality.
+*
+* @private
+* @param {Object} t - test object
+* @param {Collection} actual - actual values
+* @param {Collection} expected - expected values
+* @param {number} rtol - relative tolerance
+*/
+function isApprox( t, actual, expected, rtol ) {
+ var delta;
+ var tol;
+ var i;
+
+ t.strictEqual( actual.length, expected.length, 'returns expected value' );
+ for ( i = 0; i < expected.length; i++ ) {
+ if ( actual[ i ] === expected[ i ] ) {
+ t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' );
+ } else {
+ delta = abs( actual[ i ] - expected[ i ] );
+ tol = rtol * EPS * abs( expected[ i ] );
+ t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' );
+ }
+ }
+}
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof scnrm2, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function has an arity of 4', function test( t ) {
+ t.strictEqual( scnrm2.length, 4, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function computes the L2-norm', function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 0.3, // 1
+ 0.1, // 1
+ 0.5, // 2
+ 0.0, // 2
+ 0.0, // 3
+ 0.5, // 3
+ 0.0, // 4
+ 0.2, // 4
+ 2.0,
+ 3.0
+ ]);
+ expected = 0.8;
+
+ actual = scnrm2( 4, cx, 1, 0 );
+ isApprox( t, actual, expected, 2.0 );
+
+ cx = new Complex64Array([
+ 0.1, // 1
+ 0.1, // 1
+ -0.6, // 2
+ 0.1, // 2
+ 0.1, // 3
+ -0.3, // 3
+ 7.0,
+ 8.0
+ ]);
+ expected = 0.7;
+
+ actual = scnrm2( 3, cx, 1, 0 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
+
+tape( 'if provided an `N` parameter less than `1`, the function returns `0.0`', function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 1.0,
+ 2.0,
+ 3.0,
+ 4.0
+ ]);
+ expected = 0.0;
+
+ actual = scnrm2( 0, cx, 1, 0 );
+ t.strictEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports specifying a stride', function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 0.3, // 1
+ 0.1, // 1
+ 5.0,
+ 8.0,
+ 0.5, // 2
+ 0.0, // 2
+ 6.0,
+ 9.0,
+ 0.0, // 3
+ 0.5, // 3
+ 8.0,
+ 3.0,
+ 0.0, // 4
+ 0.2, // 4
+ 9.0,
+ 4.0
+ ]);
+ expected = 0.8;
+
+ actual = scnrm2( 4, cx, 2, 0 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
+
+tape( 'the function supports specifying a negative stride', function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 0.3, // 1
+ 0.1, // 1
+ 5.0,
+ 8.0,
+ 0.5, // 2
+ 0.0, // 2
+ 6.0,
+ 9.0,
+ 0.0, // 3
+ 0.5, // 3
+ 8.0,
+ 3.0,
+ 0.0, // 4
+ 0.2, // 4
+ 9.0,
+ 4.0
+ ]);
+ expected = 0.8;
+
+ actual = scnrm2( 4, cx, -2, 6 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
+
+tape( 'the function supports specifying an offset', function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 1.0,
+ 2.0,
+ 3.0, // 1
+ 4.0, // 1
+ 5.0, // 2
+ 6.0, // 2
+ 7.0, // 3
+ 8.0, // 3
+ 9.0,
+ 10.0
+ ]);
+ expected = 14.1;
+
+ actual = scnrm2( 3, cx, 1, 1 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.ndarray.native.js
new file mode 100644
index 000000000000..414ac856f794
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.ndarray.native.js
@@ -0,0 +1,221 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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 tape = require( 'tape' );
+var Complex64Array = require( '@stdlib/array/complex64' );
+var EPS = require( '@stdlib/constants/float64/eps' );
+var abs = require( '@stdlib/math/base/special/abs' );
+var tryRequire = require( '@stdlib/utils/try-require' );
+
+
+// VARIABLES //
+
+var scnrm2 = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) );
+var opts = {
+ 'skip': ( scnrm2 instanceof Error )
+};
+
+
+// FUNCTIONS //
+
+/**
+* Tests for element-wise approximate equality.
+*
+* @private
+* @param {Object} t - test object
+* @param {Collection} actual - actual values
+* @param {Collection} expected - expected values
+* @param {number} rtol - relative tolerance
+*/
+function isApprox( t, actual, expected, rtol ) {
+ var delta;
+ var tol;
+ var i;
+
+ t.strictEqual( actual.length, expected.length, 'returns expected value' );
+ for ( i = 0; i < expected.length; i++ ) {
+ if ( actual[ i ] === expected[ i ] ) {
+ t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' );
+ } else {
+ delta = abs( actual[ i ] - expected[ i ] );
+ tol = rtol * EPS * abs( expected[ i ] );
+ t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' );
+ }
+ }
+}
+
+
+// TESTS //
+
+tape( 'main export is a function', opts, function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof scnrm2, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function has an arity of 4', opts, function test( t ) {
+ t.strictEqual( scnrm2.length, 4, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function computes the L2-norm', opts, function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 0.3, // 1
+ 0.1, // 1
+ 0.5, // 2
+ 0.0, // 2
+ 0.0, // 3
+ 0.5, // 3
+ 0.0, // 4
+ 0.2, // 4
+ 2.0,
+ 3.0
+ ]);
+ expected = 0.8;
+
+ actual = scnrm2( 4, cx, 1, 0 );
+ isApprox( t, actual, expected, 2.0 );
+
+ cx = new Complex64Array([
+ 0.1, // 1
+ 0.1, // 1
+ -0.6, // 2
+ 0.1, // 2
+ 0.1, // 3
+ -0.3, // 3
+ 7.0,
+ 8.0
+ ]);
+ expected = 0.7;
+
+ actual = scnrm2( 3, cx, 1, 0 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
+
+tape( 'if provided an `N` parameter less than `1`, the function returns `0.0`', opts, function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 1.0,
+ 2.0,
+ 3.0,
+ 4.0
+ ]);
+ expected = 0.0;
+
+ actual = scnrm2( 0, cx, 1, 0 );
+ t.strictEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports specifying a stride', opts, function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 0.3, // 1
+ 0.1, // 1
+ 5.0,
+ 8.0,
+ 0.5, // 2
+ 0.0, // 2
+ 6.0,
+ 9.0,
+ 0.0, // 3
+ 0.5, // 3
+ 8.0,
+ 3.0,
+ 0.0, // 4
+ 0.2, // 4
+ 9.0,
+ 4.0
+ ]);
+ expected = 0.8;
+
+ actual = scnrm2( 4, cx, 2, 0 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
+
+tape( 'the function supports specifying a negative stride', opts, function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 0.3, // 1
+ 0.1, // 1
+ 5.0,
+ 8.0,
+ 0.5, // 2
+ 0.0, // 2
+ 6.0,
+ 9.0,
+ 0.0, // 3
+ 0.5, // 3
+ 8.0,
+ 3.0,
+ 0.0, // 4
+ 0.2, // 4
+ 9.0,
+ 4.0
+ ]);
+ expected = 0.8;
+
+ actual = scnrm2( 4, cx, -2, 6 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
+
+tape( 'the function supports specifying an offset', opts, function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 1.0,
+ 2.0,
+ 3.0, // 1
+ 4.0, // 1
+ 5.0, // 2
+ 6.0, // 2
+ 7.0, // 3
+ 8.0, // 3
+ 9.0,
+ 10.0
+ ]);
+ expected = 14.1;
+
+ actual = scnrm2( 3, cx, 1, 1 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.scnrm2.js b/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.scnrm2.js
new file mode 100644
index 000000000000..f63b477fb680
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.scnrm2.js
@@ -0,0 +1,215 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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 Complex64Array = require( '@stdlib/array/complex64' );
+var EPS = require( '@stdlib/constants/float64/eps' );
+var abs = require( '@stdlib/math/base/special/abs' );
+var scnrm2 = require( './../lib/scnrm2.js' );
+
+
+// FUNCTIONS //
+
+/**
+* Tests for element-wise approximate equality.
+*
+* @private
+* @param {Object} t - test object
+* @param {Collection} actual - actual values
+* @param {Collection} expected - expected values
+* @param {number} rtol - relative tolerance
+*/
+function isApprox( t, actual, expected, rtol ) {
+ var delta;
+ var tol;
+ var i;
+
+ t.strictEqual( actual.length, expected.length, 'returns expected value' );
+ for ( i = 0; i < expected.length; i++ ) {
+ if ( actual[ i ] === expected[ i ] ) {
+ t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' );
+ } else {
+ delta = abs( actual[ i ] - expected[ i ] );
+ tol = rtol * EPS * abs( expected[ i ] );
+ t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' );
+ }
+ }
+}
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof scnrm2, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function has an arity of 3', function test( t ) {
+ t.strictEqual( scnrm2.length, 3, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function computes the L2-norm', function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 0.3, // 1
+ 0.1, // 1
+ 0.5, // 2
+ 0.0, // 2
+ 0.0, // 3
+ 0.5, // 3
+ 0.0, // 4
+ 0.2, // 4
+ 2.0,
+ 3.0
+ ]);
+ expected = 0.8;
+
+ actual = scnrm2( 4, cx, 1 );
+ isApprox( t, actual, expected, 2.0 );
+
+ cx = new Complex64Array([
+ 0.1, // 1
+ 0.1, // 1
+ -0.6, // 2
+ 0.1, // 2
+ 0.1, // 3
+ -0.3, // 3
+ 7.0,
+ 8.0
+ ]);
+ expected = 0.7;
+
+ actual = scnrm2( 3, cx, 1 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
+
+tape( 'if provided an `N` parameter less than `1`, the function returns `0.0`', function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 1.0,
+ 2.0,
+ 3.0,
+ 4.0
+ ]);
+ expected = 0.0;
+
+ actual = scnrm2( 0, cx, 1 );
+ t.strictEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports specifying a stride', function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 0.3, // 1
+ 0.1, // 1
+ 5.0,
+ 8.0,
+ 0.5, // 2
+ 0.0, // 2
+ 6.0,
+ 9.0,
+ 0.0, // 3
+ 0.5, // 3
+ 8.0,
+ 3.0,
+ 0.0, // 4
+ 0.2, // 4
+ 9.0,
+ 4.0
+ ]);
+ expected = 0.8;
+
+ actual = scnrm2( 4, cx, 2 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
+
+tape( 'the function supports specifying a negative stride', function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 0.3, // 1
+ 0.1, // 1
+ 5.0,
+ 8.0,
+ 0.5, // 2
+ 0.0, // 2
+ 6.0,
+ 9.0,
+ 0.0, // 3
+ 0.5, // 3
+ 8.0,
+ 3.0,
+ 0.0, // 4
+ 0.2, // 4
+ 9.0,
+ 4.0
+ ]);
+ expected = 0.8;
+
+ actual = scnrm2( 4, cx, -2 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
+
+tape( 'the function supports view offsets', function test( t ) {
+ var expected;
+ var actual;
+ var cx0;
+ var cx1;
+
+ cx0 = new Complex64Array([
+ 1.0,
+ 2.0,
+ 3.0, // 1
+ 4.0, // 1
+ 5.0, // 2
+ 6.0, // 2
+ 7.0, // 3
+ 8.0, // 3
+ 9.0,
+ 10.0
+ ]);
+ expected = 14.1;
+
+ cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 );
+
+ actual = scnrm2( 3, cx1, 1 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.scnrm2.native.js b/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.scnrm2.native.js
new file mode 100644
index 000000000000..1df4cdd38eeb
--- /dev/null
+++ b/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.scnrm2.native.js
@@ -0,0 +1,224 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 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 tape = require( 'tape' );
+var Complex64Array = require( '@stdlib/array/complex64' );
+var EPS = require( '@stdlib/constants/float64/eps' );
+var abs = require( '@stdlib/math/base/special/abs' );
+var tryRequire = require( '@stdlib/utils/try-require' );
+
+
+// VARIABLES //
+
+var scnrm2 = tryRequire( resolve( __dirname, './../lib/scnrm2.native.js' ) );
+var opts = {
+ 'skip': ( scnrm2 instanceof Error )
+};
+
+
+// FUNCTIONS //
+
+/**
+* Tests for element-wise approximate equality.
+*
+* @private
+* @param {Object} t - test object
+* @param {Collection} actual - actual values
+* @param {Collection} expected - expected values
+* @param {number} rtol - relative tolerance
+*/
+function isApprox( t, actual, expected, rtol ) {
+ var delta;
+ var tol;
+ var i;
+
+ t.strictEqual( actual.length, expected.length, 'returns expected value' );
+ for ( i = 0; i < expected.length; i++ ) {
+ if ( actual[ i ] === expected[ i ] ) {
+ t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' );
+ } else {
+ delta = abs( actual[ i ] - expected[ i ] );
+ tol = rtol * EPS * abs( expected[ i ] );
+ t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' );
+ }
+ }
+}
+
+
+// TESTS //
+
+tape( 'main export is a function', opts, function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof scnrm2, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function has an arity of 3', opts, function test( t ) {
+ t.strictEqual( scnrm2.length, 3, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function computes the L2-norm', opts, function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 0.3, // 1
+ 0.1, // 1
+ 0.5, // 2
+ 0.0, // 2
+ 0.0, // 3
+ 0.5, // 3
+ 0.0, // 4
+ 0.2, // 4
+ 2.0,
+ 3.0
+ ]);
+ expected = 0.8;
+
+ actual = scnrm2( 4, cx, 1 );
+ isApprox( t, actual, expected, 2.0 );
+
+ cx = new Complex64Array([
+ 0.1, // 1
+ 0.1, // 1
+ -0.6, // 2
+ 0.1, // 2
+ 0.1, // 3
+ -0.3, // 3
+ 7.0,
+ 8.0
+ ]);
+ expected = 0.7;
+
+ actual = scnrm2( 3, cx, 1 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
+
+tape( 'if provided an `N` parameter less than `1`, the function returns `0.0`', opts, function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 1.0,
+ 2.0,
+ 3.0,
+ 4.0
+ ]);
+ expected = 0.0;
+
+ actual = scnrm2( 0, cx, 1 );
+ t.strictEqual( actual, expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports specifying a stride', opts, function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 0.3, // 1
+ 0.1, // 1
+ 5.0,
+ 8.0,
+ 0.5, // 2
+ 0.0, // 2
+ 6.0,
+ 9.0,
+ 0.0, // 3
+ 0.5, // 3
+ 8.0,
+ 3.0,
+ 0.0, // 4
+ 0.2, // 4
+ 9.0,
+ 4.0
+ ]);
+ expected = 0.8;
+
+ actual = scnrm2( 4, cx, 2 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
+
+tape( 'the function supports specifying a negative stride', opts, function test( t ) {
+ var expected;
+ var actual;
+ var cx;
+
+ cx = new Complex64Array([
+ 0.3, // 1
+ 0.1, // 1
+ 5.0,
+ 8.0,
+ 0.5, // 2
+ 0.0, // 2
+ 6.0,
+ 9.0,
+ 0.0, // 3
+ 0.5, // 3
+ 8.0,
+ 3.0,
+ 0.0, // 4
+ 0.2, // 4
+ 9.0,
+ 4.0
+ ]);
+ expected = 0.8;
+
+ actual = scnrm2( 4, cx, -2 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});
+
+tape( 'the function supports view offsets', opts, function test( t ) {
+ var expected;
+ var actual;
+ var cx0;
+ var cx1;
+
+ cx0 = new Complex64Array([
+ 1.0,
+ 2.0,
+ 3.0, // 1
+ 4.0, // 1
+ 5.0, // 2
+ 6.0, // 2
+ 7.0, // 3
+ 8.0, // 3
+ 9.0,
+ 10.0
+ ]);
+ expected = 14.1;
+
+ cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 );
+
+ actual = scnrm2( 3, cx1, 1 );
+ isApprox( t, actual, expected, 2.0 );
+ t.end();
+});