From bd286934fa0f512e702ddcf400d56b03553f3971 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Tue, 3 Jun 2025 15:11:43 +0530 Subject: [PATCH 1/3] docs: change variable naming for blas/base/scasum --- 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/scasum/README.md | 68 +++---- .../blas/base/scasum/benchmark/benchmark.js | 4 +- .../base/scasum/benchmark/benchmark.native.js | 4 +- .../scasum/benchmark/benchmark.ndarray.js | 4 +- .../benchmark/benchmark.ndarray.native.js | 4 +- .../scasum/benchmark/c/benchmark.length.c | 16 +- .../benchmark/fortran/benchmark.length.f | 6 +- .../@stdlib/blas/base/scasum/docs/repl.txt | 36 ++-- .../blas/base/scasum/docs/types/index.d.ts | 34 ++-- .../blas/base/scasum/docs/types/test.ts | 170 +++++++++--------- .../blas/base/scasum/examples/c/example.c | 6 +- .../blas/base/scasum/examples/index.js | 6 +- .../scasum/include/stdlib/blas/base/scasum.h | 4 +- .../include/stdlib/blas/base/scasum_cblas.h | 2 +- .../@stdlib/blas/base/scasum/lib/index.js | 8 +- .../@stdlib/blas/base/scasum/lib/ndarray.js | 14 +- .../blas/base/scasum/lib/ndarray.native.js | 14 +- .../@stdlib/blas/base/scasum/lib/scasum.js | 12 +- .../blas/base/scasum/lib/scasum.native.js | 12 +- .../@stdlib/blas/base/scasum/src/addon.c | 8 +- .../@stdlib/blas/base/scasum/src/scasum.c | 8 +- .../@stdlib/blas/base/scasum/src/scasum.f | 14 +- .../blas/base/scasum/src/scasum_cblas.c | 22 +-- .../@stdlib/blas/base/scasum/src/scasum_f.c | 22 +-- .../blas/base/scasum/src/scasum_ndarray.c | 10 +- .../@stdlib/blas/base/scasum/src/scasumsub.f | 16 +- .../blas/base/scasum/test/test.ndarray.js | 44 ++--- .../base/scasum/test/test.ndarray.native.js | 44 ++--- .../blas/base/scasum/test/test.scasum.js | 42 ++--- .../base/scasum/test/test.scasum.native.js | 42 ++--- 30 files changed, 348 insertions(+), 348 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/scasum/README.md b/lib/node_modules/@stdlib/blas/base/scasum/README.md index 0181c0f29e44..93349e142afd 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/README.md +++ b/lib/node_modules/@stdlib/blas/base/scasum/README.md @@ -30,33 +30,33 @@ limitations under the License. var scasum = require( '@stdlib/blas/base/scasum' ); ``` -#### scasum( N, cx, strideX ) +#### scasum( N, x, strideX ) Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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 out = scasum( 4, cx, 1 ); +var out = scasum( 4, x, 1 ); // returns ~1.6 ``` 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 out = scasum( 2, cx, 2 ); +var out = scasum( 2, x, 2 ); // returns 7.0 ``` @@ -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-out: -var out = scasum( 2, cx1, 1 ); +var out = scasum( 2, x1, 1 ); // returns 18.0 ``` -#### scasum.ndarray( N, cx, strideX, offset ) +#### scasum.ndarray( N, x, strideX, offset ) Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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 out = scasum.ndarray( 4, cx, 1, 0 ); +var out = scasum.ndarray( 4, x, 1, 0 ); // returns ~1.6 ``` @@ -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 out = scasum.ndarray( 2, cx, 1, 1 ); +var out = scasum.ndarray( 2, x, 1, 1 ); // returns 18.0 ``` @@ -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 sum of the absolute values of real and imaginary components: -var out = scasum( cx.length, cx, 1 ); +var out = scasum( x.length, x, 1 ); console.log( out ); ``` @@ -173,47 +173,47 @@ console.log( out ); #include "stdlib/blas/base/scasum.h" ``` -#### c_scasum( N, \*CX, strideX ) +#### c_scasum( N, \*X, strideX ) Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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 out = c_scasum( 4, (void *)cx, 1 ); +float out = c_scasum( 4, (void *)X, 1 ); // returns 1.6f ``` 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_scasum( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX ); +float c_scasum( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ); ``` -#### c_scasum_ndarray( N, \*CX, strideX, offsetX ) +#### c_scasum_ndarray( N, \*X, strideX, offsetX ) Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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 out = c_scasum_ndarray( 4, (void *)cx, 1, 0 ); +float out = c_scasum_ndarray( 4, (void *)X, 1, 0 ); // returns 1.6f ``` 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`. -- **offsetX**: `[in] CBLAS_INT` starting index for `CX`. +- **X**: `[in] void*` input array. +- **strideX**: `[in] CBLAS_INT` index increment for `X`. +- **offsetX**: `[in] CBLAS_INT` starting index for `X`. ```c -float c_scasum_ndarray( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +float c_scasum_ndarray( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); ``` @@ -240,7 +240,7 @@ float c_scasum_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; @@ -249,13 +249,13 @@ int main( void ) { const int strideX = 1; // Compute the sum of the absolute values of real and imaginary components: - float out = c_scasum( N, (void *)cx, strideX ); + float out = c_scasum( N, (void *)X, strideX ); // Print the result: printf( "out: %f\n", out ); // Compute the sum of the absolute values of real and imaginary components using alternative indexing semantics: - out = c_scasum_ndarray( N, (void *)cx, -strideX, N-1 ); + out = c_scasum_ndarray( N, (void *)X, -strideX, N-1 ); // Print the result: printf( "out: %f\n", out ); diff --git a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.js index f46cbdab9e42..1f2681f4dbe6 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/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++ ) { - out = scasum( cx.length, cx, 1 ); + out = scasum( x.length, x, 1 ); if ( isnanf( out ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.native.js index 7c30f90fe005..30032c5b11ca 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/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++ ) { - out = scasum( cx.length, cx, 1 ); + out = scasum( x.length, x, 1 ); if ( isnanf( out ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.ndarray.js index 020d7242d135..ab008c248691 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/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++ ) { - out = scasum( cx.length, cx, 1, 0 ); + out = scasum( x.length, x, 1, 0 ); if ( isnanf( out ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.ndarray.native.js index 8602518dd402..306887f5e336 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/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++ ) { - out = scasum( cx.length, cx, 1, 0 ); + out = scasum( x.length, x, 1, 0 ); if ( isnanf( out ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/c/benchmark.length.c index 04cec5466075..007a5b94b37f 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/scasum/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 out; 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; } out = 0.0f; t = tic(); for ( i = 0; i < iterations; i++ ) { - out = c_scasum( len, (void *)cx, 1 ); + out = c_scasum( len, (void *)X, 1 ); if ( out != out ) { 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 out; 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; } out = 0.0f; t = tic(); for ( i = 0; i < iterations; i++ ) { - out = c_scasum_ndarray( len, (void *)cx, 1, 0 ); + out = c_scasum_ndarray( len, (void *)X, 1, 0 ); if ( out != out ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/fortran/benchmark.length.f b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/fortran/benchmark.length.f index ca14073e4f34..532e2e237011 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/fortran/benchmark.length.f +++ b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/fortran/benchmark.length.f @@ -124,8 +124,8 @@ double precision function benchmark( iterations, len ) ! .. ! External functions: interface - real function scasum( N, cx, strideX ) - complex :: cx(*) + real function scasum( N, x, strideX ) + complex :: x(*) integer :: strideX, N end function scasum 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/scasum/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/scasum/docs/repl.txt index 1fc1b8f68775..89c200ac9e81 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/scasum/docs/repl.txt @@ -1,5 +1,5 @@ -{{alias}}( N, cx, strideX ) +{{alias}}( N, x, strideX ) Computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector. @@ -16,11 +16,11 @@ N: integer Number of indexed elements. - cx: Complex64Array + x: Complex64Array Input array. strideX: integer - Index increment for `cx`. + Index increment for `x`. Returns ------- @@ -30,23 +30,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 ) ~1.6 // 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 ) 18.0 // 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 ) 18.0 -{{alias}}.ndarray( N, cx, strideX, offsetX ) +{{alias}}.ndarray( N, x, strideX, offsetX ) Computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector using alternative indexing semantics. @@ -60,14 +60,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 ------- @@ -77,13 +77,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 ) 18.0 // 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 ) 18.0 See Also diff --git a/lib/node_modules/@stdlib/blas/base/scasum/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/scasum/docs/types/index.d.ts index 72e73524703f..0e4c8cb43515 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/scasum/docs/types/index.d.ts @@ -30,62 +30,62 @@ interface Routine { * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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 * @returns out * * @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 out = scasum( 5, cx, 1 ); + * var out = scasum( 5, x, 1 ); * // returns ~6.9 */ - ( N: number, cx: Complex64Array, strideX: number ): number; + ( N: number, x: Complex64Array, strideX: number ): number; /** * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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` * @returns out * * @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 out = scasum.ndarray( 5, cx, 1, 0 ); + * var out = scasum.ndarray( 5, x, 1, 0 ); * // returns ~6.9 */ - ndarray( N: number, cx: Complex64Array, strideX: number, offsetX: number ): number; + ndarray( N: number, x: Complex64Array, strideX: number, offsetX: number ): number; } /** * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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 * @returns out * * @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 out = scasum( 4, cx, 2 ); +* var out = scasum( 4, x, 2 ); * // returns ~1.6 * * @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 out = scasum.ndarray( 4, cx, 2, 0 ); +* var out = scasum.ndarray( 4, x, 2, 0 ); * // returns ~1.6 */ declare var scasum: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/scasum/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/scasum/docs/types/test.ts index 0d4204292076..89de3b2c2170 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/scasum/docs/types/test.ts @@ -24,135 +24,135 @@ import scasum = require( './index' ); // The function returns a number... { - const cx = new Complex64Array( 10 ); + const x = new Complex64Array( 10 ); - scasum( cx.length, cx, 1 ); // $ExpectType number + scasum( 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 ); - - scasum( '10', cx, 1 ); // $ExpectError - scasum( true, cx, 1 ); // $ExpectError - scasum( false, cx, 1 ); // $ExpectError - scasum( null, cx, 1 ); // $ExpectError - scasum( undefined, cx, 1 ); // $ExpectError - scasum( [], cx, 1 ); // $ExpectError - scasum( {}, cx, 1 ); // $ExpectError - scasum( ( cx: number ): number => cx, cx, 1 ); // $ExpectError + const x = new Complex64Array( 10 ); + + scasum( '10', x, 1 ); // $ExpectError + scasum( true, x, 1 ); // $ExpectError + scasum( false, x, 1 ); // $ExpectError + scasum( null, x, 1 ); // $ExpectError + scasum( undefined, x, 1 ); // $ExpectError + scasum( [], x, 1 ); // $ExpectError + scasum( {}, x, 1 ); // $ExpectError + scasum( ( 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 ); - - scasum( cx.length, 10, 1 ); // $ExpectError - scasum( cx.length, '10', 1 ); // $ExpectError - scasum( cx.length, true, 1 ); // $ExpectError - scasum( cx.length, false, 1 ); // $ExpectError - scasum( cx.length, null, 1 ); // $ExpectError - scasum( cx.length, undefined, 1 ); // $ExpectError - scasum( cx.length, [], 1 ); // $ExpectError - scasum( cx.length, {}, 1 ); // $ExpectError - scasum( cx.length, ( cx: number ): number => cx, 1 ); // $ExpectError + const x = new Complex64Array( 10 ); + + scasum( x.length, 10, 1 ); // $ExpectError + scasum( x.length, '10', 1 ); // $ExpectError + scasum( x.length, true, 1 ); // $ExpectError + scasum( x.length, false, 1 ); // $ExpectError + scasum( x.length, null, 1 ); // $ExpectError + scasum( x.length, undefined, 1 ); // $ExpectError + scasum( x.length, [], 1 ); // $ExpectError + scasum( x.length, {}, 1 ); // $ExpectError + scasum( 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 ); - - scasum( cx.length, cx, '10' ); // $ExpectError - scasum( cx.length, cx, true ); // $ExpectError - scasum( cx.length, cx, false ); // $ExpectError - scasum( cx.length, cx, null ); // $ExpectError - scasum( cx.length, cx, undefined ); // $ExpectError - scasum( cx.length, cx, [] ); // $ExpectError - scasum( cx.length, cx, {} ); // $ExpectError - scasum( cx.length, cx, ( cx: number ): number => cx ); // $ExpectError + const x = new Complex64Array( 10 ); + + scasum( x.length, x, '10' ); // $ExpectError + scasum( x.length, x, true ); // $ExpectError + scasum( x.length, x, false ); // $ExpectError + scasum( x.length, x, null ); // $ExpectError + scasum( x.length, x, undefined ); // $ExpectError + scasum( x.length, x, [] ); // $ExpectError + scasum( x.length, x, {} ); // $ExpectError + scasum( 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 ); scasum(); // $ExpectError - scasum( cx.length ); // $ExpectError - scasum( cx.length, cx ); // $ExpectError - scasum( cx.length, cx, 1, 10 ); // $ExpectError + scasum( x.length ); // $ExpectError + scasum( x.length, x ); // $ExpectError + scasum( 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 ); - scasum.ndarray( cx.length, cx, 1, 0 ); // $ExpectType number + scasum.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 ); - - scasum.ndarray( '10', cx, 1, 0 ); // $ExpectError - scasum.ndarray( true, cx, 1, 0 ); // $ExpectError - scasum.ndarray( false, cx, 1, 0 ); // $ExpectError - scasum.ndarray( null, cx, 1, 0 ); // $ExpectError - scasum.ndarray( undefined, cx, 1, 0 ); // $ExpectError - scasum.ndarray( [], cx, 1, 0 ); // $ExpectError - scasum.ndarray( {}, cx, 1, 0 ); // $ExpectError - scasum.ndarray( ( cx: number ): number => cx, cx, 1, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + + scasum.ndarray( '10', x, 1, 0 ); // $ExpectError + scasum.ndarray( true, x, 1, 0 ); // $ExpectError + scasum.ndarray( false, x, 1, 0 ); // $ExpectError + scasum.ndarray( null, x, 1, 0 ); // $ExpectError + scasum.ndarray( undefined, x, 1, 0 ); // $ExpectError + scasum.ndarray( [], x, 1, 0 ); // $ExpectError + scasum.ndarray( {}, x, 1, 0 ); // $ExpectError + scasum.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 ); - - scasum.ndarray( cx.length, 10, 1, 0 ); // $ExpectError - scasum.ndarray( cx.length, '10', 1, 0 ); // $ExpectError - scasum.ndarray( cx.length, true, 1, 0 ); // $ExpectError - scasum.ndarray( cx.length, false, 1, 0 ); // $ExpectError - scasum.ndarray( cx.length, null, 1, 0 ); // $ExpectError - scasum.ndarray( cx.length, undefined, 1, 0 ); // $ExpectError - scasum.ndarray( cx.length, [], 1, 0 ); // $ExpectError - scasum.ndarray( cx.length, {}, 1, 0 ); // $ExpectError - scasum.ndarray( cx.length, ( cx: number ): number => cx, 1, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + + scasum.ndarray( x.length, 10, 1, 0 ); // $ExpectError + scasum.ndarray( x.length, '10', 1, 0 ); // $ExpectError + scasum.ndarray( x.length, true, 1, 0 ); // $ExpectError + scasum.ndarray( x.length, false, 1, 0 ); // $ExpectError + scasum.ndarray( x.length, null, 1, 0 ); // $ExpectError + scasum.ndarray( x.length, undefined, 1, 0 ); // $ExpectError + scasum.ndarray( x.length, [], 1, 0 ); // $ExpectError + scasum.ndarray( x.length, {}, 1, 0 ); // $ExpectError + scasum.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 ); - - scasum.ndarray( cx.length, cx, '10', 0 ); // $ExpectError - scasum.ndarray( cx.length, cx, true, 0 ); // $ExpectError - scasum.ndarray( cx.length, cx, false, 0 ); // $ExpectError - scasum.ndarray( cx.length, cx, null, 0 ); // $ExpectError - scasum.ndarray( cx.length, cx, undefined, 0 ); // $ExpectError - scasum.ndarray( cx.length, cx, [], 0 ); // $ExpectError - scasum.ndarray( cx.length, cx, {}, 0 ); // $ExpectError - scasum.ndarray( cx.length, cx, ( cx: number ): number => cx, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + + scasum.ndarray( x.length, x, '10', 0 ); // $ExpectError + scasum.ndarray( x.length, x, true, 0 ); // $ExpectError + scasum.ndarray( x.length, x, false, 0 ); // $ExpectError + scasum.ndarray( x.length, x, null, 0 ); // $ExpectError + scasum.ndarray( x.length, x, undefined, 0 ); // $ExpectError + scasum.ndarray( x.length, x, [], 0 ); // $ExpectError + scasum.ndarray( x.length, x, {}, 0 ); // $ExpectError + scasum.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 ); - - scasum.ndarray( cx.length, cx, 1, '10' ); // $ExpectError - scasum.ndarray( cx.length, cx, 1, true ); // $ExpectError - scasum.ndarray( cx.length, cx, 1, false ); // $ExpectError - scasum.ndarray( cx.length, cx, 1, null ); // $ExpectError - scasum.ndarray( cx.length, cx, 1, undefined ); // $ExpectError - scasum.ndarray( cx.length, cx, 1, [] ); // $ExpectError - scasum.ndarray( cx.length, cx, 1, {} ); // $ExpectError - scasum.ndarray( cx.length, cx, 1, ( cx: number ): number => cx ); // $ExpectError + const x = new Complex64Array( 10 ); + + scasum.ndarray( x.length, x, 1, '10' ); // $ExpectError + scasum.ndarray( x.length, x, 1, true ); // $ExpectError + scasum.ndarray( x.length, x, 1, false ); // $ExpectError + scasum.ndarray( x.length, x, 1, null ); // $ExpectError + scasum.ndarray( x.length, x, 1, undefined ); // $ExpectError + scasum.ndarray( x.length, x, 1, [] ); // $ExpectError + scasum.ndarray( x.length, x, 1, {} ); // $ExpectError + scasum.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 ); scasum.ndarray(); // $ExpectError - scasum.ndarray( cx.length ); // $ExpectError - scasum.ndarray( cx.length, cx ); // $ExpectError - scasum.ndarray( cx.length, cx, 1 ); // $ExpectError - scasum.ndarray( cx.length, cx, 1, 0, 10 ); // $ExpectError + scasum.ndarray( x.length ); // $ExpectError + scasum.ndarray( x.length, x ); // $ExpectError + scasum.ndarray( x.length, x, 1 ); // $ExpectError + scasum.ndarray( x.length, x, 1, 0, 10 ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/scasum/examples/c/example.c index 9f1826ad6887..8a0ab3456b1b 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/scasum/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 sum of the absolute values of real and imaginary components: - float out = c_scasum( N, (void *)cx, strideX ); + float out = c_scasum( N, (void *)X, strideX ); // Print the result: printf( "out: %f\n", out ); // Compute the sum of the absolute values of real and imaginary components using alternative indexing semantics: - out = c_scasum_ndarray( N, (void *)cx, -strideX, N-1 ); + out = c_scasum_ndarray( N, (void *)X, -strideX, N-1 ); // Print the result: printf( "out: %f\n", out ); diff --git a/lib/node_modules/@stdlib/blas/base/scasum/examples/index.js b/lib/node_modules/@stdlib/blas/base/scasum/examples/index.js index 21df227bc543..35b925af6ab0 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/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 sum of the absolute values of real and imaginary components: -var out = scasum( cx.length, cx, 1 ); +var out = scasum( x.length, x, 1 ); console.log( out ); diff --git a/lib/node_modules/@stdlib/blas/base/scasum/include/stdlib/blas/base/scasum.h b/lib/node_modules/@stdlib/blas/base/scasum/include/stdlib/blas/base/scasum.h index c029fee74ec4..05fad598721e 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/include/stdlib/blas/base/scasum.h +++ b/lib/node_modules/@stdlib/blas/base/scasum/include/stdlib/blas/base/scasum.h @@ -34,12 +34,12 @@ extern "C" { /** * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector. */ -float API_SUFFIX(c_scasum)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX ); +float API_SUFFIX(c_scasum)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ); /** * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector using alternative indexing semantics. */ -float API_SUFFIX(c_scasum_ndarray)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +float API_SUFFIX(c_scasum_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/scasum/include/stdlib/blas/base/scasum_cblas.h b/lib/node_modules/@stdlib/blas/base/scasum/include/stdlib/blas/base/scasum_cblas.h index 65411298a01e..b1d88eb82860 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/include/stdlib/blas/base/scasum_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/scasum/include/stdlib/blas/base/scasum_cblas.h @@ -34,7 +34,7 @@ extern "C" { /** * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector. */ -float API_SUFFIX(cblas_scasum)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX ); +float API_SUFFIX(cblas_scasum)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ); #ifdef __cplusplus } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/lib/index.js b/lib/node_modules/@stdlib/blas/base/scasum/lib/index.js index cdd7b461fe31..8dc574ca46d0 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/lib/index.js @@ -27,18 +27,18 @@ * var Complex64Array = require( '@stdlib/array/complex64' ); * var scasum = require( '@stdlib/blas/base/scasum' ); * -* 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 out = scasum( cx.length, cx, 1 ); +* var out = scasum( x.length, x, 1 ); * // returns 19.0 * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var scasum = require( '@stdlib/blas/base/scasum' ); * -* 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 out = scasum.ndarray( cx.length, cx, 1, 0 ); +* var out = scasum.ndarray( x.length, x, 1, 0 ); * // returns 19.0 */ diff --git a/lib/node_modules/@stdlib/blas/base/scasum/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/scasum/lib/ndarray.js index 716fcce3e40c..1b14035f4c34 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/lib/ndarray.js @@ -31,20 +31,20 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' ); * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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} result * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * -* var cx = new Complex64Array( [ 5.0, -3.0, 6.0, 4.0 ] ); +* var x = new Complex64Array( [ 5.0, -3.0, 6.0, 4.0 ] ); * -* var out = scasum( cx.length, cx, 1, 0 ); +* var out = scasum( x.length, x, 1, 0 ); * // returns 18.0 */ -function scasum( N, cx, strideX, offsetX ) { +function scasum( N, x, strideX, offsetX ) { var stemp; var viewX; var ix; @@ -55,7 +55,7 @@ function scasum( N, cx, strideX, offsetX ) { if ( N <= 0 ) { return stemp; } - viewX = reinterpret( cx, 0 ); + viewX = reinterpret( x, 0 ); sx = strideX * 2; ix = offsetX * 2; for ( i = 0; i < N; i++ ) { diff --git a/lib/node_modules/@stdlib/blas/base/scasum/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/scasum/lib/ndarray.native.js index 63bd2ef00527..9bafcc19097f 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/lib/ndarray.native.js @@ -30,21 +30,21 @@ var addon = require( './../src/addon.node' ); * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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} result * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * -* var cx = new Complex64Array( [ 4.0, 2.0, -3.0, 5.0 ] ); +* var x = new Complex64Array( [ 4.0, 2.0, -3.0, 5.0 ] ); * -* var out = scasum( cx.length, cx, 1, 0 ); +* var out = scasum( x.length, x, 1, 0 ); * // returns 14.0 */ -function scasum( N, cx, strideX, offsetX ) { - var viewX = reinterpret( cx, 0 ); +function scasum( 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/scasum/lib/scasum.js b/lib/node_modules/@stdlib/blas/base/scasum/lib/scasum.js index 45da9affed07..865c530a9239 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/lib/scasum.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/lib/scasum.js @@ -30,21 +30,21 @@ var ndarray = require( './ndarray.js' ); * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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} result * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * -* var cx = new Complex64Array( [ 5.0, -3.0, 6.0, 4.0 ] ); +* var x = new Complex64Array( [ 5.0, -3.0, 6.0, 4.0 ] ); * -* var out = scasum( cx.length, cx, 1 ); +* var out = scasum( x.length, x, 1 ); * // returns 18.0 */ -function scasum( N, cx, strideX ) { +function scasum( N, x, strideX ) { var ox = stride2offset( N, strideX ); - return ndarray( N, cx, strideX, ox ); + return ndarray( N, x, strideX, ox ); } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/lib/scasum.native.js b/lib/node_modules/@stdlib/blas/base/scasum/lib/scasum.native.js index 4e59e1e8fcd9..b8e82963404a 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/lib/scasum.native.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/lib/scasum.native.js @@ -30,20 +30,20 @@ var addon = require( './../src/addon.node' ); * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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} result * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * -* var cx = new Complex64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0, 2.0 ] ); +* var x = new Complex64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0, 2.0 ] ); * -* var out = scasum( cx.length, cx, 1 ); +* var out = scasum( x.length, x, 1 ); * // returns 17.0 */ -function scasum( N, cx, strideX ) { - var viewX = reinterpret( cx, 0 ); +function scasum( N, x, strideX ) { + var viewX = reinterpret( x, 0 ); return addon( N, viewX, strideX ); } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/src/addon.c b/lib/node_modules/@stdlib/blas/base/scasum/src/addon.c index 06b7b0abedcd..041627a65bae 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/src/addon.c +++ b/lib/node_modules/@stdlib/blas/base/scasum/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_scasum)( N, (void *)CX, strideX ), out ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 1 ); + STDLIB_NAPI_CREATE_DOUBLE( env, (double)API_SUFFIX(c_scasum)( N, (void *)X, strideX ), out ); return out; } @@ -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_scasum_ndarray)( N, (void *)CX, strideX, offsetX ), out ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 1 ); + STDLIB_NAPI_CREATE_DOUBLE( env, (double)API_SUFFIX(c_scasum_ndarray)( N, (void *)X, strideX, offsetX ), out ); return out; } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum.c b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum.c index 305212ba555b..9dd4135b166e 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum.c +++ b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum.c @@ -24,10 +24,10 @@ * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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_scasum)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX ) { +float API_SUFFIX(c_scasum)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ) { CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); - return API_SUFFIX(c_scasum_ndarray)( N, CX, strideX, ox ); + return API_SUFFIX(c_scasum_ndarray)( N, X, strideX, ox ); } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum.f b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum.f index db9e192422cd..96ccc4b708cb 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum.f +++ b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum.f @@ -44,18 +44,18 @@ ! > * 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} result !< -real function scasum( N, cx, strideX ) +real function scasum( N, x, strideX ) implicit none ! .. ! Scalar arguments: integer :: N, strideX ! .. ! Array arguments: - complex :: cx( * ) + complex :: x( * ) ! .. ! Local scalars: integer :: i, nix @@ -70,14 +70,14 @@ real function scasum( N, cx, strideX ) if ( N <= 0 .or. strideX <= 0 ) return if( strideX == 1 ) then do i = 1, N - stemp = stemp + abs( real( cx( i ) ) ) + abs( aimag( cx( i ) ) ) + stemp = stemp + abs( real( x( i ) ) ) + abs( aimag( x( i ) ) ) end do else nix = N*strideX do i = 1, nix, strideX - stemp = stemp + abs( real( cx( i ) ) ) + abs( aimag( cx( i ) ) ) + stemp = stemp + abs( real( x( i ) ) ) + abs( aimag( x( i ) ) ) end do end if scasum = stemp return -end function scasum \ No newline at end of file +end function scasum diff --git a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_cblas.c b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_cblas.c index e780a4b4ed26..de5672caf4ff 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_cblas.c @@ -26,31 +26,31 @@ * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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_scasum)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX ) { +float API_SUFFIX(c_scasum)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ) { CBLAS_INT sx = strideX; if( sx < 0 ) { sx = -sx; } - return API_SUFFIX(cblas_scasum)( N, CX, sx ); + return API_SUFFIX(cblas_scasum)( N, X, sx ); } /** * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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_scasum_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_scasum_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + stdlib_complex64_t *x = (stdlib_complex64_t *)X; CBLAS_INT sx = strideX; if( sx < 0 ) { sx = -sx; } - cx += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); - return API_SUFFIX(cblas_scasum)( N, (void *)cx, sx ); + x += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); + return API_SUFFIX(cblas_scasum)( N, (void *)x, sx ); } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_f.c b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_f.c index 607ede038504..ce3b493a9bfd 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_f.c +++ b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_f.c @@ -26,11 +26,11 @@ * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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 result */ -float API_SUFFIX(c_scasum)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX ) { +float API_SUFFIX(c_scasum)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX ) { CBLAS_INT sx; float out; @@ -38,7 +38,7 @@ float API_SUFFIX(c_scasum)( const CBLAS_INT N, const void *CX, const CBLAS_INT s if ( sx < 0 ) { sx = -sx; } - scasumsub( &N, CX, &sx, &out ); + scasumsub( &N, X, &sx, &out ); return out; } @@ -46,20 +46,20 @@ float API_SUFFIX(c_scasum)( const CBLAS_INT N, const void *CX, const CBLAS_INT s * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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 result */ -float API_SUFFIX(c_scasum_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_scasum_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + stdlib_complex64_t *x = (stdlib_complex64_t *)X; CBLAS_INT sx = strideX; float out; - cx += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); + x += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); if ( sx < 0 ) { sx = -sx; } - scasumsub( &N, (void *)cx, &sx, &out ); + scasumsub( &N, (void *)x, &sx, &out ); return out; } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_ndarray.c b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_ndarray.c index 04262b03704b..9fec655881ad 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_ndarray.c @@ -24,12 +24,12 @@ * Computes the sum of the absolute values of the real and imaginary components of a single-precision complex 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_scasum_ndarray)( const CBLAS_INT N, const void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { - float *x = (float *)CX; +float API_SUFFIX(c_scasum_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + float *x = (float *)X; float stemp; CBLAS_INT sx; CBLAS_INT ix; diff --git a/lib/node_modules/@stdlib/blas/base/scasum/src/scasumsub.f b/lib/node_modules/@stdlib/blas/base/scasum/src/scasumsub.f index d7d31791086d..8a715c31903e 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/src/scasumsub.f +++ b/lib/node_modules/@stdlib/blas/base/scasum/src/scasumsub.f @@ -19,17 +19,17 @@ !> Wraps `scasum` 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} out - output variable reference !< -subroutine scasumsub( N, cx, strideX, out ) +subroutine scasumsub( N, x, strideX, out ) implicit none ! .. ! External functions: interface - real function scasum( N, cx, strideX ) - complex :: cx(*) + real function scasum( N, x, strideX ) + complex :: x(*) integer :: strideX, N end function scasum end interface @@ -39,8 +39,8 @@ end function scasum real :: out ! .. ! Array arguments: - complex :: cx(*) + complex :: x(*) ! .. - out = scasum( N, cx, strideX ) + out = scasum( N, x, strideX ) return -end subroutine scasumsub \ No newline at end of file +end subroutine scasumsub diff --git a/lib/node_modules/@stdlib/blas/base/scasum/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/scasum/test/test.ndarray.js index 8090285df36c..6f34f4c3fce4 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/test/test.ndarray.js @@ -68,9 +68,9 @@ tape( 'the function has an arity of 4', function test( t ) { tape( 'the function computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector', 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 @@ -84,10 +84,10 @@ tape( 'the function computes the sum of the absolute values of the real and imag ]); expected = 1.6; - actual = scasum( 4, cx, 1, 0 ); + actual = scasum( 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 @@ -99,7 +99,7 @@ tape( 'the function computes the sum of the absolute values of the real and imag ]); expected = 1.3; - actual = scasum( 3, cx, 1, 0 ); + actual = scasum( 3, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -107,9 +107,9 @@ tape( 'the function computes the sum of the absolute values of the real and imag 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, @@ -117,10 +117,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu ]); expected = 0.0; - actual = scasum( 0, cx, 1, 0 ); + actual = scasum( 0, x, 1, 0 ); t.strictEqual( actual, expected, 'returns expected value' ); - cx = new Complex64Array([ + x = new Complex64Array([ 1.0, 2.0, 3.0, @@ -128,7 +128,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu ]); expected = 0.0; - actual = scasum( -1, cx, 1, 0 ); + actual = scasum( -1, x, 1, 0 ); t.strictEqual( actual, expected, 'returns expected value' ); t.end(); @@ -137,9 +137,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, @@ -159,7 +159,7 @@ tape( 'the function supports specifying a stride', function test( t ) { ]); expected = 1.6; - actual = scasum( 4, cx, 2, 0 ); + actual = scasum( 4, x, 2, 0 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -167,9 +167,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, // 4 0.1, // 4 5.0, // 3 @@ -189,7 +189,7 @@ tape( 'the function supports specifying a negative stride', function test( t ) { ]); expected = 28.9; - actual = scasum( 4, cx, -1, 3 ); + actual = scasum( 4, x, -1, 3 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -197,9 +197,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 @@ -213,7 +213,7 @@ tape( 'the function supports specifying an offset', function test( t ) { ]); expected = 33.0; - actual = scasum( 3, cx, 1, 1 ); + actual = scasum( 3, x, 1, 1 ); t.strictEqual( actual, expected, 'returns expected value' ); t.end(); }); @@ -221,9 +221,9 @@ tape( 'the function supports specifying an offset', function test( t ) { tape( 'the function supports specifying complex access patterns', function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 0.3, // 4 0.1, // 4 5.0, @@ -243,7 +243,7 @@ tape( 'the function supports specifying complex access patterns', function test( ]); expected = 1.6; - actual = scasum( 4, cx, -2, 6 ); + actual = scasum( 4, x, -2, 6 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/scasum/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/scasum/test/test.ndarray.native.js index f90fc0b2689e..1196f4be567d 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/test/test.ndarray.native.js @@ -77,9 +77,9 @@ tape( 'the function has an arity of 4', opts, function test( t ) { tape( 'the function computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector', 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 @@ -93,10 +93,10 @@ tape( 'the function computes the sum of the absolute values of the real and imag ]); expected = 1.6; - actual = scasum( 4, cx, 1, 0 ); + actual = scasum( 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 @@ -108,7 +108,7 @@ tape( 'the function computes the sum of the absolute values of the real and imag ]); expected = 1.3; - actual = scasum( 3, cx, 1, 0 ); + actual = scasum( 3, x, 1, 0 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -116,9 +116,9 @@ tape( 'the function computes the sum of the absolute values of the real and imag 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, @@ -126,10 +126,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu ]); expected = 0.0; - actual = scasum( 0, cx, 1, 0 ); + actual = scasum( 0, x, 1, 0 ); t.strictEqual( actual, expected, 'returns expected value' ); - cx = new Complex64Array([ + x = new Complex64Array([ 1.0, 2.0, 3.0, @@ -137,7 +137,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu ]); expected = 0.0; - actual = scasum( -1, cx, 1, 0 ); + actual = scasum( -1, x, 1, 0 ); t.strictEqual( actual, expected, 'returns expected value' ); t.end(); @@ -146,9 +146,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, @@ -168,7 +168,7 @@ tape( 'the function supports specifying a stride', opts, function test( t ) { ]); expected = 1.6; - actual = scasum( 4, cx, 2, 0 ); + actual = scasum( 4, x, 2, 0 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -176,9 +176,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, // 4 0.1, // 4 5.0, // 3 @@ -198,7 +198,7 @@ tape( 'the function supports specifying a negative stride', opts, function test( ]); expected = 28.9; - actual = scasum( 4, cx, -1, 3 ); + actual = scasum( 4, x, -1, 3 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -206,9 +206,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 @@ -222,7 +222,7 @@ tape( 'the function supports specifying an offset', opts, function test( t ) { ]); expected = 33.0; - actual = scasum( 3, cx, 1, 1 ); + actual = scasum( 3, x, 1, 1 ); t.strictEqual( actual, expected, 'returns expected value' ); t.end(); }); @@ -230,9 +230,9 @@ tape( 'the function supports specifying an offset', opts, function test( t ) { tape( 'the function supports specifying complex access patterns', opts, function test( t ) { var expected; var actual; - var cx; + var x; - cx = new Complex64Array([ + x = new Complex64Array([ 0.3, // 4 0.1, // 4 5.0, @@ -252,7 +252,7 @@ tape( 'the function supports specifying complex access patterns', opts, function ]); expected = 1.6; - actual = scasum( 4, cx, -2, 6 ); + actual = scasum( 4, x, -2, 6 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/scasum/test/test.scasum.js b/lib/node_modules/@stdlib/blas/base/scasum/test/test.scasum.js index bde8a66d5c4d..4a534573d18e 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/test/test.scasum.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/test/test.scasum.js @@ -68,9 +68,9 @@ tape( 'the function has an arity of 3', function test( t ) { tape( 'the function computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector', 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 @@ -84,10 +84,10 @@ tape( 'the function computes the sum of the absolute values of the real and imag ]); expected = 1.6; - actual = scasum( 4, cx, 1 ); + actual = scasum( 4, x, 1 ); isApprox( t, actual, expected, 2.0 ); - cx = new Complex64Array([ + x = new Complex64Array([ 0.1, // 1 0.1, // 1 -0.6, // 2 @@ -99,7 +99,7 @@ tape( 'the function computes the sum of the absolute values of the real and imag ]); expected = 1.3; - actual = scasum( 3, cx, 1 ); + actual = scasum( 3, x, 1 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -107,9 +107,9 @@ tape( 'the function computes the sum of the absolute values of the real and imag 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, @@ -117,10 +117,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu ]); expected = 0.0; - actual = scasum( 0, cx, 1 ); + actual = scasum( 0, x, 1 ); t.strictEqual( actual, expected, 'returns expected value' ); - cx = new Complex64Array([ + x = new Complex64Array([ 1.0, 2.0, 3.0, @@ -128,7 +128,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu ]); expected = 0.0; - actual = scasum( -1, cx, 1 ); + actual = scasum( -1, x, 1 ); t.strictEqual( actual, expected, 'returns expected value' ); t.end(); @@ -137,9 +137,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, @@ -159,7 +159,7 @@ tape( 'the function supports specifying a stride', function test( t ) { ]); expected = 1.6; - actual = scasum( 4, cx, 2 ); + actual = scasum( 4, x, 2 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -167,9 +167,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, // 4 0.1, // 4 5.0, // 3 @@ -181,7 +181,7 @@ tape( 'the function supports specifying a negative stride', function test( t ) { ]); expected = 28.9; - actual = scasum( 4, cx, -1 ); + actual = scasum( 4, x, -1 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -189,10 +189,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 @@ -206,9 +206,9 @@ tape( 'the function supports view offsets', function test( t ) { ]); expected = 33.0; - cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); + x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); - actual = scasum( 3, cx1, 1 ); + actual = scasum( 3, x1, 1 ); t.strictEqual( actual, expected, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/scasum/test/test.scasum.native.js b/lib/node_modules/@stdlib/blas/base/scasum/test/test.scasum.native.js index 7ad9856a4093..4185bfb1b6ee 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/test/test.scasum.native.js +++ b/lib/node_modules/@stdlib/blas/base/scasum/test/test.scasum.native.js @@ -77,9 +77,9 @@ tape( 'the function has an arity of 3', opts, function test( t ) { tape( 'the function computes the sum of the absolute values of the real and imaginary components of a single-precision complex floating-point vector', 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 @@ -93,10 +93,10 @@ tape( 'the function computes the sum of the absolute values of the real and imag ]); expected = 1.6; - actual = scasum( 4, cx, 1 ); + actual = scasum( 4, x, 1 ); isApprox( t, actual, expected, 2.0 ); - cx = new Complex64Array([ + x = new Complex64Array([ 0.1, // 1 0.1, // 1 -0.6, // 2 @@ -108,7 +108,7 @@ tape( 'the function computes the sum of the absolute values of the real and imag ]); expected = 1.3; - actual = scasum( 3, cx, 1 ); + actual = scasum( 3, x, 1 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -116,9 +116,9 @@ tape( 'the function computes the sum of the absolute values of the real and imag 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, @@ -126,10 +126,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu ]); expected = 0.0; - actual = scasum( 0, cx, 1 ); + actual = scasum( 0, x, 1 ); t.strictEqual( actual, expected, 'returns expected value' ); - cx = new Complex64Array([ + x = new Complex64Array([ 1.0, 2.0, 3.0, @@ -137,7 +137,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu ]); expected = 0.0; - actual = scasum( -1, cx, 0 ); + actual = scasum( -1, x, 0 ); t.strictEqual( actual, expected, 'returns expected value' ); t.end(); @@ -146,9 +146,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, @@ -168,7 +168,7 @@ tape( 'the function supports specifying a stride', opts, function test( t ) { ]); expected = 1.6; - actual = scasum( 4, cx, 2 ); + actual = scasum( 4, x, 2 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -176,9 +176,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, // 4 0.1, // 4 5.0, // 3 @@ -190,7 +190,7 @@ tape( 'the function supports specifying a negative stride', opts, function test( ]); expected = 28.9; - actual = scasum( 4, cx, -1 ); + actual = scasum( 4, x, -1 ); isApprox( t, actual, expected, 2.0 ); t.end(); }); @@ -198,10 +198,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 @@ -215,9 +215,9 @@ tape( 'the function supports view offsets', opts, function test( t ) { ]); expected = 33.0; - cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); + x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); - actual = scasum( 3, cx1, 1 ); + actual = scasum( 3, x1, 1 ); t.strictEqual( actual, expected, 'returns expected value' ); t.end(); }); From 939b1556f365779efef6a19a3d8c88052c7e624d Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Tue, 3 Jun 2025 15:33:57 +0530 Subject: [PATCH 2/3] 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/scasum/src/scasum_ndarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_ndarray.c b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_ndarray.c index 9fec655881ad..76c5aee954d7 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_ndarray.c @@ -29,7 +29,7 @@ * @param offsetX starting index for X */ float API_SUFFIX(c_scasum_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { - float *x = (float *)X; + const float *x = (const float *)X; float stemp; CBLAS_INT sx; CBLAS_INT ix; From beddac78bd1243b8919a1685601eef7dc260ea0b Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Tue, 3 Jun 2025 15:48:07 +0530 Subject: [PATCH 3/3] 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/scasum/src/scasum_cblas.c | 2 +- lib/node_modules/@stdlib/blas/base/scasum/src/scasum_f.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_cblas.c b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_cblas.c index de5672caf4ff..edc1e6f88567 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_cblas.c @@ -46,7 +46,7 @@ float API_SUFFIX(c_scasum)( const CBLAS_INT N, const void *X, const CBLAS_INT st * @param offsetX starting index for X */ float API_SUFFIX(c_scasum_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { - stdlib_complex64_t *x = (stdlib_complex64_t *)X; + const stdlib_complex64_t *x = (const stdlib_complex64_t *)X; CBLAS_INT sx = strideX; if( sx < 0 ) { sx = -sx; diff --git a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_f.c b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_f.c index ce3b493a9bfd..337c037686a4 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_f.c +++ b/lib/node_modules/@stdlib/blas/base/scasum/src/scasum_f.c @@ -52,7 +52,7 @@ float API_SUFFIX(c_scasum)( const CBLAS_INT N, const void *X, const CBLAS_INT st * @return result */ float API_SUFFIX(c_scasum_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { - stdlib_complex64_t *x = (stdlib_complex64_t *)X; + const stdlib_complex64_t *x = (const stdlib_complex64_t *)X; CBLAS_INT sx = strideX; float out;