From c21403cd283de02304933645c3c97cd4117be0f9 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 2 Jun 2025 22:04:06 +0530 Subject: [PATCH 1/2] docs: change variable naming for blas/base/scnrm2 --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/scnrm2/README.md | 66 +++---- .../blas/base/scnrm2/benchmark/benchmark.js | 4 +- .../base/scnrm2/benchmark/benchmark.native.js | 4 +- .../scnrm2/benchmark/benchmark.ndarray.js | 4 +- .../benchmark/benchmark.ndarray.native.js | 4 +- .../scnrm2/benchmark/c/benchmark.length.c | 16 +- .../benchmark/fortran/benchmark.length.f | 6 +- .../@stdlib/blas/base/scnrm2/docs/repl.txt | 36 ++-- .../blas/base/scnrm2/docs/types/index.d.ts | 34 ++-- .../blas/base/scnrm2/docs/types/test.ts | 170 +++++++++--------- .../blas/base/scnrm2/examples/c/example.c | 6 +- .../blas/base/scnrm2/examples/index.js | 6 +- .../scnrm2/include/stdlib/blas/base/scnrm2.h | 4 +- .../include/stdlib/blas/base/scnrm2_cblas.h | 2 +- .../@stdlib/blas/base/scnrm2/lib/index.js | 8 +- .../@stdlib/blas/base/scnrm2/lib/ndarray.js | 14 +- .../blas/base/scnrm2/lib/ndarray.native.js | 16 +- .../@stdlib/blas/base/scnrm2/lib/scnrm2.js | 12 +- .../blas/base/scnrm2/lib/scnrm2.native.js | 14 +- .../@stdlib/blas/base/scnrm2/src/addon.c | 8 +- .../@stdlib/blas/base/scnrm2/src/scnrm2.c | 8 +- .../@stdlib/blas/base/scnrm2/src/scnrm2.f | 14 +- .../blas/base/scnrm2/src/scnrm2_cblas.c | 22 +-- .../@stdlib/blas/base/scnrm2/src/scnrm2_f.c | 22 +-- .../blas/base/scnrm2/src/scnrm2_ndarray.c | 12 +- .../@stdlib/blas/base/scnrm2/src/scnrm2sub.f | 14 +- .../blas/base/scnrm2/test/test.ndarray.js | 54 +++--- .../base/scnrm2/test/test.ndarray.native.js | 34 ++-- .../blas/base/scnrm2/test/test.scnrm2.js | 38 ++-- .../base/scnrm2/test/test.scnrm2.native.js | 38 ++-- 30 files changed, 345 insertions(+), 345 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/README.md b/lib/node_modules/@stdlib/blas/base/scnrm2/README.md index 2d964a481936..97be0e87e548 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/README.md +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/README.md @@ -30,33 +30,33 @@ limitations under the License. var scnrm2 = require( '@stdlib/blas/base/scnrm2' ); ``` -#### scnrm2( N, cx, strideX ) +#### scnrm2( N, x, 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 x = new Complex64Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); -var norm = scnrm2( 4, cx, 1 ); +var norm = scnrm2( 4, x, 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`. +- **x**: input [`Complex64Array`][@stdlib/array/complex64]. +- **strideX**: index increment for `x`. 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 x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var norm = scnrm2( 2, cx, 2 ); +var norm = scnrm2( 2, x, 2 ); // returns ~4.6 ``` @@ -66,26 +66,26 @@ Note that indexing is relative to the first index. To introduce an offset, use [ var Complex64Array = require( '@stdlib/array/complex64' ); // Initial array: -var cx0 = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +var x0 = 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 +var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Compute the L2-norm: -var norm = scnrm2( 2, cx1, 1 ); +var norm = scnrm2( 2, x1, 1 ); // returns ~9.3 ``` -#### scnrm2.ndarray( N, cx, strideX, offset ) +#### scnrm2.ndarray( N, x, 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 x = 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 ); +var norm = scnrm2.ndarray( 4, x, 1, 0 ); // returns ~0.8 ``` @@ -98,9 +98,9 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); -var cx = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +var x = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var norm = scnrm2.ndarray( 2, cx, 1, 1 ); +var norm = scnrm2.ndarray( 2, x, 1, 1 ); // returns ~9.3 ``` @@ -135,11 +135,11 @@ function rand() { return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var cx = filledarrayBy( 10, 'complex64', rand ); -console.log( cx.toString() ); +var x = filledarrayBy( 10, 'complex64', rand ); +console.log( x.toString() ); // Compute the L2-norm: -var norm = scnrm2( cx.length, cx, 1 ); +var norm = scnrm2( x.length, x, 1 ); console.log( norm ); ``` @@ -173,46 +173,46 @@ console.log( norm ); #include "stdlib/blas/base/scnrm2.h" ``` -#### c_scnrm2( N, \*CX, strideX ) +#### c_scnrm2( N, \*X, 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 }; +const float X[] = { 0.3f, 0.1f, 0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.2f }; -float norm = c_scnrm2( 4, (void *)cx, 1 ); +float norm = c_scnrm2( 4, (void *)X, 1 ); // returns 0.8f ``` 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`. +- **X**: `[in] void*` input array. +- **strideX**: `[in] CBLAS_INT` index increment for `X`. ```c -float c_scnrm2( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX ); +float c_scnrm2( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ); ``` -#### c_scnrm2_ndarray( N, \*CX, strideX, offsetX ) +#### c_scnrm2_ndarray( N, \*X, strideX, offsetX ) Computes the L2-norm of a complex single-precision floating-point vector using alternative indexing semantics. ```c -const float cx[] = { 0.3f, 0.1f, 0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.2f }; +const float X[] = { 0.3f, 0.1f, 0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.2f }; -float norm = c_scnrm2_ndarray( 4, (void *)cx, 1, 0 ); +float norm = c_scnrm2_ndarray( 4, (void *)X, 1, 0 ); // returns 0.8f ``` 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`. +- **X**: `[in] void*` input array. +- **strideX**: `[in] CBLAS_INT` index increment for `X`. ```c -float c_scnrm2_ndarray( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +float c_scnrm2_ndarray( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); ``` @@ -239,7 +239,7 @@ float c_scnrm2_ndarray( const CBLAS_INT N, const void *CX, const CBLAS_INT strid 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 }; + const float X[] = { 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; @@ -248,13 +248,13 @@ int main( void ) { const int strideX = 1; // Compute the L2-norm: - float norm = c_scnrm2( N, (void *)cx, strideX ); + float norm = c_scnrm2( N, (void *)X, strideX ); // Print the result: printf( "L2-norm: %f\n", norm ); // Compute the L2-norm using alternative indexing semantics: - norm = c_scnrm2_ndarray( N, (void *)cx, -strideX, N-1 ); + norm = c_scnrm2_ndarray( N, (void *)X, -strideX, N-1 ); // Print the result: printf( "L2-norm: %f\n", norm ); diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.js index 88b0f0d3102e..b35c2f17fcf0 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.js @@ -46,7 +46,7 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var cx = new Complex64Array( uniform( len*2, -10.0, 10.0, options ) ); + var x = new Complex64Array( uniform( len*2, -10.0, 10.0, options ) ); return benchmark; function benchmark( b ) { @@ -55,7 +55,7 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - norm = scnrm2( cx.length, cx, 1 ); + norm = scnrm2( x.length, x, 1 ); if ( isnanf( norm ) ) { b.fail( 'should not return NaN' ); } 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 index 7eef75c0bb9f..eb2a9cf40b71 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.native.js @@ -51,7 +51,7 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var cx = new Complex64Array( uniform( len*2, -10.0, 10.0, options ) ); + var x = new Complex64Array( uniform( len*2, -10.0, 10.0, options ) ); return benchmark; function benchmark( b ) { @@ -60,7 +60,7 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - norm = scnrm2( cx.length, cx, 1 ); + norm = scnrm2( x.length, x, 1 ); if ( isnanf( norm ) ) { b.fail( 'should not return NaN' ); } 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 index 69868a754941..b7e7fdd45e58 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/benchmark.ndarray.js @@ -46,7 +46,7 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var cx = new Complex64Array( uniform( len*2, -10.0, 10.0, options ) ); + var x = new Complex64Array( uniform( len*2, -10.0, 10.0, options ) ); return benchmark; function benchmark( b ) { @@ -55,7 +55,7 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - norm = scnrm2( cx.length, cx, 1, 0 ); + norm = scnrm2( x.length, x, 1, 0 ); if ( isnanf( norm ) ) { b.fail( 'should not return NaN' ); } 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 index d0a25a4d636c..f79a415ed249 100644 --- 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 @@ -51,7 +51,7 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var cx = new Complex64Array( uniform( len*2, -10.0, 10.0, options ) ); + var x = new Complex64Array( uniform( len*2, -10.0, 10.0, options ) ); return benchmark; function benchmark( b ) { @@ -60,7 +60,7 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - norm = scnrm2( cx.length, cx, 1, 0 ); + norm = scnrm2( x.length, x, 1, 0 ); if ( isnanf( norm ) ) { b.fail( 'should not return NaN' ); } 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 index bedf6dffb19f..342f0bff372a 100644 --- 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 @@ -95,20 +95,20 @@ static float rand_float( void ) { * @return elapsed time in seconds */ static double benchmark1( int iterations, int len ) { - float cx[ len*2 ]; + float X[ 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; + X[ i ] = ( rand_float()*10000.0f ) - 5000.0f; + X[ 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 ); + norm = c_scnrm2( len, (void *)X, 1 ); if ( norm != norm ) { printf( "should not return NaN\n" ); break; @@ -129,20 +129,20 @@ static double benchmark1( int iterations, int len ) { * @return elapsed time in seconds */ static double benchmark2( int iterations, int len ) { - float cx[ len*2 ]; + float X[ 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; + X[ i ] = ( rand_float()*10000.0f ) - 5000.0f; + X[ i+1 ] = ( rand_float()*10000.0f ) - 5000.0f; } norm = 0.0f; t = tic(); for ( i = 0; i < iterations; i++ ) { - norm = c_scnrm2_ndarray( len, (void *)cx, 1, 0 ); + norm = c_scnrm2_ndarray( len, (void *)X, 1, 0 ); if ( norm != norm ) { printf( "should not return NaN\n" ); break; 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 index 239dc7a40076..bb079f07f460 100644 --- 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 @@ -124,8 +124,8 @@ double precision function benchmark( iterations, len ) ! .. ! External functions: interface - real function scnrm2( N, cx, strideX ) - complex :: cx(*) + real function scnrm2( N, x, strideX ) + complex :: x(*) integer :: strideX, N end function scnrm2 end interface @@ -217,4 +217,4 @@ subroutine main() end do call print_summary( count, count ) end subroutine main -end program bench \ No newline at end of file +end program bench diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/scnrm2/docs/repl.txt index 521874c9d53d..6dcaa42598bc 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/docs/repl.txt @@ -1,5 +1,5 @@ -{{alias}}( N, cx, strideX ) +{{alias}}( N, x, 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 @@ -15,11 +15,11 @@ N: integer Number of indexed elements. - cx: Complex64Array + x: Complex64Array Input array. strideX: integer - Index increment for `cx`. + Index increment for `x`. Returns ------- @@ -29,23 +29,23 @@ 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 ) + > var x = 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, x, 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 ) + > x = new {{alias:@stdlib/array/complex64}}( [ 3.0, -4.0, 0.0, 0.0, 5.0, -6.0 ] ); + > out = {{alias}}( 2, x, 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 ) + > var x0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); + > var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > out = {{alias}}( 2, x1, 1 ) ~9.3 -{{alias}}.ndarray( N, cx, strideX, offsetX ) +{{alias}}.ndarray( N, x, strideX, offsetX ) Computes the L2-norm of a complex single-precision floating-point vector using alternative indexing semantics. @@ -58,14 +58,14 @@ N: integer Number of indexed elements. - cx: Complex64Array + x: Complex64Array Input array. strideX: integer - Index increment for `cx`. + Index increment for `x`. offsetX: integer - Starting index of `cx`. + Starting index of `x`. Returns ------- @@ -75,13 +75,13 @@ 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 ) + > var x = new {{alias:@stdlib/array/complex64}}( [ 3.0, -4.0, 0.0, 0.0, 5.0, -6.0 ] ); + > var out = {{alias}}.ndarray( 2, x, 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 ) + > x = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); + > out = {{alias}}.ndarray( 2, x, 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 index f0c2dd3e64f6..5c2f16972bf6 100644 --- 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 @@ -30,62 +30,62 @@ 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` + * @param x - input array + * @param strideX - stride length for `x` * @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 x = 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 ); + * var norm = scnrm2( 4, x, 1 ); * // returns ~0.8 */ - ( N: number, cx: Complex64Array, strideX: number ): number; + ( 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` + * @param x - input array + * @param strideX - stride length for `x` + * @param offsetX - starting index for `x` * @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 x = 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 ); + * var norm = scnrm2.ndarray( 4, x, 1, 0 ); * // returns ~0.8 */ - ndarray( N: number, cx: Complex64Array, strideX: number, offsetX: number ): number; + 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` +* @param x - input array +* @param strideX - stride length for `x` * @returns L2-norm * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * -* var cx = new Complex64Array( [ 0.3, 0.1, 5.0, 8.0, 0.5, 0.0, 6.0, 9.0, 0.0, 0.5, 8.0, 3.0, 0.0, 0.2, 9.0, 4.0 ] ); +* var x = new Complex64Array( [ 0.3, 0.1, 5.0, 8.0, 0.5, 0.0, 6.0, 9.0, 0.0, 0.5, 8.0, 3.0, 0.0, 0.2, 9.0, 4.0 ] ); * -* var norm = scnrm2( 4, cx, 2 ); +* var norm = scnrm2( 4, x, 2 ); * // returns ~0.8 * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * -* var cx = new Complex64Array( [ 0.3, 0.1, 5.0, 8.0, 0.5, 0.0, 6.0, 9.0, 0.0, 0.5, 8.0, 3.0, 0.0, 0.2, 9.0, 4.0 ] ); +* var x = new Complex64Array( [ 0.3, 0.1, 5.0, 8.0, 0.5, 0.0, 6.0, 9.0, 0.0, 0.5, 8.0, 3.0, 0.0, 0.2, 9.0, 4.0 ] ); * -* var norm = scnrm2.ndarray( 4, cx, 2, 0 ); +* var norm = scnrm2.ndarray( 4, x, 2, 0 ); * // returns ~0.8 */ declare var scnrm2: Routine; 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 index dffd6ac98860..0c580d6babff 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/docs/types/test.ts @@ -24,135 +24,135 @@ import scnrm2 = require( './index' ); // The function returns a number... { - const cx = new Complex64Array( 10 ); + const x = new Complex64Array( 10 ); - scnrm2( cx.length, cx, 1 ); // $ExpectType number + scnrm2( x.length, x, 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 + const x = new Complex64Array( 10 ); + + scnrm2( '10', x, 1 ); // $ExpectError + scnrm2( true, x, 1 ); // $ExpectError + scnrm2( false, x, 1 ); // $ExpectError + scnrm2( null, x, 1 ); // $ExpectError + scnrm2( undefined, x, 1 ); // $ExpectError + scnrm2( [], x, 1 ); // $ExpectError + scnrm2( {}, x, 1 ); // $ExpectError + scnrm2( ( x: number ): number => x, x, 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 + const x = new Complex64Array( 10 ); + + scnrm2( x.length, 10, 1 ); // $ExpectError + scnrm2( x.length, '10', 1 ); // $ExpectError + scnrm2( x.length, true, 1 ); // $ExpectError + scnrm2( x.length, false, 1 ); // $ExpectError + scnrm2( x.length, null, 1 ); // $ExpectError + scnrm2( x.length, undefined, 1 ); // $ExpectError + scnrm2( x.length, [], 1 ); // $ExpectError + scnrm2( x.length, {}, 1 ); // $ExpectError + scnrm2( x.length, ( x: number ): number => x, 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 + const x = new Complex64Array( 10 ); + + scnrm2( x.length, x, '10' ); // $ExpectError + scnrm2( x.length, x, true ); // $ExpectError + scnrm2( x.length, x, false ); // $ExpectError + scnrm2( x.length, x, null ); // $ExpectError + scnrm2( x.length, x, undefined ); // $ExpectError + scnrm2( x.length, x, [] ); // $ExpectError + scnrm2( x.length, x, {} ); // $ExpectError + scnrm2( x.length, x, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... { - const cx = new Complex64Array( 10 ); + const x = new Complex64Array( 10 ); scnrm2(); // $ExpectError - scnrm2( cx.length ); // $ExpectError - scnrm2( cx.length, cx ); // $ExpectError - scnrm2( cx.length, cx, 1, 10 ); // $ExpectError + scnrm2( x.length ); // $ExpectError + scnrm2( x.length, x ); // $ExpectError + scnrm2( x.length, x, 1, 10 ); // $ExpectError } // Attached to main export is an `ndarray` method which returns a number... { - const cx = new Complex64Array( 10 ); + const x = new Complex64Array( 10 ); - scnrm2.ndarray( cx.length, cx, 1, 0 ); // $ExpectType number + scnrm2.ndarray( x.length, x, 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 + const x = new Complex64Array( 10 ); + + scnrm2.ndarray( '10', x, 1, 0 ); // $ExpectError + scnrm2.ndarray( true, x, 1, 0 ); // $ExpectError + scnrm2.ndarray( false, x, 1, 0 ); // $ExpectError + scnrm2.ndarray( null, x, 1, 0 ); // $ExpectError + scnrm2.ndarray( undefined, x, 1, 0 ); // $ExpectError + scnrm2.ndarray( [], x, 1, 0 ); // $ExpectError + scnrm2.ndarray( {}, x, 1, 0 ); // $ExpectError + scnrm2.ndarray( ( x: number ): number => x, x, 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 + const x = new Complex64Array( 10 ); + + scnrm2.ndarray( x.length, 10, 1, 0 ); // $ExpectError + scnrm2.ndarray( x.length, '10', 1, 0 ); // $ExpectError + scnrm2.ndarray( x.length, true, 1, 0 ); // $ExpectError + scnrm2.ndarray( x.length, false, 1, 0 ); // $ExpectError + scnrm2.ndarray( x.length, null, 1, 0 ); // $ExpectError + scnrm2.ndarray( x.length, undefined, 1, 0 ); // $ExpectError + scnrm2.ndarray( x.length, [], 1, 0 ); // $ExpectError + scnrm2.ndarray( x.length, {}, 1, 0 ); // $ExpectError + scnrm2.ndarray( x.length, ( x: number ): number => x, 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 + const x = new Complex64Array( 10 ); + + scnrm2.ndarray( x.length, x, '10', 0 ); // $ExpectError + scnrm2.ndarray( x.length, x, true, 0 ); // $ExpectError + scnrm2.ndarray( x.length, x, false, 0 ); // $ExpectError + scnrm2.ndarray( x.length, x, null, 0 ); // $ExpectError + scnrm2.ndarray( x.length, x, undefined, 0 ); // $ExpectError + scnrm2.ndarray( x.length, x, [], 0 ); // $ExpectError + scnrm2.ndarray( x.length, x, {}, 0 ); // $ExpectError + scnrm2.ndarray( x.length, x, ( x: number ): number => x, 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 + const x = new Complex64Array( 10 ); + + scnrm2.ndarray( x.length, x, 1, '10' ); // $ExpectError + scnrm2.ndarray( x.length, x, 1, true ); // $ExpectError + scnrm2.ndarray( x.length, x, 1, false ); // $ExpectError + scnrm2.ndarray( x.length, x, 1, null ); // $ExpectError + scnrm2.ndarray( x.length, x, 1, undefined ); // $ExpectError + scnrm2.ndarray( x.length, x, 1, [] ); // $ExpectError + scnrm2.ndarray( x.length, x, 1, {} ); // $ExpectError + scnrm2.ndarray( x.length, x, 1, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... { - const cx = new Complex64Array( 10 ); + const x = 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 + scnrm2.ndarray( x.length ); // $ExpectError + scnrm2.ndarray( x.length, x ); // $ExpectError + scnrm2.ndarray( x.length, x, 1 ); // $ExpectError + scnrm2.ndarray( x.length, x, 1, 0, 10 ); // $ExpectError } 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 index 0bb2e89c6d0b..f72226c89be2 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/examples/c/example.c @@ -21,7 +21,7 @@ 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 }; + const float X[] = { 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; @@ -30,13 +30,13 @@ int main( void ) { const int strideX = 1; // Compute the L2-norm: - float norm = c_scnrm2( N, (void *)cx, strideX ); + float norm = c_scnrm2( N, (void *)X, strideX ); // Print the result: printf( "L2-norm: %f\n", norm ); // Compute the L2-norm using alternative indexing semantics: - norm = c_scnrm2_ndarray( N, (void *)cx, -strideX, N-1 ); + norm = c_scnrm2_ndarray( N, (void *)X, -strideX, N-1 ); // 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 index 557ed6bcfb8b..6fb22ede96fb 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/examples/index.js @@ -27,9 +27,9 @@ function rand() { return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var cx = filledarrayBy( 10, 'complex64', rand ); -console.log( cx.toString() ); +var x = filledarrayBy( 10, 'complex64', rand ); +console.log( x.toString() ); // Compute the L2-norm: -var norm = scnrm2( cx.length, cx, 1 ); +var norm = scnrm2( x.length, x, 1 ); console.log( norm ); diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/include/stdlib/blas/base/scnrm2.h b/lib/node_modules/@stdlib/blas/base/scnrm2/include/stdlib/blas/base/scnrm2.h index d58525eb9b69..5904a37084b5 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/include/stdlib/blas/base/scnrm2.h +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/include/stdlib/blas/base/scnrm2.h @@ -34,12 +34,12 @@ extern "C" { /** * Computes the L2-norm of a complex single-precision floating-point vector. */ -float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX ); +float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ); /** * Computes the L2-norm of a complex single-precision floating-point vector using alternative indexing semantics. */ -float API_SUFFIX(c_scnrm2_ndarray)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +float API_SUFFIX(c_scnrm2_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); #ifdef __cplusplus } diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/include/stdlib/blas/base/scnrm2_cblas.h b/lib/node_modules/@stdlib/blas/base/scnrm2/include/stdlib/blas/base/scnrm2_cblas.h index c89f5973c51f..747b57d50b43 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/include/stdlib/blas/base/scnrm2_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/include/stdlib/blas/base/scnrm2_cblas.h @@ -34,7 +34,7 @@ extern "C" { /** * Computes the L2-norm of a complex single-precision floating-point vector. */ -float API_SUFFIX(cblas_scnrm2)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX ); +float API_SUFFIX(cblas_scnrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ); #ifdef __cplusplus } diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/lib/index.js b/lib/node_modules/@stdlib/blas/base/scnrm2/lib/index.js index 64d20bf95a7c..e3a9df127dbb 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/lib/index.js @@ -27,18 +27,18 @@ * 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 x = 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 ); +* var norm = scnrm2( 4, x, 1 ); * // returns ~0.8 * * @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 x = 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 ); +* var norm = scnrm2.ndarray( 4, x, 1, 0 ); * // returns ~0.8 */ diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/scnrm2/lib/ndarray.js index ecb3fed62b68..f75511c37764 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/lib/ndarray.js @@ -43,20 +43,20 @@ var sbig = 1.32348898E-23; * 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 index for `cx` +* @param {Complex64Array} x - input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` * @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 x = 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, 0 ); +* var norm = scnrm2( 4, x, 1, 0 ); * // returns ~0.8 */ -function scnrm2( N, cx, strideX, offsetX ) { +function scnrm2( N, x, strideX, offsetX ) { var notbig; var sumsq; var viewX; @@ -75,7 +75,7 @@ function scnrm2( N, cx, strideX, offsetX ) { return 0.0; } // Reinterpret the input array as a real-valued array comprised of interleaved real and imaginary components: - viewX = reinterpret( cx, 0 ); + viewX = reinterpret( x, 0 ); sx = strideX * 2; ix = offsetX * 2; 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 index c5eea35b87ba..0e59cf291dab 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/lib/ndarray.native.js @@ -30,23 +30,23 @@ var addon = require( './../src/addon.node' ); * 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 +* @param {Complex64Array} x - input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` 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 x = 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 ); +* var norm = scnrm2( 4, x, 1 ); * // returns ~0.8 */ -function scnrm2( N, cx, strideX, offsetX ) { - var viewCX = reinterpret( cx, 0 ); - return addon.ndarray( N, viewCX, strideX, offsetX ); +function scnrm2( N, x, strideX, offsetX ) { + var viewX = reinterpret( x, 0 ); + return addon.ndarray( N, viewX, strideX, offsetX ); } diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/lib/scnrm2.js b/lib/node_modules/@stdlib/blas/base/scnrm2/lib/scnrm2.js index d55efce278c9..34edca698b4a 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/lib/scnrm2.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/lib/scnrm2.js @@ -30,20 +30,20 @@ var ndarray = require( './ndarray.js' ); * 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 {Complex64Array} x - input array +* @param {integer} strideX - `x` 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 x = 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 ); +* var norm = scnrm2( 4, x, 1 ); * // returns ~0.8 */ -function scnrm2( N, cx, strideX ) { - return ndarray( N, cx, strideX, stride2offset( N, strideX ) ); +function scnrm2( N, x, strideX ) { + return ndarray( N, x, strideX, stride2offset( N, strideX ) ); } 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 index 6793f05b5542..a465c7f20ed5 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/lib/scnrm2.native.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/lib/scnrm2.native.js @@ -30,22 +30,22 @@ var addon = require( './../src/addon.node' ); * 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 {Complex64Array} x - input array +* @param {integer} strideX - `x` 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 x = 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 ); +* var norm = scnrm2( 4, x, 1 ); * // returns ~0.8 */ -function scnrm2( N, cx, strideX ) { - var viewCX = reinterpret( cx, 0 ); - return addon( N, viewCX, strideX ); +function scnrm2( N, x, strideX ) { + var viewX = reinterpret( x, 0 ); + return addon( N, viewX, strideX ); } diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/src/addon.c b/lib/node_modules/@stdlib/blas/base/scnrm2/src/addon.c index 3812b55475b9..e2c57ffd05c6 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/src/addon.c +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/addon.c @@ -36,8 +36,8 @@ 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, (void *)CX, strideX ), norm ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 1 ); + STDLIB_NAPI_CREATE_DOUBLE( env, (double)API_SUFFIX(c_scnrm2)( N, (void *)X, strideX ), norm ); return norm; } @@ -53,8 +53,8 @@ static napi_value addon_method( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 ); STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 3 ); - STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, CX, N, strideX, argv, 1 ); - STDLIB_NAPI_CREATE_DOUBLE( env, (double)API_SUFFIX(c_scnrm2_ndarray)( N, (void *)CX, strideX, offsetX ), norm ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 1 ); + STDLIB_NAPI_CREATE_DOUBLE( env, (double)API_SUFFIX(c_scnrm2_ndarray)( N, (void *)X, strideX, offsetX ), norm ); return norm; } diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.c b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.c index 65528d4966d1..153f31e53aec 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.c +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.c @@ -24,10 +24,10 @@ * 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 +* @param X input array +* @param strideX X stride length */ -float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX ) { +float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ) { CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); - return API_SUFFIX(c_scnrm2_ndarray)( N, CX, strideX, ox ); + return API_SUFFIX(c_scnrm2_ndarray)( N, X, strideX, ox ); } diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.f b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.f index 67029c318578..e3538b148889 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.f +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.f @@ -44,11 +44,11 @@ ! > * 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 +! @param {Array} x - array +! @param {integer} strideX - `x` stride length ! @returns {real} L2-norm !< -real function scnrm2( N, cx, strideX ) +real function scnrm2( N, x, strideX ) implicit none ! .. ! Define a kind parameter for single precision: @@ -69,7 +69,7 @@ real function scnrm2( N, cx, strideX ) integer :: N, strideX ! .. ! Array arguments: - complex( wp ) :: cx( * ) + complex( wp ) :: x( * ) ! .. ! Local scalars: integer :: i, ix @@ -104,7 +104,7 @@ real function scnrm2( N, cx, strideX ) end if ! .. do i = 1, N - ax = abs( real( cx( ix ) ) ) + ax = abs( real( x( ix ) ) ) if ( ax > tbig ) then abig = abig + ( ax * sbig )**2 notbig = .false. @@ -115,7 +115,7 @@ real function scnrm2( N, cx, strideX ) else amed = amed + ax**2 end if - ax = abs( aimag( cx( ix ) ) ) + ax = abs( aimag( x( ix ) ) ) if ( ax > tbig ) then abig = abig + ( ax * sbig )**2 notbig = .false. @@ -162,4 +162,4 @@ real function scnrm2( N, cx, strideX ) end if scnrm2 = scl * sqrt( sumsq ) return -end function scnrm2 \ No newline at end of file +end function scnrm2 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 index 92fc95b5a3c5..b138b8b07e9e 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_cblas.c @@ -26,23 +26,23 @@ * 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 +* @param X input array +* @param strideX X 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 ); +float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ) { + return API_SUFFIX(cblas_scnrm2)( N, X, strideX ); } /** * 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 CX stride length -* @param offsetX starting index for CX +* @param X input array +* @param strideX X stride length +* @param offsetX starting index for X */ -float API_SUFFIX(c_scnrm2_ndarray)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { - stdlib_complex64_t *cx = (stdlib_complex64_t *)CX; - cx += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); - return API_SUFFIX(cblas_scnrm2)( N, (void *)cx, strideX ); +float API_SUFFIX(c_scnrm2_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + stdlib_complex64_t *x = (stdlib_complex64_t *)X; + x += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); + return API_SUFFIX(cblas_scnrm2)( N, (void *)x, 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 index 3e3ec36b5e20..c8dd7f173543 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_f.c +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_f.c @@ -26,13 +26,13 @@ * 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 +* @param X input array +* @param strideX X stride length * @return L2-norm */ -float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX ) { +float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ) { float nrm2; - scnrm2sub( &N, CX, &strideX, &nrm2 ); + scnrm2sub( &N, X, &strideX, &nrm2 ); return nrm2; } @@ -40,15 +40,15 @@ float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *CX, const CBLAS_INT s * 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 CX stride length -* @param offsetX starting index for CX +* @param X input array +* @param strideX X stride length +* @param offsetX starting index for X * @return L2-norm */ -float API_SUFFIX(c_scnrm2_ndarray)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { - stdlib_complex64_t *cx = (stdlib_complex64_t *)CX; +float API_SUFFIX(c_scnrm2_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + stdlib_complex64_t *x = (stdlib_complex64_t *)X; float nrm2; - cx += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); - scnrm2sub( &N, (void *)cx, &strideX, &nrm2 ); + x += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); + scnrm2sub( &N, (void *)x, &strideX, &nrm2 ); return nrm2; } diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_ndarray.c b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_ndarray.c index 94c703be9330..958f7335f085 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_ndarray.c @@ -34,12 +34,12 @@ static const float sbig = 1.32348898E-23f; * 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 CX stride length -* @param offsetX starting index for CX +* @param X input array +* @param strideX X stride length +* @param offsetX starting index for X */ -float API_SUFFIX(c_scnrm2_ndarray)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { - const float *x = (float *)CX; +float API_SUFFIX(c_scnrm2_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + const float *x = (float *)X; CBLAS_INT sx; CBLAS_INT ix; bool notbig; @@ -58,7 +58,7 @@ float API_SUFFIX(c_scnrm2_ndarray)( const CBLAS_INT N, const void *CX, const CBL } sx = strideX * 2; ix = offsetX * 2; - + // 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; diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2sub.f b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2sub.f index eb2fc946fdbd..5c93225b7584 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2sub.f +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2sub.f @@ -19,17 +19,17 @@ !> Wraps `scnrm2` as a subroutine. ! ! @param {integer} N - number of indexed elements -! @param {Array} cx - input array -! @param {integer} strideX - `cx` stride length +! @param {Array} x - input array +! @param {integer} strideX - `x` stride length ! @param {real} nrm2 - output variable reference !< -subroutine scnrm2sub( N, cx, strideX, nrm2 ) +subroutine scnrm2sub( N, x, strideX, nrm2 ) implicit none ! .. ! External functions: interface - real function scnrm2( N, cx, strideX ) - complex :: cx(*) + real function scnrm2( N, x, strideX ) + complex :: x(*) integer :: strideX, N end function scnrm2 end interface @@ -39,9 +39,9 @@ end function scnrm2 real :: nrm2 ! .. ! Array arguments: - complex :: cx(*) + complex :: x(*) ! .. ! Compute the L2-norm: - nrm2 = scnrm2( N, cx, strideX ) + nrm2 = scnrm2( N, x, strideX ) return end subroutine scnrm2sub 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 index d864d9b3e8de..747d8a10a422 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.ndarray.js @@ -72,9 +72,9 @@ tape( 'the function has an arity of 4', function test( t ) { tape( 'the function computes the L2-norm', function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 0.5, // 2 @@ -88,10 +88,10 @@ tape( 'the function computes the L2-norm', function test( t ) { ]); expected = 0.8; - actual = scnrm2( 4, cx, 1, 0 ); + actual = scnrm2( 4, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); - cx = new Complex64Array([ + x = new Complex64Array([ 0.1, // 1 0.1, // 1 -0.6, // 2 @@ -103,11 +103,11 @@ tape( 'the function computes the L2-norm', function test( t ) { ]); expected = 0.7; - actual = scnrm2( 3, cx, 1, 0 ); + actual = scnrm2( 3, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); // Checked on Wolfram Alpha: - cx = new Complex64Array([ + x = new Complex64Array([ 5e+15, // 1 5e+15, // 1 5e+15, // 2 @@ -119,11 +119,11 @@ tape( 'the function computes the L2-norm', function test( t ) { ]); expected = 14142135623730952; - actual = scnrm2( 4, cx, 1, 0 ); + actual = scnrm2( 4, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); // Checked on Wolfram Alpha: - cx = new Complex64Array([ + x = new Complex64Array([ 1e-20, // 1 1e-20, // 1 1e-20, // 2 @@ -135,11 +135,11 @@ tape( 'the function computes the L2-norm', function test( t ) { ]); expected = 2.82843e-20; - actual = scnrm2( 4, cx, 1, 0 ); + actual = scnrm2( 4, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); // Checked on Wolfram Alpha: - cx = new Complex64Array([ + x = new Complex64Array([ 1e20, // 1 1e10, // 1 1e20, // 2 @@ -151,11 +151,11 @@ tape( 'the function computes the L2-norm', function test( t ) { ]); expected = 200000000000000000000; - actual = scnrm2( 4, cx, 1, 0 ); + actual = scnrm2( 4, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); // Checked on Wolfram Alpha: - cx = new Complex64Array([ + x = new Complex64Array([ 1e-20, // 1 1e10, // 1 1e-20, // 2 @@ -167,11 +167,11 @@ tape( 'the function computes the L2-norm', function test( t ) { ]); expected = 20000000000; - actual = scnrm2( 4, cx, 1, 0 ); + actual = scnrm2( 4, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); // Checked on Wolfram Alpha: - cx = new Complex64Array([ + x = new Complex64Array([ 1e-19, // 1 1.08420217e-19, // 1 1e-19, // 2 @@ -183,7 +183,7 @@ tape( 'the function computes the L2-norm', function test( t ) { ]); expected = 2.52012e-19; - actual = scnrm2( 4, cx, 1, 0 ); + actual = scnrm2( 4, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -191,9 +191,9 @@ tape( 'the function computes the L2-norm', function test( t ) { tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `0.0`', function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 1.0, 2.0, 3.0, @@ -201,7 +201,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu ]); expected = 0.0; - actual = scnrm2( 0, cx, 1, 0 ); + actual = scnrm2( 0, x, 1, 0 ); t.strictEqual( actual, expected, 'returns expected value' ); t.end(); @@ -210,9 +210,9 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu tape( 'the function supports specifying a stride', function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 5.0, @@ -232,7 +232,7 @@ tape( 'the function supports specifying a stride', function test( t ) { ]); expected = 0.8; - actual = scnrm2( 4, cx, 2, 0 ); + actual = scnrm2( 4, x, 2, 0 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -240,9 +240,9 @@ tape( 'the function supports specifying a stride', function test( t ) { tape( 'the function supports specifying a negative stride', function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 5.0, @@ -262,7 +262,7 @@ tape( 'the function supports specifying a negative stride', function test( t ) { ]); expected = 0.8; - actual = scnrm2( 4, cx, -2, 6 ); + actual = scnrm2( 4, x, -2, 6 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -270,9 +270,9 @@ tape( 'the function supports specifying a negative stride', function test( t ) { tape( 'the function supports specifying an offset', function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 1.0, 2.0, 3.0, // 1 @@ -286,7 +286,7 @@ tape( 'the function supports specifying an offset', function test( t ) { ]); expected = 14.1; - actual = scnrm2( 3, cx, 1, 1 ); + actual = scnrm2( 3, x, 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 index 9d791e3b9724..f4710a02aeb6 100644 --- 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 @@ -81,9 +81,9 @@ tape( 'the function has an arity of 4', opts, function test( t ) { tape( 'the function computes the L2-norm', opts, function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 0.5, // 2 @@ -97,10 +97,10 @@ tape( 'the function computes the L2-norm', opts, function test( t ) { ]); expected = 0.8; - actual = scnrm2( 4, cx, 1, 0 ); + actual = scnrm2( 4, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); - cx = new Complex64Array([ + x = new Complex64Array([ 0.1, // 1 0.1, // 1 -0.6, // 2 @@ -112,7 +112,7 @@ tape( 'the function computes the L2-norm', opts, function test( t ) { ]); expected = 0.7; - actual = scnrm2( 3, cx, 1, 0 ); + actual = scnrm2( 3, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -120,9 +120,9 @@ tape( 'the function computes the L2-norm', opts, function test( t ) { tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `0.0`', opts, function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 1.0, 2.0, 3.0, @@ -130,7 +130,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu ]); expected = 0.0; - actual = scnrm2( 0, cx, 1, 0 ); + actual = scnrm2( 0, x, 1, 0 ); t.strictEqual( actual, expected, 'returns expected value' ); t.end(); @@ -139,9 +139,9 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu tape( 'the function supports specifying a stride', opts, function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 5.0, @@ -161,7 +161,7 @@ tape( 'the function supports specifying a stride', opts, function test( t ) { ]); expected = 0.8; - actual = scnrm2( 4, cx, 2, 0 ); + actual = scnrm2( 4, x, 2, 0 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -169,9 +169,9 @@ tape( 'the function supports specifying a stride', opts, function test( t ) { tape( 'the function supports specifying a negative stride', opts, function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 5.0, @@ -191,7 +191,7 @@ tape( 'the function supports specifying a negative stride', opts, function test( ]); expected = 0.8; - actual = scnrm2( 4, cx, -2, 6 ); + actual = scnrm2( 4, x, -2, 6 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -199,9 +199,9 @@ tape( 'the function supports specifying a negative stride', opts, function test( tape( 'the function supports specifying an offset', opts, function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 1.0, 2.0, 3.0, // 1 @@ -215,7 +215,7 @@ tape( 'the function supports specifying an offset', opts, function test( t ) { ]); expected = 14.1; - actual = scnrm2( 3, cx, 1, 1 ); + actual = scnrm2( 3, x, 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 index 20a5547d7cd1..8d14c2c3b356 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.scnrm2.js +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/test/test.scnrm2.js @@ -72,9 +72,9 @@ tape( 'the function has an arity of 3', function test( t ) { tape( 'the function computes the L2-norm', function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 0.5, // 2 @@ -88,10 +88,10 @@ tape( 'the function computes the L2-norm', function test( t ) { ]); expected = 0.8; - actual = scnrm2( 4, cx, 1 ); + actual = scnrm2( 4, x, 1 ); isApprox( t, actual, expected, 2.0 ); - cx = new Complex64Array([ + x = new Complex64Array([ 0.1, // 1 0.1, // 1 -0.6, // 2 @@ -103,7 +103,7 @@ tape( 'the function computes the L2-norm', function test( t ) { ]); expected = 0.7; - actual = scnrm2( 3, cx, 1 ); + actual = scnrm2( 3, x, 1 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -111,9 +111,9 @@ tape( 'the function computes the L2-norm', function test( t ) { tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `0.0`', function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 1.0, 2.0, 3.0, @@ -121,7 +121,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu ]); expected = 0.0; - actual = scnrm2( 0, cx, 1 ); + actual = scnrm2( 0, x, 1 ); t.strictEqual( actual, expected, 'returns expected value' ); t.end(); @@ -130,9 +130,9 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu tape( 'the function supports specifying a stride', function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 5.0, @@ -152,7 +152,7 @@ tape( 'the function supports specifying a stride', function test( t ) { ]); expected = 0.8; - actual = scnrm2( 4, cx, 2 ); + actual = scnrm2( 4, x, 2 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -160,9 +160,9 @@ tape( 'the function supports specifying a stride', function test( t ) { tape( 'the function supports specifying a negative stride', function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 5.0, @@ -182,7 +182,7 @@ tape( 'the function supports specifying a negative stride', function test( t ) { ]); expected = 0.8; - actual = scnrm2( 4, cx, -2 ); + actual = scnrm2( 4, x, -2 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -190,10 +190,10 @@ tape( 'the function supports specifying a negative stride', function test( t ) { tape( 'the function supports view offsets', function test( t ) { var expected; var actual; - var cx0; - var cx1; + var x0; + var x1; - cx0 = new Complex64Array([ + x0 = new Complex64Array([ 1.0, 2.0, 3.0, // 1 @@ -207,9 +207,9 @@ tape( 'the function supports view offsets', function test( t ) { ]); expected = 14.1; - cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); + x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); - actual = scnrm2( 3, cx1, 1 ); + actual = scnrm2( 3, x1, 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 index 831392ec1096..314eddd11451 100644 --- 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 @@ -81,9 +81,9 @@ tape( 'the function has an arity of 3', opts, function test( t ) { tape( 'the function computes the L2-norm', opts, function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 0.5, // 2 @@ -97,10 +97,10 @@ tape( 'the function computes the L2-norm', opts, function test( t ) { ]); expected = 0.8; - actual = scnrm2( 4, cx, 1 ); + actual = scnrm2( 4, x, 1 ); isApprox( t, actual, expected, 2.0 ); - cx = new Complex64Array([ + x = new Complex64Array([ 0.1, // 1 0.1, // 1 -0.6, // 2 @@ -112,7 +112,7 @@ tape( 'the function computes the L2-norm', opts, function test( t ) { ]); expected = 0.7; - actual = scnrm2( 3, cx, 1 ); + actual = scnrm2( 3, x, 1 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -120,9 +120,9 @@ tape( 'the function computes the L2-norm', opts, function test( t ) { tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `0.0`', opts, function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 1.0, 2.0, 3.0, @@ -130,7 +130,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu ]); expected = 0.0; - actual = scnrm2( 0, cx, 1 ); + actual = scnrm2( 0, x, 1 ); t.strictEqual( actual, expected, 'returns expected value' ); t.end(); @@ -139,9 +139,9 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu tape( 'the function supports specifying a stride', opts, function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 5.0, @@ -161,7 +161,7 @@ tape( 'the function supports specifying a stride', opts, function test( t ) { ]); expected = 0.8; - actual = scnrm2( 4, cx, 2 ); + actual = scnrm2( 4, x, 2 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -169,9 +169,9 @@ tape( 'the function supports specifying a stride', opts, function test( t ) { tape( 'the function supports specifying a negative stride', opts, function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 5.0, @@ -191,7 +191,7 @@ tape( 'the function supports specifying a negative stride', opts, function test( ]); expected = 0.8; - actual = scnrm2( 4, cx, -2 ); + actual = scnrm2( 4, x, -2 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -199,10 +199,10 @@ tape( 'the function supports specifying a negative stride', opts, function test( tape( 'the function supports view offsets', opts, function test( t ) { var expected; var actual; - var cx0; - var cx1; + var x0; + var x1; - cx0 = new Complex64Array([ + x0 = new Complex64Array([ 1.0, 2.0, 3.0, // 1 @@ -216,9 +216,9 @@ tape( 'the function supports view offsets', opts, function test( t ) { ]); expected = 14.1; - cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); + x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); - actual = scnrm2( 3, cx1, 1 ); + actual = scnrm2( 3, x1, 1 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); From c20d9e5baf1951d5231e0dc429ff7e0606aca8b2 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Tue, 3 Jun 2025 10:56:27 +0530 Subject: [PATCH 2/2] chore: minor clean-up --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.c | 2 +- lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_cblas.c | 4 ++-- lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_f.c | 4 ++-- .../@stdlib/blas/base/scnrm2/src/scnrm2_ndarray.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.c b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.c index 153f31e53aec..044da1bb60f3 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.c +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2.c @@ -24,7 +24,7 @@ * Computes the L2-norm of a complex single-precision floating-point vector. * * @param N number of indexed elements -* @param X input array +* @param X input array * @param strideX X stride length */ float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ) { 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 index b138b8b07e9e..0707ced11c2b 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_cblas.c @@ -26,7 +26,7 @@ * Computes the L2-norm of a complex single-precision floating-point vector. * * @param N number of indexed elements -* @param X input array +* @param X input array * @param strideX X stride length */ float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ) { @@ -37,7 +37,7 @@ float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT st * Computes the L2-norm of a complex single-precision floating-point vector using alternative indexing semantics. * * @param N number of indexed elements -* @param X input array +* @param X input array * @param strideX X stride length * @param offsetX starting index for X */ 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 index c8dd7f173543..435932be1e60 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_f.c +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_f.c @@ -26,7 +26,7 @@ * Computes the L2-norm of a complex single-precision floating-point vector. * * @param N number of indexed elements -* @param X input array +* @param X input array * @param strideX X stride length * @return L2-norm */ @@ -40,7 +40,7 @@ float API_SUFFIX(c_scnrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT st * Computes the L2-norm of a complex single-precision floating-point vector using alternative indexing semantics. * * @param N number of indexed elements -* @param X input array +* @param X input array * @param strideX X stride length * @param offsetX starting index for X * @return L2-norm diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_ndarray.c b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_ndarray.c index 958f7335f085..f315f8273071 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/src/scnrm2_ndarray.c @@ -34,7 +34,7 @@ static const float sbig = 1.32348898E-23f; * Computes the L2-norm of a complex single-precision floating-point vector using alternative indexing semantics. * * @param N number of indexed elements -* @param X input array +* @param X input array * @param strideX X stride length * @param offsetX starting index for X */