From d26e12fd284b197706a19bed5bed4f59c1696532 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 2 Jun 2025 19:08:28 +0530 Subject: [PATCH 1/5] docs: change variable naming for blas/base/dznrm2 --- 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/dznrm2/README.md | 68 +++---- .../blas/base/dznrm2/benchmark/benchmark.js | 4 +- .../base/dznrm2/benchmark/benchmark.native.js | 4 +- .../dznrm2/benchmark/benchmark.ndarray.js | 4 +- .../benchmark/benchmark.ndarray.native.js | 4 +- .../dznrm2/benchmark/c/benchmark.length.c | 16 +- .../benchmark/fortran/benchmark.length.f | 6 +- .../@stdlib/blas/base/dznrm2/docs/repl.txt | 36 ++-- .../blas/base/dznrm2/docs/types/index.d.ts | 30 ++-- .../blas/base/dznrm2/docs/types/test.ts | 170 +++++++++--------- .../blas/base/dznrm2/examples/c/example.c | 6 +- .../blas/base/dznrm2/examples/index.js | 8 +- .../dznrm2/include/stdlib/blas/base/dznrm2.h | 4 +- .../include/stdlib/blas/base/dznrm2_cblas.h | 2 +- .../@stdlib/blas/base/dznrm2/lib/dznrm2.js | 12 +- .../blas/base/dznrm2/lib/dznrm2.native.js | 14 +- .../@stdlib/blas/base/dznrm2/lib/index.js | 8 +- .../@stdlib/blas/base/dznrm2/lib/ndarray.js | 14 +- .../blas/base/dznrm2/lib/ndarray.native.js | 16 +- .../@stdlib/blas/base/dznrm2/src/addon.c | 8 +- .../@stdlib/blas/base/dznrm2/src/dznrm2.c | 8 +- .../@stdlib/blas/base/dznrm2/src/dznrm2.f | 14 +- .../blas/base/dznrm2/src/dznrm2_cblas.c | 22 +-- .../@stdlib/blas/base/dznrm2/src/dznrm2_f.c | 18 +- .../blas/base/dznrm2/src/dznrm2_ndarray.c | 10 +- .../@stdlib/blas/base/dznrm2/src/dznrm2sub.f | 14 +- .../blas/base/dznrm2/test/test.dznrm2.js | 38 ++-- .../base/dznrm2/test/test.dznrm2.native.js | 38 ++-- .../blas/base/dznrm2/test/test.ndarray.js | 54 +++--- .../base/dznrm2/test/test.ndarray.native.js | 34 ++-- 30 files changed, 342 insertions(+), 342 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/README.md b/lib/node_modules/@stdlib/blas/base/dznrm2/README.md index f98c2f9cb8f4..2667bfeda994 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/README.md +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/README.md @@ -30,33 +30,33 @@ limitations under the License. var dznrm2 = require( '@stdlib/blas/base/dznrm2' ); ``` -#### dznrm2( N, zx, strideX ) +#### dznrm2( N, x, strideX ) Computes the L2-norm of a complex double-precision floating-point vector. ```javascript var Complex128Array = require( '@stdlib/array/complex128' ); -var zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); +var x = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); -var norm = dznrm2( 4, zx, 1 ); +var norm = dznrm2( 4, x, 1 ); // returns ~0.8 ``` The function has the following parameters: - **N**: number of indexed elements. -- **zx**: input [`Complex128Array`][@stdlib/array/complex128]. -- **strideX**: index increment for `zx`. +- **x**: input [`Complex128Array`][@stdlib/array/complex128]. +- **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 Complex128Array = require( '@stdlib/array/complex128' ); -var zx = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var norm = dznrm2( 2, zx, 2 ); +var norm = dznrm2( 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 Complex128Array = require( '@stdlib/array/complex128' ); // Initial array: -var zx0 = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +var x0 = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view: -var zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Compute the L2-norm: -var norm = dznrm2( 2, zx1, 1 ); +var norm = dznrm2( 2, x1, 1 ); // returns ~9.3 ``` -#### dznrm2.ndarray( N, zx, strideX, offset ) +#### dznrm2.ndarray( N, x, strideX, offset ) Computes the L2-norm of a complex double-precision floating-point vector using alternative indexing semantics. ```javascript var Complex128Array = require( '@stdlib/array/complex128' ); -var zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); +var x = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 ] ); -var norm = dznrm2.ndarray( 4, zx, 1, 0 ); +var norm = dznrm2.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 Complex128Array = require( '@stdlib/array/complex128' ); -var zx = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +var x = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -var norm = dznrm2.ndarray( 2, zx, 1, 1 ); +var norm = dznrm2.ndarray( 2, x, 1, 1 ); // returns ~9.3 ``` @@ -135,11 +135,11 @@ function rand() { return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var zx = filledarrayBy( 10, 'complex128', rand ); -console.log( zx.toString() ); +var x = filledarrayBy( 10, 'complex128', rand ); +console.log( x.toString() ); // Computes the L2-norm: -var norm = dznrm2( zx.length, zx, 1 ); +var norm = dznrm2( x.length, x, 1 ); console.log( norm ); ``` @@ -173,47 +173,47 @@ console.log( norm ); #include "stdlib/blas/base/dznrm2.h" ``` -#### c_dznrm2( N, \*ZX, strideX ) +#### c_dznrm2( N, \*X, strideX ) Computes the L2-norm of a complex double-precision floating-point vector. ```c -const double zx[] = { 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 }; +const double X[] = { 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 }; -double norm = c_dznrm2( 4, (void *)zx, 1 ); +double norm = c_dznrm2( 4, (void *)X, 1 ); // returns 0.8 ``` The function accepts the following arguments: - **N**: `[in] CBLAS_INT` number of indexed elements. -- **ZX**: `[in] void*` input array. -- **strideX**: `[in] CBLAS_INT` index increment for `ZX`. +- **X**: `[in] void*` input array. +- **strideX**: `[in] CBLAS_INT` index increment for `X`. ```c -double c_dznrm2( const CBLAS_INT N, const void *ZX, const CBLAS_INT strideX ); +double c_dznrm2( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ); ``` -#### c_dznrm2_ndarray( N, \*ZX, strideX, offsetX ) +#### c_dznrm2_ndarray( N, \*X, strideX, offsetX ) Computes the L2-norm of a complex double-precision floating-point vector using alternative indexing semantics. ```c -const double zx[] = { 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 }; +const double X[] = { 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2 }; -double norm = c_dznrm2_ndarray( 4, (void *)zx, 1, 0 ); +double norm = c_dznrm2_ndarray( 4, (void *)X, 1, 0 ); // returns 0.8 ``` The function accepts the following arguments: - **N**: `[in] CBLAS_INT` number of indexed elements. -- **ZX**: `[in] void*` input array. -- **strideX**: `[in] CBLAS_INT` index increment for `ZX`. -- **offsetX**: `[in] CBLAS_INT` starting index for `ZX`. +- **X**: `[in] void*` input array. +- **strideX**: `[in] CBLAS_INT` index increment for `X`. +- **offsetX**: `[in] CBLAS_INT` starting index for `X`. ```c -double c_dznrm2_ndarray( const CBLAS_INT N, const void *ZX, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +double c_dznrm2_ndarray( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); ``` @@ -240,7 +240,7 @@ double c_dznrm2_ndarray( const CBLAS_INT N, const void *ZX, const CBLAS_INT stri int main( void ) { // Create a strided array of interleaved real and imaginary components: - const double zx[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 }; + const double X[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 }; // Specify the number of elements: const int N = 4; @@ -249,13 +249,13 @@ int main( void ) { const int strideX = 1; // Compute the L2-norm: - double norm = c_dznrm2( N, (void *)zx, strideX ); + double norm = c_dznrm2( N, (void *)X, strideX ); // Print the result: printf( "L2-norm: %lf\n", norm ); // Compute the L2-norm using alternative indexing semantics: - norm = c_dznrm2_ndarray( N, (void *)zx, -strideX, N-1 ); + norm = c_dznrm2_ndarray( N, (void *)X, -strideX, N-1 ); // Print the result: printf( "L2-norm: %lf\n", norm ); diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.js index eb73b9f0b2e0..77ef87c7f052 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.js @@ -46,7 +46,7 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var zx = new Complex128Array( uniform( len*2, -10.0, 10.0, options ) ); + var x = new Complex128Array( 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 = dznrm2( zx.length, zx, 1 ); + norm = dznrm2( x.length, x, 1 ); if ( isnan( norm ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.native.js index 165592cd971c..9af7b9ac758d 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.native.js @@ -51,7 +51,7 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var zx = new Complex128Array( uniform( len*2, -10.0, 10.0, options ) ); + var x = new Complex128Array( 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 = dznrm2( zx.length, zx, 1 ); + norm = dznrm2( x.length, x, 1 ); if ( isnan( norm ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.js index d4960e769858..0dd0d1ad185e 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.js @@ -46,7 +46,7 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var zx = new Complex128Array( uniform( len*2, -10.0, 10.0, options ) ); + var x = new Complex128Array( 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 = dznrm2( zx.length, zx, 1, 0 ); + norm = dznrm2( x.length, x, 1, 0 ); if ( isnan( norm ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.native.js index 6ad40f056a17..c6e0f989a52a 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/benchmark.ndarray.native.js @@ -51,7 +51,7 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var zx = new Complex128Array( uniform( len*2, -10.0, 10.0, options ) ); + var x = new Complex128Array( 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 = dznrm2( zx.length, zx, 1, 0 ); + norm = dznrm2( x.length, x, 1, 0 ); if ( isnan( norm ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/c/benchmark.length.c index 0c3bcc7c377d..a9a222d8332e 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/c/benchmark.length.c @@ -95,20 +95,20 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark1( int iterations, int len ) { - double zx[ len*2 ]; + double X[ len*2 ]; double elapsed; double norm; double t; int i; for ( i = 0; i < len*2; i += 2 ) { - zx[ i ] = ( rand_double()*10000.0 ) - 5000.0; - zx[ i+1 ] = ( rand_double()*10000.0 ) - 5000.0; + X[ i ] = ( rand_double()*10000.0 ) - 5000.0; + X[ i+1 ] = ( rand_double()*10000.0 ) - 5000.0; } norm = 0.0; t = tic(); for ( i = 0; i < iterations; i++ ) { - norm = c_dznrm2( len, (void *)zx, 1 ); + norm = c_dznrm2( 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 ) { - double zx[ len*2 ]; + double X[ len*2 ]; double elapsed; double norm; double t; int i; for ( i = 0; i < len*2; i += 2 ) { - zx[ i ] = ( rand_double()*10000.0 ) - 5000.0; - zx[ i+1 ] = ( rand_double()*10000.0 ) - 5000.0; + X[ i ] = ( rand_double()*10000.0 ) - 5000.0; + X[ i+1 ] = ( rand_double()*10000.0 ) - 5000.0; } norm = 0.0; t = tic(); for ( i = 0; i < iterations; i++ ) { - norm = c_dznrm2_ndarray( len, (void *)zx, 1, 0 ); + norm = c_dznrm2_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/dznrm2/benchmark/fortran/benchmark.length.f b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/fortran/benchmark.length.f index 269e7f8af712..bec4947f73af 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/fortran/benchmark.length.f +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/fortran/benchmark.length.f @@ -124,8 +124,8 @@ double precision function benchmark( iterations, len ) ! .. ! External functions: interface - double precision function dznrm2( N, zx, strideX ) - complex(kind=kind(0.0d0)) :: zx(*) + double precision function dznrm2( N, X, strideX ) + complex(kind=kind(0.0d0)) :: X(*) integer :: strideX, N end function dznrm2 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/dznrm2/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dznrm2/docs/repl.txt index a62ab64253a5..34bac3dd3fb9 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/docs/repl.txt @@ -1,5 +1,5 @@ -{{alias}}( N, zx, strideX ) +{{alias}}( N, x, strideX ) Computes the L2-norm of a complex double-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. - zx: Complex128Array + x: Complex128Array Input array. strideX: integer - Index increment for `zx`. + Index increment for `x`. Returns ------- @@ -29,23 +29,23 @@ Examples -------- // Standard Usage: - > var zx = new {{alias:@stdlib/array/complex128}}( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5 ] ); - > var out = {{alias}}( 3, zx, 1 ) + > var x = new {{alias:@stdlib/array/complex128}}( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5 ] ); + > var out = {{alias}}( 3, x, 1 ) ~0.77 // Using `N` and stride parameters: - > zx = new {{alias:@stdlib/array/complex128}}( [ 3.0, -4.0, 0.0, 0.0, 5.0, -6.0 ] ); - > out = {{alias}}( 2, zx, 2 ) + > x = new {{alias:@stdlib/array/complex128}}( [ 3.0, -4.0, 0.0, 0.0, 5.0, -6.0 ] ); + > out = {{alias}}( 2, x, 2 ) ~9.3 // Using view offsets: - > var zx0 = new {{alias:@stdlib/array/complex128}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); - > var zx1 = new {{alias:@stdlib/array/complex128}}( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); - > out = {{alias}}( 2, zx1, 1 ) + > var x0 = new {{alias:@stdlib/array/complex128}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); + > var x1 = new {{alias:@stdlib/array/complex128}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > out = {{alias}}( 2, x1, 1 ) ~9.3 -{{alias}}.ndarray( N, zx, strideX, offsetX ) +{{alias}}.ndarray( N, x, strideX, offsetX ) Computes the L2-norm of a complex double-precision floating-point vector using alternative indexing semantics. @@ -58,14 +58,14 @@ N: integer Number of indexed elements. - zx: Complex128Array + x: Complex128Array Input array. strideX: integer - Index increment for `zx`. + Index increment for `x`. offsetX: integer - Starting index of `zx`. + Starting index of `x`. Returns ------- @@ -75,13 +75,13 @@ Examples -------- // Standard Usage: - > var zx = new {{alias:@stdlib/array/complex128}}( [ 3.0, -4.0, 0.0, 0.0, 5.0, -6.0 ] ); - > var out = {{alias}}.ndarray( 2, zx, 2, 0 ) + > var x = new {{alias:@stdlib/array/complex128}}( [ 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: - > zx = new {{alias:@stdlib/array/complex128}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); - > out = {{alias}}.ndarray( 2, zx, 1, 1 ) + > x = new {{alias:@stdlib/array/complex128}}( [ 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/dznrm2/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dznrm2/docs/types/index.d.ts index 6762509746bc..c079a2e530e0 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/docs/types/index.d.ts @@ -30,46 +30,46 @@ interface Routine { * Computes the L2-norm of a complex double-precision floating-point vector. * * @param N - number of indexed elements - * @param zx - input array - * @param strideX - stride length for `zx` + * @param x - input array + * @param strideX - stride length for `x` * @returns L2-norm * * @example * var Complex128Array = require( '@stdlib/array/complex128' ); * - * var zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); + * var x = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); * - * var norm = dznrm2( 4, zx, 1 ); + * var norm = dznrm2( 4, x, 1 ); * // returns ~0.8 */ - ( N: number, zx: Complex128Array, strideX: number ): number; + ( N: number, x: Complex128Array, strideX: number ): number; /** * Computes the L2-norm of a complex double-precision floating-point vector using alternative indexing semantics. * * @param N - number of indexed elements - * @param zx - input array - * @param strideX - stride length for `zx` - * @param offsetX - starting index for `zx` + * @param x - input array + * @param strideX - stride length for `x` + * @param offsetX - starting index for `x` * @returns L2-norm * * @example * var Complex128Array = require( '@stdlib/array/complex128' ); * - * var zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); + * var x = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); * - * var norm = dznrm2.ndarray( 4, zx, 1, 0 ); + * var norm = dznrm2.ndarray( 4, x, 1, 0 ); * // returns ~0.8 */ - ndarray( N: number, zx: Complex128Array, strideX: number, offsetX: number ): number; + ndarray( N: number, x: Complex128Array, strideX: number, offsetX: number ): number; } /** * Computes the L2-norm of a complex double-precision floating-point vector. * * @param N - number of indexed elements -* @param zx - input array -* @param strideX - stride length for `zx` +* @param x - input array +* @param strideX - stride length for `x` * @returns L2-norm * * @example @@ -77,7 +77,7 @@ interface Routine { * * var x = new Complex128Array( [ 3.0, -4.0, 0.0, 0.0, 5.0, -6.0 ] ); * -* var norm = dznrm2( 2, zx, 2 ); +* var norm = dznrm2( 2, x, 2 ); * // returns ~9.3 * * @example @@ -85,7 +85,7 @@ interface Routine { * * var x = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); * -* var norm = dznrm2.ndarray( 2, zx, 1, 1 ); +* var norm = dznrm2.ndarray( 2, x, 1, 1 ); * // returns ~9.3 */ declare var dznrm2: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dznrm2/docs/types/test.ts index 4327f535c2f3..4547601e0066 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/docs/types/test.ts @@ -24,135 +24,135 @@ import dznrm2 = require( './index' ); // The function returns a number... { - const zx = new Complex128Array( 10 ); + const x = new Complex128Array( 10 ); - dznrm2( zx.length, zx, 1 ); // $ExpectType number + dznrm2( 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 zx = new Complex128Array( 10 ); - - dznrm2( '10', zx, 1 ); // $ExpectError - dznrm2( true, zx, 1 ); // $ExpectError - dznrm2( false, zx, 1 ); // $ExpectError - dznrm2( null, zx, 1 ); // $ExpectError - dznrm2( undefined, zx, 1 ); // $ExpectError - dznrm2( [], zx, 1 ); // $ExpectError - dznrm2( {}, zx, 1 ); // $ExpectError - dznrm2( ( zx: number ): number => zx, zx, 1 ); // $ExpectError + const x = new Complex128Array( 10 ); + + dznrm2( '10', x, 1 ); // $ExpectError + dznrm2( true, x, 1 ); // $ExpectError + dznrm2( false, x, 1 ); // $ExpectError + dznrm2( null, x, 1 ); // $ExpectError + dznrm2( undefined, x, 1 ); // $ExpectError + dznrm2( [], x, 1 ); // $ExpectError + dznrm2( {}, x, 1 ); // $ExpectError + dznrm2( ( x: number ): number => x, x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a Complex128Array... { - const zx = new Complex128Array( 10 ); - - dznrm2( zx.length, 10, 1 ); // $ExpectError - dznrm2( zx.length, '10', 1 ); // $ExpectError - dznrm2( zx.length, true, 1 ); // $ExpectError - dznrm2( zx.length, false, 1 ); // $ExpectError - dznrm2( zx.length, null, 1 ); // $ExpectError - dznrm2( zx.length, undefined, 1 ); // $ExpectError - dznrm2( zx.length, [], 1 ); // $ExpectError - dznrm2( zx.length, {}, 1 ); // $ExpectError - dznrm2( zx.length, ( zx: number ): number => zx, 1 ); // $ExpectError + const x = new Complex128Array( 10 ); + + dznrm2( x.length, 10, 1 ); // $ExpectError + dznrm2( x.length, '10', 1 ); // $ExpectError + dznrm2( x.length, true, 1 ); // $ExpectError + dznrm2( x.length, false, 1 ); // $ExpectError + dznrm2( x.length, null, 1 ); // $ExpectError + dznrm2( x.length, undefined, 1 ); // $ExpectError + dznrm2( x.length, [], 1 ); // $ExpectError + dznrm2( x.length, {}, 1 ); // $ExpectError + dznrm2( 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 zx = new Complex128Array( 10 ); - - dznrm2( zx.length, zx, '10' ); // $ExpectError - dznrm2( zx.length, zx, true ); // $ExpectError - dznrm2( zx.length, zx, false ); // $ExpectError - dznrm2( zx.length, zx, null ); // $ExpectError - dznrm2( zx.length, zx, undefined ); // $ExpectError - dznrm2( zx.length, zx, [] ); // $ExpectError - dznrm2( zx.length, zx, {} ); // $ExpectError - dznrm2( zx.length, zx, ( zx: number ): number => zx ); // $ExpectError + const x = new Complex128Array( 10 ); + + dznrm2( x.length, x, '10' ); // $ExpectError + dznrm2( x.length, x, true ); // $ExpectError + dznrm2( x.length, x, false ); // $ExpectError + dznrm2( x.length, x, null ); // $ExpectError + dznrm2( x.length, x, undefined ); // $ExpectError + dznrm2( x.length, x, [] ); // $ExpectError + dznrm2( x.length, x, {} ); // $ExpectError + dznrm2( x.length, x, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... { - const zx = new Complex128Array( 10 ); + const x = new Complex128Array( 10 ); dznrm2(); // $ExpectError - dznrm2( zx.length ); // $ExpectError - dznrm2( zx.length, zx ); // $ExpectError - dznrm2( zx.length, zx, 1, 10 ); // $ExpectError + dznrm2( x.length ); // $ExpectError + dznrm2( x.length, x ); // $ExpectError + dznrm2( x.length, x, 1, 10 ); // $ExpectError } // Attached to main export is an `ndarray` method which returns a number... { - const zx = new Complex128Array( 10 ); + const x = new Complex128Array( 10 ); - dznrm2.ndarray( zx.length, zx, 1, 0 ); // $ExpectType number + dznrm2.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 zx = new Complex128Array( 10 ); - - dznrm2.ndarray( '10', zx, 1, 0 ); // $ExpectError - dznrm2.ndarray( true, zx, 1, 0 ); // $ExpectError - dznrm2.ndarray( false, zx, 1, 0 ); // $ExpectError - dznrm2.ndarray( null, zx, 1, 0 ); // $ExpectError - dznrm2.ndarray( undefined, zx, 1, 0 ); // $ExpectError - dznrm2.ndarray( [], zx, 1, 0 ); // $ExpectError - dznrm2.ndarray( {}, zx, 1, 0 ); // $ExpectError - dznrm2.ndarray( ( zx: number ): number => zx, zx, 1, 0 ); // $ExpectError + const x = new Complex128Array( 10 ); + + dznrm2.ndarray( '10', x, 1, 0 ); // $ExpectError + dznrm2.ndarray( true, x, 1, 0 ); // $ExpectError + dznrm2.ndarray( false, x, 1, 0 ); // $ExpectError + dznrm2.ndarray( null, x, 1, 0 ); // $ExpectError + dznrm2.ndarray( undefined, x, 1, 0 ); // $ExpectError + dznrm2.ndarray( [], x, 1, 0 ); // $ExpectError + dznrm2.ndarray( {}, x, 1, 0 ); // $ExpectError + dznrm2.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 Complex128Array... { - const zx = new Complex128Array( 10 ); - - dznrm2.ndarray( zx.length, 10, 1, 0 ); // $ExpectError - dznrm2.ndarray( zx.length, '10', 1, 0 ); // $ExpectError - dznrm2.ndarray( zx.length, true, 1, 0 ); // $ExpectError - dznrm2.ndarray( zx.length, false, 1, 0 ); // $ExpectError - dznrm2.ndarray( zx.length, null, 1, 0 ); // $ExpectError - dznrm2.ndarray( zx.length, undefined, 1, 0 ); // $ExpectError - dznrm2.ndarray( zx.length, [], 1, 0 ); // $ExpectError - dznrm2.ndarray( zx.length, {}, 1, 0 ); // $ExpectError - dznrm2.ndarray( zx.length, ( zx: number ): number => zx, 1, 0 ); // $ExpectError + const x = new Complex128Array( 10 ); + + dznrm2.ndarray( x.length, 10, 1, 0 ); // $ExpectError + dznrm2.ndarray( x.length, '10', 1, 0 ); // $ExpectError + dznrm2.ndarray( x.length, true, 1, 0 ); // $ExpectError + dznrm2.ndarray( x.length, false, 1, 0 ); // $ExpectError + dznrm2.ndarray( x.length, null, 1, 0 ); // $ExpectError + dznrm2.ndarray( x.length, undefined, 1, 0 ); // $ExpectError + dznrm2.ndarray( x.length, [], 1, 0 ); // $ExpectError + dznrm2.ndarray( x.length, {}, 1, 0 ); // $ExpectError + dznrm2.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 zx = new Complex128Array( 10 ); - - dznrm2.ndarray( zx.length, zx, '10', 0 ); // $ExpectError - dznrm2.ndarray( zx.length, zx, true, 0 ); // $ExpectError - dznrm2.ndarray( zx.length, zx, false, 0 ); // $ExpectError - dznrm2.ndarray( zx.length, zx, null, 0 ); // $ExpectError - dznrm2.ndarray( zx.length, zx, undefined, 0 ); // $ExpectError - dznrm2.ndarray( zx.length, zx, [], 0 ); // $ExpectError - dznrm2.ndarray( zx.length, zx, {}, 0 ); // $ExpectError - dznrm2.ndarray( zx.length, zx, ( zx: number ): number => zx, 0 ); // $ExpectError + const x = new Complex128Array( 10 ); + + dznrm2.ndarray( x.length, x, '10', 0 ); // $ExpectError + dznrm2.ndarray( x.length, x, true, 0 ); // $ExpectError + dznrm2.ndarray( x.length, x, false, 0 ); // $ExpectError + dznrm2.ndarray( x.length, x, null, 0 ); // $ExpectError + dznrm2.ndarray( x.length, x, undefined, 0 ); // $ExpectError + dznrm2.ndarray( x.length, x, [], 0 ); // $ExpectError + dznrm2.ndarray( x.length, x, {}, 0 ); // $ExpectError + dznrm2.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 zx = new Complex128Array( 10 ); - - dznrm2.ndarray( zx.length, zx, 1, '10' ); // $ExpectError - dznrm2.ndarray( zx.length, zx, 1, true ); // $ExpectError - dznrm2.ndarray( zx.length, zx, 1, false ); // $ExpectError - dznrm2.ndarray( zx.length, zx, 1, null ); // $ExpectError - dznrm2.ndarray( zx.length, zx, 1, undefined ); // $ExpectError - dznrm2.ndarray( zx.length, zx, 1, [] ); // $ExpectError - dznrm2.ndarray( zx.length, zx, 1, {} ); // $ExpectError - dznrm2.ndarray( zx.length, zx, 1, ( zx: number ): number => zx ); // $ExpectError + const x = new Complex128Array( 10 ); + + dznrm2.ndarray( x.length, x, 1, '10' ); // $ExpectError + dznrm2.ndarray( x.length, x, 1, true ); // $ExpectError + dznrm2.ndarray( x.length, x, 1, false ); // $ExpectError + dznrm2.ndarray( x.length, x, 1, null ); // $ExpectError + dznrm2.ndarray( x.length, x, 1, undefined ); // $ExpectError + dznrm2.ndarray( x.length, x, 1, [] ); // $ExpectError + dznrm2.ndarray( x.length, x, 1, {} ); // $ExpectError + dznrm2.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 zx = new Complex128Array( 10 ); + const x = new Complex128Array( 10 ); dznrm2.ndarray(); // $ExpectError - dznrm2.ndarray( zx.length ); // $ExpectError - dznrm2.ndarray( zx.length, zx ); // $ExpectError - dznrm2.ndarray( zx.length, zx, 1 ); // $ExpectError - dznrm2.ndarray( zx.length, zx, 1, 0, 10 ); // $ExpectError + dznrm2.ndarray( x.length ); // $ExpectError + dznrm2.ndarray( x.length, x ); // $ExpectError + dznrm2.ndarray( x.length, x, 1 ); // $ExpectError + dznrm2.ndarray( x.length, x, 1, 0, 10 ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/dznrm2/examples/c/example.c index ce62c54d34fe..5afc6373cc58 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/examples/c/example.c @@ -21,7 +21,7 @@ int main( void ) { // Create a strided array of interleaved real and imaginary components: - const double zx[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 }; + const double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 }; // Specify the number of elements: const int N = 4; @@ -30,13 +30,13 @@ int main( void ) { const int strideX = 1; // Compute the L2-norm: - double norm = c_dznrm2( N, (void *)zx, strideX ); + double norm = c_dznrm2( N, (void *)x, strideX ); // Print the result: printf( "L2-norm: %lf\n", norm ); // Compute the L2-norm using alternative indexing semantics: - norm = c_dznrm2_ndarray( N, (void *)zx, -strideX, N-1 ); + norm = c_dznrm2_ndarray( N, (void *)x, -strideX, N-1 ); // Print the result: printf( "L2-norm: %lf\n", norm ); diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/examples/index.js b/lib/node_modules/@stdlib/blas/base/dznrm2/examples/index.js index 781b52d6c6a9..2834d2b2c249 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/examples/index.js @@ -21,15 +21,15 @@ var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); var filledarrayBy = require( '@stdlib/array/filled-by' ); var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var dznrm2 = require( '@stdlib/blas/base/dznrm2' ); +var dznrm2 = require( './../lib' ); function rand() { return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var zx = filledarrayBy( 10, 'complex128', rand ); -console.log( zx.toString() ); +var x = filledarrayBy( 10, 'complex128', rand ); +console.log( x.toString() ); // Computes the L2-norm: -var norm = dznrm2( zx.length, zx, 1 ); +var norm = dznrm2( x.length, x, 1 ); console.log( norm ); diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/include/stdlib/blas/base/dznrm2.h b/lib/node_modules/@stdlib/blas/base/dznrm2/include/stdlib/blas/base/dznrm2.h index 1d1cec032929..5c4dc664eef4 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/include/stdlib/blas/base/dznrm2.h +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/include/stdlib/blas/base/dznrm2.h @@ -34,12 +34,12 @@ extern "C" { /** * Computes the L2-norm of a complex double-precision floating-point vector. */ -double API_SUFFIX(c_dznrm2)( const CBLAS_INT N, const void *ZX, const CBLAS_INT strideX ); +double API_SUFFIX(c_dznrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ); /** * Computes the L2-norm of a complex double-precision floating-point vector using alternative indexing semantics. */ -double API_SUFFIX(c_dznrm2_ndarray)( const CBLAS_INT N, const void *ZX, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +double API_SUFFIX(c_dznrm2_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/dznrm2/include/stdlib/blas/base/dznrm2_cblas.h b/lib/node_modules/@stdlib/blas/base/dznrm2/include/stdlib/blas/base/dznrm2_cblas.h index 992b9f14ba43..56f7555f2a7a 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/include/stdlib/blas/base/dznrm2_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/include/stdlib/blas/base/dznrm2_cblas.h @@ -34,7 +34,7 @@ extern "C" { /** * Computes the L2-norm of a complex double-precision floating-point vector. */ -double API_SUFFIX(cblas_dznrm2)( const CBLAS_INT N, const void *ZX, const CBLAS_INT strideX ); +double API_SUFFIX(cblas_dznrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ); #ifdef __cplusplus } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/lib/dznrm2.js b/lib/node_modules/@stdlib/blas/base/dznrm2/lib/dznrm2.js index bc7bc6c633cd..93f7e32da630 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/lib/dznrm2.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/lib/dznrm2.js @@ -30,20 +30,20 @@ var ndarray = require( './ndarray.js' ); * Computes the L2-norm of a complex double-precision floating-point vector. * * @param {PositiveInteger} N - number of indexed elements -* @param {Complex128Array} zx - input array -* @param {integer} strideX - `zx` stride length +* @param {Complex128Array} x - input array +* @param {integer} strideX - `x` stride length * @returns {number} L2-norm * * @example * var Complex128Array = require( '@stdlib/array/complex128' ); * -* var zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); +* var x = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); * -* var norm = dznrm2( 4, zx, 1 ); +* var norm = dznrm2( 4, x, 1 ); * // returns ~0.8 */ -function dznrm2( N, zx, strideX ) { - return ndarray( N, zx, strideX, stride2offset( N, strideX ) ); +function dznrm2( N, x, strideX ) { + return ndarray( N, x, strideX, stride2offset( N, strideX ) ); } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/lib/dznrm2.native.js b/lib/node_modules/@stdlib/blas/base/dznrm2/lib/dznrm2.native.js index 1f29d0b549f1..82306bffdfda 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/lib/dznrm2.native.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/lib/dznrm2.native.js @@ -30,22 +30,22 @@ var addon = require( './../src/addon.node' ); * Computes the L2-norm of a complex double-precision floating-point vector. * * @param {PositiveInteger} N - number of indexed elements -* @param {Complex128Array} zx - input array -* @param {integer} strideX - `zx` stride length +* @param {Complex128Array} x - input array +* @param {integer} strideX - `x` stride length * @returns {number} L2-norm * * @example * var Complex128Array = require( '@stdlib/array/complex128' ); * var dznrm2 = require( '@stdlib/blas/base/dznrm2' ); * -* var zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); +* var x = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); * -* var norm = dznrm2( 4, zx, 1 ); +* var norm = dznrm2( 4, x, 1 ); * // returns ~0.8 */ -function dznrm2( N, zx, strideX ) { - var viewZX = reinterpret( zx, 0 ); - return addon( N, viewZX, strideX ); +function dznrm2( N, x, strideX ) { + var viewX = reinterpret( x, 0 ); + return addon( N, viewX, strideX ); } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/lib/index.js b/lib/node_modules/@stdlib/blas/base/dznrm2/lib/index.js index 8dd07a5fa14e..fad2b1799201 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/lib/index.js @@ -27,18 +27,18 @@ * var Complex128Array = require( '@stdlib/array/complex128' ); * var dznrm2 = require( '@stdlib/blas/base/dznrm2' ); * -* var zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); +* var x = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); * -* var norm = dznrm2( 4, zx, 1 ); +* var norm = dznrm2( 4, x, 1 ); * // returns ~0.8 * * @example * var Complex128Array = require( '@stdlib/array/complex128' ); * var dznrm2 = require( '@stdlib/blas/base/dznrm2' ); * -* var zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); +* var x = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); * -* var norm = dznrm2.ndarray( 4, zx, 1, 0 ); +* var norm = dznrm2.ndarray( 4, x, 1, 0 ); * // returns ~0.8 */ diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dznrm2/lib/ndarray.js index a615def8c1fa..d147cd65c8e7 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/lib/ndarray.js @@ -42,20 +42,20 @@ var sbig = 1.1113793747425387E-162; * Computes the L2-norm of a complex double-precision floating-point vector. * * @param {PositiveInteger} N - number of indexed elements -* @param {Complex128Array} zx - input array -* @param {integer} strideX - `zx` stride length -* @param {NonNegativeInteger} offsetX - starting index for `zx` +* @param {Complex128Array} x - input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` * @returns {number} L2-norm * * @example * var Complex128Array = require( '@stdlib/array/complex128' ); * -* var zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); +* var x = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); * -* var norm = dznrm2( 4, zx, 1, 0 ); +* var norm = dznrm2( 4, x, 1, 0 ); * // returns ~0.8 */ -function dznrm2( N, zx, strideX, offsetX ) { +function dznrm2( N, x, strideX, offsetX ) { var notbig; var sumsq; var viewX; @@ -74,7 +74,7 @@ function dznrm2( N, zx, strideX, offsetX ) { return 0.0; } // Reinterpret the input array as a real-valued array comprised of interleaved real and imaginary components: - viewX = reinterpret( zx, 0 ); + viewX = reinterpret( x, 0 ); sx = strideX * 2; ix = offsetX * 2; diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dznrm2/lib/ndarray.native.js index 3151a368e863..ccb1ccd18f09 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/lib/ndarray.native.js @@ -30,23 +30,23 @@ var addon = require( './../src/addon.node' ); * Computes the L2-norm of a complex double-precision floating-point vector. * * @param {PositiveInteger} N - number of indexed elements -* @param {Complex128Array} zx - input array -* @param {integer} strideX - `zx` stride length -* @param {NonNegativeInteger} offsetX - starting `zx` index +* @param {Complex128Array} x - input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index * @returns {number} L2-norm * * @example * var Complex128Array = require( '@stdlib/array/complex128' ); * var dznrm2 = require( '@stdlib/blas/base/dznrm2' ); * -* var zx = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); +* var x = new Complex128Array( [ 0.3, 0.1, 0.5, 0.0, 0.0, 0.5, 0.0, 0.2, 2.0, 3.0 ] ); * -* var norm = dznrm2( 4, zx, 1 ); +* var norm = dznrm2( 4, x, 1 ); * // returns ~0.8 */ -function dznrm2( N, zx, strideX, offsetX ) { - var viewZX = reinterpret( zx, 0 ); - return addon.ndarray( N, viewZX, strideX, offsetX ); +function dznrm2( 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/dznrm2/src/addon.c b/lib/node_modules/@stdlib/blas/base/dznrm2/src/addon.c index 872d89236cfd..bbf89d2b6dc1 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/src/addon.c +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/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_COMPLEX128ARRAY( env, ZX, N, strideX, argv, 1 ); - STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(c_dznrm2)( N, (void *)ZX, strideX ), norm ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX128ARRAY( env, X, N, strideX, argv, 1 ); + STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(c_dznrm2)( 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_COMPLEX128ARRAY( env, ZX, N, strideX, argv, 1 ); - STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(c_dznrm2_ndarray)( N, (void *)ZX, strideX, offsetX ), norm ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX128ARRAY( env, X, N, strideX, argv, 1 ); + STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(c_dznrm2_ndarray)( N, (void *)X, strideX, offsetX ), norm ); return norm; } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2.c b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2.c index a10a3c743aa8..2519249f5d67 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2.c +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2.c @@ -24,10 +24,10 @@ * Computes the L2-norm of a complex double-precision floating-point vector. * * @param N number of indexed elements -* @param ZX input array -* @param strideX ZX stride length +* @param X input array +* @param strideX X stride length */ -double API_SUFFIX(c_dznrm2)( const CBLAS_INT N, const void *ZX, const CBLAS_INT strideX ) { +double API_SUFFIX(c_dznrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ) { CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); - return API_SUFFIX(c_dznrm2_ndarray)( N, ZX, strideX, ox ); + return API_SUFFIX(c_dznrm2_ndarray)( N, X, strideX, ox ); } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2.f b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2.f index 05d821fb43c9..07b121cfba24 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2.f +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2.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>} zx - array -! @param {integer} strideX - `zx` stride length +! @param {Array>} x - array +! @param {integer} strideX - `x` stride length ! @returns {double} L2-norm !< -double precision function dznrm2( N, zx, strideX ) +double precision function dznrm2( N, x, strideX ) implicit none ! .. ! Define a kind parameter for single precision: @@ -69,7 +69,7 @@ double precision function dznrm2( N, zx, strideX ) integer :: N, strideX ! .. ! Array arguments: - complex( wp ) :: zx( * ) + complex( wp ) :: x( * ) ! .. ! Local scalars: integer :: i, ix @@ -104,7 +104,7 @@ double precision function dznrm2( N, zx, strideX ) end if ! .. do i = 1, N - ax = abs( real( zx( ix ) ) ) + ax = abs( real( x( ix ) ) ) if ( ax > tbig ) then abig = abig + ( ax * sbig )**2 notbig = .false. @@ -115,7 +115,7 @@ double precision function dznrm2( N, zx, strideX ) else amed = amed + ax**2 end if - ax = abs( aimag( zx( ix ) ) ) + ax = abs( aimag( x( ix ) ) ) if ( ax > tbig ) then abig = abig + ( ax * sbig )**2 notbig = .false. @@ -162,4 +162,4 @@ double precision function dznrm2( N, zx, strideX ) end if dznrm2 = scl * sqrt( sumsq ) return -end function dznrm2 \ No newline at end of file +end function dznrm2 diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_cblas.c b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_cblas.c index c90892abfb07..5a4b8da6e6cb 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_cblas.c @@ -26,23 +26,23 @@ * Computes the L2-norm of a complex double-precision floating-point vector. * * @param N number of indexed elements -* @param ZX input array -* @param strideX ZX stride length +* @param X input array +* @param strideX X stride length */ -double API_SUFFIX(c_dznrm2)( const CBLAS_INT N, const void *ZX, const CBLAS_INT strideX ) { - return API_SUFFIX(cblas_dznrm2)( N, ZX, strideX ); +double API_SUFFIX(c_dznrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ) { + return API_SUFFIX(cblas_dznrm2)( N, X, strideX ); } /** * Computes the L2-norm of a complex double-precision floating-point vector using alternative indexing semantics. * * @param N number of indexed elements -* @param ZX input array -* @param strideX ZX stride length -* @param offsetX starting index for ZX +* @param X input array +* @param strideX X stride length +* @param offsetX starting index for X */ -double API_SUFFIX(c_dznrm2_ndarray)( const CBLAS_INT N, const void *ZX, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { - stdlib_complex128_t *zx = (stdlib_complex128_t *)ZX; - zx += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); - return API_SUFFIX(cblas_dznrm2)( N, (void *)zx, strideX ); +double API_SUFFIX(c_dznrm2_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + stdlib_complex128_t *x = (stdlib_complex128_t *)X; + x += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); + return API_SUFFIX(cblas_dznrm2)( N, (void *)x, strideX ); } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_f.c b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_f.c index d43863c791d3..b3f951675642 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_f.c +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_f.c @@ -26,13 +26,13 @@ * Computes the L2-norm of a complex double-precision floating-point vector. * * @param N number of indexed elements -* @param ZX input array -* @param strideX ZX stride length +* @param X input array +* @param strideX X stride length * @return L2-norm */ -double API_SUFFIX(c_dznrm2)( const CBLAS_INT N, const void *ZX, const CBLAS_INT strideX ) { +double API_SUFFIX(c_dznrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ) { double nrm2; - dznrm2sub( &N, ZX, &strideX, &nrm2 ); + dznrm2sub( &N, X, &strideX, &nrm2 ); return nrm2; } @@ -40,13 +40,13 @@ double API_SUFFIX(c_dznrm2)( const CBLAS_INT N, const void *ZX, const CBLAS_INT * Computes the L2-norm of a complex double-precision floating-point vector using alternative indexing semantics. * * @param N number of indexed elements -* @param ZX input array -* @param strideX ZX stride length -* @param offsetX starting index for ZX +* @param X input array +* @param strideX X stride length +* @param offsetX starting index for X * @return L2-norm */ -double API_SUFFIX(c_dznrm2_ndarray)( const CBLAS_INT N, const void *ZX, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { - stdlib_complex128_t *zx = (stdlib_complex128_t *)ZX; +double API_SUFFIX(c_dznrm2_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + stdlib_complex128_t *zx = (stdlib_complex128_t *)X; double nrm2; zx += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); dznrm2sub( &N, (void *)zx, &strideX, &nrm2 ); diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_ndarray.c b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_ndarray.c index 727b729aa59c..50f1a6288746 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_ndarray.c @@ -34,12 +34,12 @@ static const double sbig = 1.1113793747425387E-162; * Computes the L2-norm of a complex double-precision floating-point vector using alternative indexing semantics. * * @param N number of indexed elements -* @param ZX input array -* @param strideX ZX stride length -* @param offsetX starting index for ZX +* @param X input array +* @param strideX X stride length +* @param offsetX starting index for X */ -double API_SUFFIX(c_dznrm2_ndarray)( const CBLAS_INT N, const void *ZX, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { - const double *x = (double *)ZX; +double API_SUFFIX(c_dznrm2_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + const double *x = (double *)X; CBLAS_INT sx; CBLAS_INT ix; bool notbig; diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2sub.f b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2sub.f index 13629c91ffbb..b211a7046733 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2sub.f +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2sub.f @@ -19,17 +19,17 @@ !> Wraps `dznrm2` as a subroutine. ! ! @param {integer} N - number of indexed elements -! @param {Array>} zx - input array -! @param {integer} strideX - `zx` stride length +! @param {Array>} x - input array +! @param {integer} strideX - `x` stride length ! @param {double} nrm2 - L2-norm !< -subroutine dznrm2sub( N, zx, strideX, nrm2 ) +subroutine dznrm2sub( N, x, strideX, nrm2 ) implicit none ! .. ! External functions: interface - double precision function dznrm2( N, zx, strideX ) - complex(kind=kind(0.0d0)) :: zx(*) + double precision function dznrm2( N, x, strideX ) + complex(kind=kind(0.0d0)) :: x(*) integer :: strideX, N end function dznrm2 end interface @@ -39,9 +39,9 @@ end function dznrm2 double precision :: nrm2 ! .. ! Array arguments: - complex(kind=kind(0.0d0)) :: zx(*) + complex(kind=kind(0.0d0)) :: x(*) ! .. ! Compute the L2-norm: - nrm2 = dznrm2( N, zx, strideX ) + nrm2 = dznrm2( N, x, strideX ) return end subroutine dznrm2sub diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/test/test.dznrm2.js b/lib/node_modules/@stdlib/blas/base/dznrm2/test/test.dznrm2.js index 5c4e27abfd35..55e09894826e 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/test/test.dznrm2.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/test/test.dznrm2.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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 4, zx, 1 ); + actual = dznrm2( 4, x, 1 ); isApprox( t, actual, expected, 2.0 ); - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 3, zx, 1 ); + actual = dznrm2( 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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 0, zx, 1 ); + actual = dznrm2( 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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 4, zx, 2 ); + actual = dznrm2( 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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 4, zx, -2 ); + actual = dznrm2( 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 zx0; - var zx1; + var x0; + var x1; - zx0 = new Complex128Array([ + x0 = new Complex128Array([ 1.0, 2.0, 3.0, // 1 @@ -207,9 +207,9 @@ tape( 'the function supports view offsets', function test( t ) { ]); expected = 14.1; - zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); + x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); - actual = dznrm2( 3, zx1, 1 ); + actual = dznrm2( 3, x1, 1 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/test/test.dznrm2.native.js b/lib/node_modules/@stdlib/blas/base/dznrm2/test/test.dznrm2.native.js index 80b2186c2514..9d2154201d32 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/test/test.dznrm2.native.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/test/test.dznrm2.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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 4, zx, 1 ); + actual = dznrm2( 4, x, 1 ); isApprox( t, actual, expected, 2.0 ); - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 3, zx, 1 ); + actual = dznrm2( 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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 0, zx, 1 ); + actual = dznrm2( 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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 4, zx, 2 ); + actual = dznrm2( 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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 4, zx, -2 ); + actual = dznrm2( 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 zx0; - var zx1; + var x0; + var x1; - zx0 = new Complex128Array([ + x0 = new Complex128Array([ 1.0, 2.0, 3.0, // 1 @@ -216,9 +216,9 @@ tape( 'the function supports view offsets', opts, function test( t ) { ]); expected = 14.1; - zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); + x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); - actual = dznrm2( 3, zx1, 1 ); + actual = dznrm2( 3, x1, 1 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dznrm2/test/test.ndarray.js index 2657e8fc7216..658a5694c5ba 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 4, zx, 1, 0 ); + actual = dznrm2( 4, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 3, zx, 1, 0 ); + actual = dznrm2( 3, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); // Checked on Wolfram Alpha: - zx = new Complex128Array([ + x = new Complex128Array([ 1e150, // 1 1e150, // 1 1e150, // 2 @@ -119,11 +119,11 @@ tape( 'the function computes the L2-norm', function test( t ) { ]); expected = 2.82842e+150; - actual = dznrm2( 4, zx, 1, 0 ); + actual = dznrm2( 4, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); // Checked on Wolfram Alpha: - zx = new Complex128Array([ + x = new Complex128Array([ 1e-155, // 1 1e-155, // 1 1e-155, // 2 @@ -135,11 +135,11 @@ tape( 'the function computes the L2-norm', function test( t ) { ]); expected = 2.82843e-155; - actual = dznrm2( 4, zx, 1, 0 ); + actual = dznrm2( 4, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); // Checked on Wolfram Alpha: - zx = new Complex128Array([ + x = new Complex128Array([ 1e150, // 1 1e50, // 1 1e150, // 2 @@ -151,11 +151,11 @@ tape( 'the function computes the L2-norm', function test( t ) { ]); expected = 2.00000e150; - actual = dznrm2( 4, zx, 1, 0 ); + actual = dznrm2( 4, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); // Checked on Wolfram Alpha: - zx = new Complex128Array([ + x = new Complex128Array([ 1e-155, // 1 1e50, // 1 1e-155, // 2 @@ -167,11 +167,11 @@ tape( 'the function computes the L2-norm', function test( t ) { ]); expected = 2.00000e50; - actual = dznrm2( 4, zx, 1, 0 ); + actual = dznrm2( 4, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); // Checked on Wolfram Alpha: - zx = new Complex128Array([ + x = new Complex128Array([ 1.4e-154, // 1 1.5e-154, // 1 1.4e-154, // 2 @@ -183,7 +183,7 @@ tape( 'the function computes the L2-norm', function test( t ) { ]); expected = 3.51283e-154; - actual = dznrm2( 4, zx, 1, 0 ); + actual = dznrm2( 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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 0, zx, 1, 0 ); + actual = dznrm2( 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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 4, zx, 2, 0 ); + actual = dznrm2( 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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 4, zx, -2, 6 ); + actual = dznrm2( 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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 3, zx, 1, 1 ); + actual = dznrm2( 3, x, 1, 1 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dznrm2/test/test.ndarray.native.js index 541603eddeda..6260c87e9033 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 4, zx, 1, 0 ); + actual = dznrm2( 4, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 3, zx, 1, 0 ); + actual = dznrm2( 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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 0, zx, 1, 0 ); + actual = dznrm2( 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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 4, zx, 2, 0 ); + actual = dznrm2( 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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 4, zx, -2, 6 ); + actual = dznrm2( 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 zx; + var x; - zx = new Complex128Array([ + x = new Complex128Array([ 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 = dznrm2( 3, zx, 1, 1 ); + actual = dznrm2( 3, x, 1, 1 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); From a8b09bee18960cda2dcc5e8b32d1a76451fafb84 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Mon, 2 Jun 2025 22:00:49 +0530 Subject: [PATCH 2/5] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_f.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_f.c b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_f.c index b3f951675642..add0cd200e36 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_f.c +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_f.c @@ -46,9 +46,9 @@ double API_SUFFIX(c_dznrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT s * @return L2-norm */ double API_SUFFIX(c_dznrm2_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { - stdlib_complex128_t *zx = (stdlib_complex128_t *)X; + stdlib_complex128_t *x = (stdlib_complex128_t *)X; double nrm2; - zx += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); - dznrm2sub( &N, (void *)zx, &strideX, &nrm2 ); + x += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); + dznrm2sub( &N, (void *)x, &strideX, &nrm2 ); return nrm2; } From e732d2a00b77432c781099bd9d327ee0c79f5437 Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 2 Jun 2025 14:36:02 -0700 Subject: [PATCH 3/5] style: be consistent with other packages Signed-off-by: Athan --- .../blas/base/dznrm2/benchmark/fortran/benchmark.length.f | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/fortran/benchmark.length.f b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/fortran/benchmark.length.f index bec4947f73af..3346005c6c7e 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/fortran/benchmark.length.f +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/fortran/benchmark.length.f @@ -124,8 +124,8 @@ double precision function benchmark( iterations, len ) ! .. ! External functions: interface - double precision function dznrm2( N, X, strideX ) - complex(kind=kind(0.0d0)) :: X(*) + double precision function dznrm2( N, x, strideX ) + complex(kind=kind(0.0d0)) :: x(*) integer :: strideX, N end function dznrm2 end interface From b8cf7d02eba8f333571cc66c20436e89cd2c083b Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 2 Jun 2025 14:38:29 -0700 Subject: [PATCH 4/5] style: fix alignment Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_cblas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_cblas.c b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_cblas.c index 5a4b8da6e6cb..1f48576405bf 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_cblas.c @@ -26,7 +26,7 @@ * Computes the L2-norm of a complex double-precision floating-point vector. * * @param N number of indexed elements -* @param X input array +* @param X input array * @param strideX X stride length */ double API_SUFFIX(c_dznrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ) { From 0f97587518099a0e1d2272c05129d012981bf97b Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 2 Jun 2025 14:39:30 -0700 Subject: [PATCH 5/5] style: fix alignment Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_f.c b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_f.c index add0cd200e36..d5781d581449 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_f.c +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/src/dznrm2_f.c @@ -40,7 +40,7 @@ double API_SUFFIX(c_dznrm2)( const CBLAS_INT N, const void *X, const CBLAS_INT s * Computes the L2-norm of a complex double-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