From 6e5ab7d04fd6374313322453a9903240647bdcb7 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Wed, 30 Apr 2025 23:08:49 +0530 Subject: [PATCH] docs: change variable naming in blas/base/cscal --- 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/cscal/README.md | 128 +++++----- .../blas/base/cscal/benchmark/benchmark.js | 6 +- .../base/cscal/benchmark/benchmark.native.js | 6 +- .../base/cscal/benchmark/benchmark.ndarray.js | 6 +- .../benchmark/benchmark.ndarray.native.js | 6 +- .../base/cscal/benchmark/c/benchmark.length.c | 32 +-- .../benchmark/fortran/benchmark.length.f | 12 +- .../@stdlib/blas/base/cscal/docs/repl.txt | 62 ++--- .../blas/base/cscal/docs/types/index.d.ts | 56 ++-- .../blas/base/cscal/docs/types/test.ts | 240 +++++++++--------- .../blas/base/cscal/examples/c/example.c | 12 +- .../@stdlib/blas/base/cscal/examples/index.js | 16 +- .../cscal/include/stdlib/blas/base/cscal.h | 4 +- .../include/stdlib/blas/base/cscal_cblas.h | 2 +- .../@stdlib/blas/base/cscal/lib/cscal.js | 18 +- .../blas/base/cscal/lib/cscal.native.js | 20 +- .../@stdlib/blas/base/cscal/lib/index.js | 16 +- .../@stdlib/blas/base/cscal/lib/ndarray.js | 24 +- .../blas/base/cscal/lib/ndarray.native.js | 24 +- .../@stdlib/blas/base/cscal/src/addon.c | 12 +- .../@stdlib/blas/base/cscal/src/cscal.c | 10 +- .../@stdlib/blas/base/cscal/src/cscal.f | 18 +- .../@stdlib/blas/base/cscal/src/cscal_cblas.c | 26 +- .../@stdlib/blas/base/cscal/src/cscal_f.c | 26 +- .../blas/base/cscal/src/cscal_ndarray.c | 14 +- .../blas/base/cscal/test/test.cscal.js | 100 ++++---- .../blas/base/cscal/test/test.cscal.native.js | 100 ++++---- .../blas/base/cscal/test/test.ndarray.js | 124 ++++----- .../base/cscal/test/test.ndarray.native.js | 124 ++++----- 29 files changed, 622 insertions(+), 622 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cscal/README.md b/lib/node_modules/@stdlib/blas/base/cscal/README.md index b4053027d696..678b55692b2e 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/cscal/README.md @@ -30,39 +30,39 @@ limitations under the License. var cscal = require( '@stdlib/blas/base/cscal' ); ``` -#### cscal( N, ca, cx, strideX ) +#### cscal( N, alpha, x, strideX ) -Scales values from `cx` by `ca`. +Scales values from `x` by `alpha`. ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var cx = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); -var ca = new Complex64( 2.0, 0.0 ); +var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +var alpha = new Complex64( 2.0, 0.0 ); -cscal( 3, ca, cx, 1 ); -// cx => [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] +cscal( 3, alpha, x, 1 ); +// x => [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ``` The function has the following parameters: - **N**: number of indexed elements. -- **ca**: scalar [`Complex64`][@stdlib/complex/float32/ctor] constant. -- **cx**: input [`Complex64Array`][@stdlib/array/complex64]. -- **strideX**: index increment for `cx`. +- **alpha**: scalar [`Complex64`][@stdlib/complex/float32/ctor] constant. +- **x**: input [`Complex64Array`][@stdlib/array/complex64]. +- **strideX**: index increment for `x`. -The `N` and stride parameters determine how values from `cx` are scaled by `ca`. For example, to scale every other value in `cx` by `ca`, +The `N` and stride parameters determine how values from `x` are scaled by `alpha`. For example, to scale every other value in `x` by `alpha`, ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var ca = new Complex64( 2.0, 0.0 ); +var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +var alpha = new Complex64( 2.0, 0.0 ); -cscal( 2, ca, cx, 2 ); -// cx => [ 2.0, 4.0, 3.0, 4.0, 10.0, 12.0, 7.0, 8.0 ] +cscal( 2, alpha, x, 2 ); +// x => [ 2.0, 4.0, 3.0, 4.0, 10.0, 12.0, 7.0, 8.0 ] ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. @@ -74,37 +74,37 @@ var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); // Initial array: -var cx0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +var x0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); // Define a scalar constant: -var ca = new Complex64( 2.0, 2.0 ); +var alpha = new Complex64( 2.0, 2.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 -// Scales every other value from `cx1` by `ca`... -cscal( 3, ca, cx1, 1 ); -// cx0 => [ 1.0, 2.0, -2.0, 14.0, -2.0, 22.0, -2.0, 30.0 ] +// Scales every other value from `x1` by `alpha`... +cscal( 3, alpha, x1, 1 ); +// x0 => [ 1.0, 2.0, -2.0, 14.0, -2.0, 22.0, -2.0, 30.0 ] ``` -#### cscal.ndarray( N, ca, cx, strideX, offsetX ) +#### cscal.ndarray( N, alpha, x, strideX, offsetX ) -Scales values from `cx` by `ca` using alternative indexing semantics. +Scales values from `x` by `alpha` using alternative indexing semantics. ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -var ca = new Complex64( 2.0, 2.0 ); +var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +var alpha = new Complex64( 2.0, 2.0 ); -cscal.ndarray( 3, ca, cx, 1, 0 ); -// cx => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] +cscal.ndarray( 3, alpha, x, 1, 0 ); +// x => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] ``` The function has the following additional parameters: -- **offsetX**: starting index for `cx`. +- **offsetX**: starting index for `x`. While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to scale every other value in the input strided array starting from the second element, @@ -112,11 +112,11 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var ca = new Complex64( 2.0, 2.0 ); +var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +var alpha = new Complex64( 2.0, 2.0 ); -cscal.ndarray( 2, ca, cx, 2, 1 ); -// cx => [ 1.0, 2.0, -2.0, 14.0, 5.0, 6.0, -2.0, 30.0 ] +cscal.ndarray( 2, alpha, x, 2, 1 ); +// x => [ 1.0, 2.0, -2.0, 14.0, 5.0, 6.0, -2.0, 30.0 ] ``` @@ -127,7 +127,7 @@ cscal.ndarray( 2, ca, cx, 2, 1 ); ## Notes -- If `N <= 0` or `strideX <= 0`, both functions return `cx` unchanged. +- If `N <= 0` or `strideX <= 0`, both functions return `x` unchanged. - `cscal()` corresponds to the [BLAS][blas] level 1 function [`cscal`][cscal]. @@ -150,15 +150,15 @@ 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() ); -var ca = new Complex64( 2.0, 2.0 ); -console.log( ca.toString() ); +var alpha = new Complex64( 2.0, 2.0 ); +console.log( alpha.toString() ); -// Scale elements from `cx` by `ca`: -cscal( cx.length, ca, cx, 1 ); -console.log( cx.get( cx.length-1 ).toString() ); +// Scale elements from `x` by `alpha`: +cscal( x.length, alpha, x, 1 ); +console.log( x.get( x.length-1 ).toString() ); ``` @@ -191,53 +191,53 @@ console.log( cx.get( cx.length-1 ).toString() ); #include "stdlib/blas/base/cscal.h" ``` -#### c_cscal( N, ca, \*CX, strideX ) +#### c_cscal( N, alpha, \*X, strideX ) -Scales values from `CX` by `ca`. +Scales values from `X` by `alpha`. ```c #include "stdlib/complex/float32/ctor.h" -float cx[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; -const stdlib_complex64_t ca = stdlib_complex64( 2.0f, 2.0f ); +float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; +const stdlib_complex64_t alpha = stdlib_complex64( 2.0f, 2.0f ); -c_cscal( 4, ca, (void *)cx, 1 ); +c_cscal( 4, alpha, (void *)x, 1 ); ``` The function accepts the following arguments: - **N**: `[in] CBLAS_INT` number of indexed elements. -- **ca**: `[in] stdlib_complex64_t` scalar constant. -- **CX**: `[inout] void*` input array. -- **strideX**: `[in] CBLAS_INT` index increment for `CX`. +- **alpha**: `[in] stdlib_complex64_t` scalar constant. +- **X**: `[inout] void*` input array. +- **strideX**: `[in] CBLAS_INT` index increment for `X`. ```c -void c_cscal( const CBLAS_INT N, const stdlib_complex64_t ca, void *CX, const CBLAS_INT strideX ); +void c_cscal( const CBLAS_INT N, const stdlib_complex64_t alpha, void *X, const CBLAS_INT strideX ); ``` -#### c_cscal_ndarray( N, ca, \*CX, strideX, offsetX ) +#### c_cscal_ndarray( N, alpha, \*X, strideX, offsetX ) -Scales values from `CX` by `ca` using alternative indexing semantics. +Scales values from `X` by `alpha` using alternative indexing semantics. ```c #include "stdlib/complex/float32/ctor.h" -float cx[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; -const stdlib_complex64_t ca = stdlib_complex64( 2.0f, 2.0f ); +float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; +const stdlib_complex64_t alpha = stdlib_complex64( 2.0f, 2.0f ); -c_cscal( 4, ca, (void *)cx, 1, 0 ); +c_cscal( 4, alpha, (void *)x, 1, 0 ); ``` The function accepts the following arguments: - **N**: `[in] CBLAS_INT` number of indexed elements. -- **ca**: `[in] stdlib_complex64_t` scalar constant. -- **CX**: `[inout] void*` input array. -- **strideX**: `[in] CBLAS_INT` index increment for `CX`. -- **offsetX**: `[in] CBLAS_INT` starting index for `CX`. +- **alpha**: `[in] stdlib_complex64_t` scalar constant. +- **X**: `[inout] void*` input array. +- **strideX**: `[in] CBLAS_INT` index increment for `X`. +- **offsetX**: `[in] CBLAS_INT` starting index for `X`. ```c -void c_cscal_ndarray( const CBLAS_INT N, const stdlib_complex64_t ca, void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +void c_cscal_ndarray( const CBLAS_INT N, const stdlib_complex64_t alpha, void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); ``` @@ -265,10 +265,10 @@ void c_cscal_ndarray( const CBLAS_INT N, const stdlib_complex64_t ca, void *CX, int main( void ) { // Create a strided array of interleaved real and imaginary components: - float cx[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; + float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; // Create a complex scalar: - const stdlib_complex64_t ca = stdlib_complex64( 2.0f, 2.0f ); + const stdlib_complex64_t alpha = stdlib_complex64( 2.0f, 2.0f ); // Specify the number of elements: const int N = 4; @@ -277,19 +277,19 @@ int main( void ) { const int strideX = 1; // Scale the elements of the array: - c_cscal( N, ca, (void *)cx, strideX ); + c_cscal( N, alpha, (void *)x, strideX ); // Print the result: for ( int i = 0; i < N; i++ ) { - printf( "cx[ %i ] = %f + %fj\n", i, cx[ i*2 ], cx[ (i*2)+1 ] ); + printf( "x[ %i ] = %f + %fj\n", i, x[ i*2 ], x[ (i*2)+1 ] ); } // Scale the elements of the array: - c_cscal_ndarray( N, ca, (void *)cx, -strideX, 3 ); + c_cscal_ndarray( N, alpha, (void *)x, -strideX, 3 ); // Print the result: for ( int i = 0; i < N; i++ ) { - printf( "cx[ %i ] = %f + %fj\n", i, cx[ i*2 ], cx[ (i*2)+1 ] ); + printf( "x[ %i ] = %f + %fj\n", i, x[ i*2 ], x[ (i*2)+1 ] ); } } ``` diff --git a/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.js index e928a96f95d4..87384be83fc2 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.js @@ -47,14 +47,14 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { + var alpha; var xbuf; - var z; var x; xbuf = uniform( len*2, -100.0, 100.0, options ); x = new Complex64Array( xbuf.buffer ); - z = new Complex64( 1.0, 0.0 ); + alpha = new Complex64( 1.0, 0.0 ); return benchmark; @@ -69,7 +69,7 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - cscal( x.length, z, x, 1 ); + cscal( x.length, alpha, x, 1 ); if ( isnanf( xbuf[ i%(len*2) ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.native.js index 441eb1061b81..f452729c5273 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.native.js @@ -52,14 +52,14 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { + var alpha; var xbuf; - var z; var x; xbuf = uniform( len*2, -100.0, 100.0, options ); x = new Complex64Array( xbuf.buffer ); - z = new Complex64( 1.0, 0.0 ); + alpha = new Complex64( 1.0, 0.0 ); return benchmark; @@ -74,7 +74,7 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - cscal( x.length, z, x, 1 ); + cscal( x.length, alpha, x, 1 ); if ( isnanf( xbuf[ i%(len*2) ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.ndarray.js index 63985c92b31d..d8f58a4fb14f 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.ndarray.js @@ -47,14 +47,14 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { + var alpha; var xbuf; - var z; var x; xbuf = uniform( len*2, -100.0, 100.0, options ); x = new Complex64Array( xbuf.buffer ); - z = new Complex64( 1.0, 0.0 ); + alpha = new Complex64( 1.0, 0.0 ); return benchmark; @@ -69,7 +69,7 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - cscal( x.length, z, x, 1, 0 ); + cscal( x.length, alpha, x, 1, 0 ); if ( isnanf( xbuf[ i%(len*2) ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.ndarray.native.js index 1cca4e3e8e5b..ed5824151d16 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/cscal/benchmark/benchmark.ndarray.native.js @@ -52,14 +52,14 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { + var alpha; var xbuf; - var z; var x; xbuf = uniform( len*2, -100.0, 100.0, options ); x = new Complex64Array( xbuf.buffer ); - z = new Complex64( 1.0, 0.0 ); + alpha = new Complex64( 1.0, 0.0 ); return benchmark; @@ -74,7 +74,7 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - cscal( x.length, z, x, 1, 0 ); + cscal( x.length, alpha, x, 1, 0 ); if ( isnanf( xbuf[ i%(len*2) ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/cscal/benchmark/c/benchmark.length.c index edf449c6da1c..d8304dd48453 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/cscal/benchmark/c/benchmark.length.c @@ -96,27 +96,27 @@ static float rand_float( void ) { * @return elapsed time in seconds */ static double benchmark1( int iterations, int len ) { - stdlib_complex64_t ca; - float cx[ len*2 ]; + stdlib_complex64_t alpha; + float x[ len*2 ]; double elapsed; double t; int i; - ca = stdlib_complex64( 1.0f, 0.0f ); + alpha = stdlib_complex64( 1.0f, 0.0f ); for ( i = 0; i < len*2; i += 2 ) { - cx[ i ] = ( rand_float()*2.0f ) - 1.0f; - cx[ i+1 ] = ( rand_float()*2.0f ) - 1.0f; + x[ i ] = ( rand_float()*2.0f ) - 1.0f; + x[ i+1 ] = ( rand_float()*2.0f ) - 1.0f; } t = tic(); for ( i = 0; i < iterations; i++ ) { - c_cscal( len, ca, (void *)cx, 1 ); - if ( cx[ 0 ] != cx[ 0 ] ) { + c_cscal( len, alpha, (void *)x, 1 ); + if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); break; } } elapsed = tic() - t; - if ( cx[ 0 ] != cx[ 0 ] ) { + if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); } return elapsed; @@ -130,27 +130,27 @@ static double benchmark1( int iterations, int len ) { * @return elapsed time in seconds */ static double benchmark2( int iterations, int len ) { - stdlib_complex64_t ca; - float cx[ len*2 ]; + stdlib_complex64_t alpha; + float x[ len*2 ]; double elapsed; double t; int i; - ca = stdlib_complex64( 1.0f, 0.0f ); + alpha = stdlib_complex64( 1.0f, 0.0f ); for ( i = 0; i < len*2; i += 2 ) { - cx[ i ] = ( rand_float()*2.0f ) - 1.0f; - cx[ i+1 ] = ( rand_float()*2.0f ) - 1.0f; + x[ i ] = ( rand_float()*2.0f ) - 1.0f; + x[ i+1 ] = ( rand_float()*2.0f ) - 1.0f; } t = tic(); for ( i = 0; i < iterations; i++ ) { - c_cscal_ndarray( len, ca, (void *)cx, 1, 0 ); - if ( cx[ 0 ] != cx[ 0 ] ) { + c_cscal_ndarray( len, alpha, (void *)x, 1, 0 ); + if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); break; } } elapsed = tic() - t; - if ( cx[ 0 ] != cx[ 0 ] ) { + if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); } return elapsed; diff --git a/lib/node_modules/@stdlib/blas/base/cscal/benchmark/fortran/benchmark.length.f b/lib/node_modules/@stdlib/blas/base/cscal/benchmark/fortran/benchmark.length.f index 9ea329a9be0a..3a2b334d441d 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/benchmark/fortran/benchmark.length.f +++ b/lib/node_modules/@stdlib/blas/base/cscal/benchmark/fortran/benchmark.length.f @@ -124,8 +124,8 @@ double precision function benchmark( iterations, len ) ! .. ! External functions: interface - subroutine cscal( N, ca, cx, strideX ) - complex :: ca, cx(*) + subroutine cscal( N, alpha, x, strideX ) + complex :: alpha, x(*) integer :: strideX, N end subroutine cscal end interface @@ -142,7 +142,7 @@ end subroutine cscal complex, allocatable :: x(:) ! .. ! Local scalar: - complex :: ca + complex :: alpha ! .. ! Intrinsic functions: intrinsic random_number, cpu_time, cmplx @@ -152,7 +152,7 @@ end subroutine cscal ! .. call random_number( r1 ) call random_number( r2 ) - ca = cmplx( (real(r1)*5.0), (real(r2)*5.0) ) + alpha = cmplx( (real(r1)*5.0), (real(r2)*5.0) ) do i = 1, len call random_number( r1 ) call random_number( r2 ) @@ -162,7 +162,7 @@ end subroutine cscal call cpu_time( t1 ) ! .. do i = 1, iterations - call cscal( len, ca, x, 1 ); + call cscal( len, alpha, x, 1 ); if ( x( 1 ) /= x( 1 ) ) then print '(A)', 'should not return NaN' exit @@ -219,4 +219,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/cscal/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/cscal/docs/repl.txt index 9201c45262a1..4c6f03cd961c 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/cscal/docs/repl.txt @@ -1,15 +1,15 @@ -{{alias}}( N, ca, cx, strideX ) +{{alias}}( N, alpha, x, strideX ) Scales a single-precision complex floating-point vector by a single- precision complex floating-point constant. - The `N` and stride parameters determine how values from `cx` are scaled by - `ca`. + The `N` and stride parameters determine how values from `x` are scaled by + `alpha`. Indexing is relative to the first index. To introduce an offset, use typed array views. - If `N` is less than or equal to `0`, the function returns `cx` unchanged. + If `N` is less than or equal to `0`, the function returns `x` unchanged. Parameters @@ -17,45 +17,45 @@ N: integer Number of indexed elements. - ca: Complex64 + alpha: Complex64 Complex constant. - cx: Complex64Array + x: Complex64Array Input array. strideX: integer - Index increment for `cx`. + Index increment for `x`. Returns ------- - cx: Complex64Array + x: Complex64Array Input array. Examples -------- // Standard usage: - > var cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); - > var ca = new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 2.0 ); - > {{alias}}( 2, ca, cx, 1 ) + > var x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var alpha = new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 2.0 ); + > {{alias}}( 2, alpha, x, 1 ) [ -3.0, 4.0, -5.0, 10.0 ] // Advanced indexing: - > cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); - > ca = new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 1.0 ); - > {{alias}}( 2, ca, cx, 2 ) + > x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + > alpha = new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 1.0 ); + > {{alias}}( 2, alpha, x, 2 ) [ -1.0, 3.0, 3.0, 4.0, -1.0, 11.0 ] // Using typed array views: - > 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 ); - > var ca = new {{alias:@stdlib/complex/float32/ctor}}( 2.0, 2.0 ); - > {{alias}}( 2, ca, 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 ); + > var alpha = new {{alias:@stdlib/complex/float32/ctor}}( 2.0, 2.0 ); + > {{alias}}( 2, alpha, x1, 1 ) [ -2.0, 14.0, -2.0, 22.0 ] - > cx0 + > x0 [ 1.0, 2.0, -2.0, 14.0, -2.0, 22.0 ] -{{alias}}.ndarray( N, ca, cx, strideX, offsetX ) +{{alias}}.ndarray( N, alpha, x, strideX, offsetX ) Scales a single-precision complex floating-point vector by a single- precision complex floating-point constant using alternative indexing semantics. @@ -69,35 +69,35 @@ N: integer Number of indexed elements. - ca: Complex64 + alpha: Complex64 Complex constant. - cx: Complex64Array + x: Complex64Array Input array. strideX: integer - Index increment for `cx`. + Index increment for `x`. offsetX: integer - Starting index for `cx`. + Starting index for `x`. Returns ------- - cx: Complex64Array + x: Complex64Array Input array. Examples -------- // Standard usage: - > var cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); - > var ca = new {{alias:@stdlib/complex/float32/ctor}}( 2.0, 2.0 ); - > {{alias}}.ndarray( 2, ca, cx, 1, 0 ) + > var x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var alpha = new {{alias:@stdlib/complex/float32/ctor}}( 2.0, 2.0 ); + > {{alias}}.ndarray( 2, alpha, x, 1, 0 ) [ -2.0, 6.0, -2.0, 14.0 ] // Advanced indexing: - > cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - > ca = new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 2.0 ); - > {{alias}}.ndarray( 2, ca, cx, 1, 2 ) + > x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + > alpha = new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 2.0 ); + > {{alias}}.ndarray( 2, alpha, x, 1, 2 ) [ 1.0, 2.0, 3.0, 4.0, -7.0, 16.0, -9.0, 22.0 ] See Also diff --git a/lib/node_modules/@stdlib/blas/base/cscal/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/cscal/docs/types/index.d.ts index 953a4366a3e0..26916e3bf26f 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/cscal/docs/types/index.d.ts @@ -31,74 +31,74 @@ interface Routine { * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. * * @param N - number of indexed elements - * @param ca - scalar constant - * @param cx - input array - * @param strideX - `cx` stride length + * @param alpha - scalar constant + * @param x - input array + * @param strideX - `x` stride length * @returns input array * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * - * var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); - * var ca = new Complex64( 2.0, 2.0 ); + * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + * var alpha = new Complex64( 2.0, 2.0 ); * - * cscal( 3, ca, cx, 1 ); - * // cx => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] + * cscal( 3, alpha, x, 1 ); + * // x => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] */ - ( N: number, ca: Complex64, cx: Complex64Array, strideX: number ): Complex64Array; + ( N: number, alpha: Complex64, x: Complex64Array, strideX: number ): Complex64Array; /** * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. * * @param N - number of indexed elements - * @param ca - scalar constant - * @param cx - input array - * @param strideX - `cx` stride length - * @param offsetX - starting index for `cx` + * @param alpha - scalar constant + * @param x - input array + * @param strideX - `x` stride length + * @param offsetX - starting index for `x` * @returns input array * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * - * var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); - * var ca = new Complex64( 2.0, 2.0 ); + * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + * var alpha = new Complex64( 2.0, 2.0 ); * - * cscal.ndarray( 3, ca, cx, 1, 0 ); - * // cx => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] + * cscal.ndarray( 3, alpha, x, 1, 0 ); + * // x => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] */ - ndarray( N: number, ca: Complex64, cx: Complex64Array, strideX: number, offsetX: number ): Complex64Array; + ndarray( N: number, alpha: Complex64, x: Complex64Array, strideX: number, offsetX: number ): Complex64Array; } /** * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. * * @param N - number of indexed elements -* @param ca - scalar constant -* @param cx - input array -* @param strideX - `cx` stride length +* @param alpha - scalar constant +* @param x - input array +* @param strideX - `x` stride length * @returns input array * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * -* var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -* var ca = new Complex64( 2.0, 2.0 ); +* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* cscal( 3, ca, cx, 1 ); -* // cx => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] +* cscal( 3, alpha, x, 1 ); +* // x => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * -* var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -* var ca = new Complex64( 2.0, 2.0 ); +* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* cscal.ndarray( 3, ca, cx, 1, 0 ); -* // cx => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] +* cscal.ndarray( 3, alpha, x, 1, 0 ); +* // x => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] */ declare var cscal: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/cscal/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/cscal/docs/types/test.ts index 0e84c34878a5..e4542a986ab9 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/cscal/docs/types/test.ts @@ -25,178 +25,178 @@ import cscal = require( './index' ); // The function returns a Complex64Array... { - const cx = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); + const x = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); - cscal( cx.length, ca, cx, 1 ); // $ExpectType Complex64Array + cscal( x.length, alpha, x, 1 ); // $ExpectType Complex64Array } // The compiler throws an error if the function is provided a first argument which is not a number... { - const cx = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - cscal( '10', ca, cx, 1 ); // $ExpectError - cscal( true, ca, cx, 1 ); // $ExpectError - cscal( false, ca, cx, 1 ); // $ExpectError - cscal( null, ca, cx, 1 ); // $ExpectError - cscal( undefined, ca, cx, 1 ); // $ExpectError - cscal( [], ca, cx, 1 ); // $ExpectError - cscal( {}, ca, cx, 1 ); // $ExpectError - cscal( ( cx: number ): number => cx, ca, cx, 1 ); // $ExpectError + const x = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cscal( '10', alpha, x, 1 ); // $ExpectError + cscal( true, alpha, x, 1 ); // $ExpectError + cscal( false, alpha, x, 1 ); // $ExpectError + cscal( null, alpha, x, 1 ); // $ExpectError + cscal( undefined, alpha, x, 1 ); // $ExpectError + cscal( [], alpha, x, 1 ); // $ExpectError + cscal( {}, alpha, x, 1 ); // $ExpectError + cscal( ( x: number ): number => x, alpha, x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a complex number... { - const cx = new Complex64Array( 10 ); - - cscal( cx.length, 10, cx, 1 ); // $ExpectError - cscal( cx.length, '10', cx, 1 ); // $ExpectError - cscal( cx.length, true, cx, 1 ); // $ExpectError - cscal( cx.length, false, cx, 1 ); // $ExpectError - cscal( cx.length, null, cx, 1 ); // $ExpectError - cscal( cx.length, undefined, cx, 1 ); // $ExpectError - cscal( cx.length, [ '1' ], cx, 1 ); // $ExpectError - cscal( cx.length, {}, cx, 1 ); // $ExpectError - cscal( cx.length, ( cx: number ): number => cx, cx, 1 ); // $ExpectError + const x = new Complex64Array( 10 ); + + cscal( x.length, 10, x, 1 ); // $ExpectError + cscal( x.length, '10', x, 1 ); // $ExpectError + cscal( x.length, true, x, 1 ); // $ExpectError + cscal( x.length, false, x, 1 ); // $ExpectError + cscal( x.length, null, x, 1 ); // $ExpectError + cscal( x.length, undefined, x, 1 ); // $ExpectError + cscal( x.length, [ '1' ], x, 1 ); // $ExpectError + cscal( x.length, {}, x, 1 ); // $ExpectError + cscal( x.length, ( x: number ): number => x, x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a third argument which is not a Complex64Array... { - const cx = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - cscal( cx.length, ca, 10, 1 ); // $ExpectError - cscal( cx.length, ca, '10', 1 ); // $ExpectError - cscal( cx.length, ca, true, 1 ); // $ExpectError - cscal( cx.length, ca, false, 1 ); // $ExpectError - cscal( cx.length, ca, null, 1 ); // $ExpectError - cscal( cx.length, ca, undefined, 1 ); // $ExpectError - cscal( cx.length, ca, [ '1' ], 1 ); // $ExpectError - cscal( cx.length, ca, {}, 1 ); // $ExpectError - cscal( cx.length, ca, ( cx: number ): number => cx, 1 ); // $ExpectError + const x = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cscal( x.length, alpha, 10, 1 ); // $ExpectError + cscal( x.length, alpha, '10', 1 ); // $ExpectError + cscal( x.length, alpha, true, 1 ); // $ExpectError + cscal( x.length, alpha, false, 1 ); // $ExpectError + cscal( x.length, alpha, null, 1 ); // $ExpectError + cscal( x.length, alpha, undefined, 1 ); // $ExpectError + cscal( x.length, alpha, [ '1' ], 1 ); // $ExpectError + cscal( x.length, alpha, {}, 1 ); // $ExpectError + cscal( x.length, alpha, ( x: number ): number => x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a fourth argument which is not a number... { - const cx = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - cscal( cx.length, ca, cx, '10' ); // $ExpectError - cscal( cx.length, ca, cx, true ); // $ExpectError - cscal( cx.length, ca, cx, false ); // $ExpectError - cscal( cx.length, ca, cx, null ); // $ExpectError - cscal( cx.length, ca, cx, undefined ); // $ExpectError - cscal( cx.length, ca, cx, [] ); // $ExpectError - cscal( cx.length, ca, cx, {} ); // $ExpectError - cscal( cx.length, ca, cx, ( cx: number ): number => cx ); // $ExpectError + const x = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cscal( x.length, alpha, x, '10' ); // $ExpectError + cscal( x.length, alpha, x, true ); // $ExpectError + cscal( x.length, alpha, x, false ); // $ExpectError + cscal( x.length, alpha, x, null ); // $ExpectError + cscal( x.length, alpha, x, undefined ); // $ExpectError + cscal( x.length, alpha, x, [] ); // $ExpectError + cscal( x.length, alpha, x, {} ); // $ExpectError + cscal( x.length, alpha, 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 ca = new Complex64( 2.0, 2.0 ); + const x = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); cscal(); // $ExpectError - cscal( cx.length ); // $ExpectError - cscal( cx.length, ca ); // $ExpectError - cscal( cx.length, ca, cx ); // $ExpectError - cscal( cx.length, ca, cx, 1, 10 ); // $ExpectError + cscal( x.length ); // $ExpectError + cscal( x.length, alpha ); // $ExpectError + cscal( x.length, alpha, x ); // $ExpectError + cscal( x.length, alpha, x, 1, 10 ); // $ExpectError } // Attached to main export is an `ndarray` method which returns a Complex64Array... { - const cx = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); + const x = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); - cscal.ndarray( cx.length, ca, cx, 1, 0 ); // $ExpectType Complex64Array + cscal.ndarray( x.length, alpha, x, 1, 0 ); // $ExpectType Complex64Array } // The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... { - const cx = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - cscal.ndarray( '10', ca, cx, 1, 0 ); // $ExpectError - cscal.ndarray( true, ca, cx, 1, 0 ); // $ExpectError - cscal.ndarray( false, ca, cx, 1, 0 ); // $ExpectError - cscal.ndarray( null, ca, cx, 1, 0 ); // $ExpectError - cscal.ndarray( undefined, ca, cx, 1, 0 ); // $ExpectError - cscal.ndarray( [], ca, cx, 1, 0 ); // $ExpectError - cscal.ndarray( {}, ca, cx, 1, 0 ); // $ExpectError - cscal.ndarray( ( cx: number ): number => cx, ca, cx, 1, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cscal.ndarray( '10', alpha, x, 1, 0 ); // $ExpectError + cscal.ndarray( true, alpha, x, 1, 0 ); // $ExpectError + cscal.ndarray( false, alpha, x, 1, 0 ); // $ExpectError + cscal.ndarray( null, alpha, x, 1, 0 ); // $ExpectError + cscal.ndarray( undefined, alpha, x, 1, 0 ); // $ExpectError + cscal.ndarray( [], alpha, x, 1, 0 ); // $ExpectError + cscal.ndarray( {}, alpha, x, 1, 0 ); // $ExpectError + cscal.ndarray( ( x: number ): number => x, alpha, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the `ndarray` method is provided a second argument which is not a complex number... { - const cx = new Complex64Array( 10 ); - - cscal.ndarray( cx.length, 10, cx, 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, '10', cx, 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, true, cx, 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, false, cx, 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, null, cx, 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, undefined, cx, 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, [ '1' ], cx, 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, {}, cx, 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, ( cx: number ): number => cx, cx, 1, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + + cscal.ndarray( x.length, 10, x, 1, 0 ); // $ExpectError + cscal.ndarray( x.length, '10', x, 1, 0 ); // $ExpectError + cscal.ndarray( x.length, true, x, 1, 0 ); // $ExpectError + cscal.ndarray( x.length, false, x, 1, 0 ); // $ExpectError + cscal.ndarray( x.length, null, x, 1, 0 ); // $ExpectError + cscal.ndarray( x.length, undefined, x, 1, 0 ); // $ExpectError + cscal.ndarray( x.length, [ '1' ], x, 1, 0 ); // $ExpectError + cscal.ndarray( x.length, {}, x, 1, 0 ); // $ExpectError + cscal.ndarray( x.length, ( x: number ): number => x, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the `ndarray` method is provided a third argument which is not a Complex64Array... { - const cx = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - cscal.ndarray( cx.length, ca, 10, 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, '10', 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, true, 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, false, 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, null, 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, undefined, 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, [ '1' ], 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, {}, 1, 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, ( cx: number ): number => cx, 1, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cscal.ndarray( x.length, alpha, 10, 1, 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, '10', 1, 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, true, 1, 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, false, 1, 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, null, 1, 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, undefined, 1, 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, [ '1' ], 1, 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, {}, 1, 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, ( x: number ): number => x, 1, 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 ); - const ca = new Complex64( 2.0, 2.0 ); - - cscal.ndarray( cx.length, ca, cx, '10', 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, true, 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, false, 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, null, 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, undefined, 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, [], 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, {}, 0 ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, ( cx: number ): number => cx, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cscal.ndarray( x.length, alpha, x, '10', 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, x, true, 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, x, false, 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, x, null, 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, x, undefined, 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, x, [], 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, x, {}, 0 ); // $ExpectError + cscal.ndarray( x.length, alpha, x, ( x: number ): number => x, 0 ); // $ExpectError } // The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a number... { - const cx = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - cscal.ndarray( cx.length, ca, cx, 1, '10' ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, 1, true ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, 1, false ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, 1, null ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, 1, undefined ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, 1, [] ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, 1, {} ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, 1, ( cx: number ): number => cx ); // $ExpectError + const x = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cscal.ndarray( x.length, alpha, x, 1, '10' ); // $ExpectError + cscal.ndarray( x.length, alpha, x, 1, true ); // $ExpectError + cscal.ndarray( x.length, alpha, x, 1, false ); // $ExpectError + cscal.ndarray( x.length, alpha, x, 1, null ); // $ExpectError + cscal.ndarray( x.length, alpha, x, 1, undefined ); // $ExpectError + cscal.ndarray( x.length, alpha, x, 1, [] ); // $ExpectError + cscal.ndarray( x.length, alpha, x, 1, {} ); // $ExpectError + cscal.ndarray( x.length, alpha, 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 ca = new Complex64( 2.0, 2.0 ); + const x = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); cscal.ndarray(); // $ExpectError - cscal.ndarray( cx.length ); // $ExpectError - cscal.ndarray( cx.length, ca ); // $ExpectError - cscal.ndarray( cx.length, ca, cx ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, 1 ); // $ExpectError - cscal.ndarray( cx.length, ca, cx, 1, 0, 10 ); // $ExpectError + cscal.ndarray( x.length ); // $ExpectError + cscal.ndarray( x.length, alpha ); // $ExpectError + cscal.ndarray( x.length, alpha, x ); // $ExpectError + cscal.ndarray( x.length, alpha, x, 1 ); // $ExpectError + cscal.ndarray( x.length, alpha, x, 1, 0, 10 ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/cscal/examples/c/example.c index 0a2b4b7753dc..6682869ab30d 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/cscal/examples/c/example.c @@ -22,10 +22,10 @@ int main( void ) { // Create a strided array of interleaved real and imaginary components: - float cx[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; + float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }; // Create a complex scalar: - const stdlib_complex64_t ca = stdlib_complex64( 2.0f, 2.0f ); + const stdlib_complex64_t alpha = stdlib_complex64( 2.0f, 2.0f ); // Specify the number of elements: const int N = 4; @@ -34,18 +34,18 @@ int main( void ) { const int strideX = 1; // Scale the elements of the array: - c_cscal( N, ca, (void *)cx, strideX ); + c_cscal( N, alpha, (void *)x, strideX ); // Print the result: for ( int i = 0; i < N; i++ ) { - printf( "cx[ %i ] = %f + %fj\n", i, cx[ i*2 ], cx[ (i*2)+1 ] ); + printf( "x[ %i ] = %f + %fj\n", i, x[ i*2 ], x[ (i*2)+1 ] ); } // Scale the elements of the array: - c_cscal_ndarray( N, ca, (void *)cx, -strideX, 3 ); + c_cscal_ndarray( N, alpha, (void *)x, -strideX, 3 ); // Print the result: for ( int i = 0; i < N; i++ ) { - printf( "cx[ %i ] = %f + %fj\n", i, cx[ i*2 ], cx[ (i*2)+1 ] ); + printf( "x[ %i ] = %f + %fj\n", i, x[ i*2 ], x[ (i*2)+1 ] ); } } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/examples/index.js b/lib/node_modules/@stdlib/blas/base/cscal/examples/index.js index cdb9533c2d2b..9a6e2aaec7a8 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/cscal/examples/index.js @@ -21,18 +21,18 @@ var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); var filledarrayBy = require( '@stdlib/array/filled-by' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var cscal = require( '@stdlib/blas/base/cscal' ); +var cscal = require( './../lib' ); 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() ); -var ca = new Complex64( 2.0, 2.0 ); -console.log( ca.toString() ); +var alpha = new Complex64( 2.0, 2.0 ); +console.log( alpha.toString() ); -// Scale elements from `cx` by `ca`: -cscal( cx.length, ca, cx, 1 ); -console.log( cx.get( cx.length-1 ).toString() ); +// Scale elements from `x` by `alpha`: +cscal( x.length, alpha, x, 1 ); +console.log( x.get( x.length-1 ).toString() ); diff --git a/lib/node_modules/@stdlib/blas/base/cscal/include/stdlib/blas/base/cscal.h b/lib/node_modules/@stdlib/blas/base/cscal/include/stdlib/blas/base/cscal.h index 96349cdaecc6..b615faee065c 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/include/stdlib/blas/base/cscal.h +++ b/lib/node_modules/@stdlib/blas/base/cscal/include/stdlib/blas/base/cscal.h @@ -35,12 +35,12 @@ extern "C" { /** * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. */ -void API_SUFFIX(c_cscal)( const CBLAS_INT N, const stdlib_complex64_t ca, void *CX, const CBLAS_INT strideX ); +void API_SUFFIX(c_cscal)( const CBLAS_INT N, const stdlib_complex64_t alpha, void *X, const CBLAS_INT strideX ); /** * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant using alternative indexing semantics. */ -void API_SUFFIX(c_cscal_ndarray)( const CBLAS_INT N, const stdlib_complex64_t ca, void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +void API_SUFFIX(c_cscal_ndarray)( const CBLAS_INT N, const stdlib_complex64_t alpha, void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); #ifdef __cplusplus } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/include/stdlib/blas/base/cscal_cblas.h b/lib/node_modules/@stdlib/blas/base/cscal/include/stdlib/blas/base/cscal_cblas.h index b1c02bf044a7..5714d491d553 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/include/stdlib/blas/base/cscal_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/cscal/include/stdlib/blas/base/cscal_cblas.h @@ -35,7 +35,7 @@ extern "C" { /** * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. */ -void API_SUFFIX(cblas_cscal)( const CBLAS_INT N, const stdlib_complex64_t ca, void *CX, const CBLAS_INT strideX ); +void API_SUFFIX(cblas_cscal)( const CBLAS_INT N, const stdlib_complex64_t alpha, void *X, const CBLAS_INT strideX ); #ifdef __cplusplus } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/lib/cscal.js b/lib/node_modules/@stdlib/blas/base/cscal/lib/cscal.js index 423cf95aec01..481abd0f53b4 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/lib/cscal.js +++ b/lib/node_modules/@stdlib/blas/base/cscal/lib/cscal.js @@ -30,24 +30,24 @@ var ndarray = require( './ndarray.js' ); * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. * * @param {PositiveInteger} N - number of indexed elements -* @param {Complex64} ca - constant -* @param {Complex64Array} cx - input array -* @param {integer} strideX - `cx` stride length +* @param {Complex64} alpha - constant +* @param {Complex64Array} x - input array +* @param {integer} strideX - `x` stride length * @returns {Complex64Array} input array * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * -* var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -* var ca = new Complex64( 2.0, 2.0 ); +* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* cscal( 3, ca, cx, 1 ); -* // cx => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] +* cscal( 3, alpha, x, 1 ); +* // x => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] */ -function cscal( N, ca, cx, strideX ) { +function cscal( N, alpha, x, strideX ) { var ox = stride2offset( N, strideX ); - return ndarray( N, ca, cx, strideX, ox ); + return ndarray( N, alpha, x, strideX, ox ); } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/lib/cscal.native.js b/lib/node_modules/@stdlib/blas/base/cscal/lib/cscal.native.js index f635cd9b98fc..4b77fae30bfc 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/lib/cscal.native.js +++ b/lib/node_modules/@stdlib/blas/base/cscal/lib/cscal.native.js @@ -30,8 +30,8 @@ var addon = require( './../src/addon.node' ); * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. * * @param {PositiveInteger} N - number of indexed elements -* @param {Complex64} ca - scalar constant -* @param {Complex64Array} cx - input array +* @param {Complex64} alpha - scalar constant +* @param {Complex64Array} x - input array * @param {integer} strideX - `x` stride length * @returns {Complex64Array} input array * @@ -39,16 +39,16 @@ var addon = require( './../src/addon.node' ); * var Complex64Array = require( '@stdlib/array/complex64' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * -* var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -* var ca = new Complex64( 2.0, 2.0 ); +* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* cscal( cx.length, ca, cx, 1 ); -* // cx => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] +* cscal( x.length, alpha, x, 1 ); +* // x => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] */ -function cscal( N, ca, cx, strideX ) { - var viewCX = reinterpret( cx, 0 ); - addon( N, ca, viewCX, strideX ); - return cx; +function cscal( N, alpha, x, strideX ) { + var viewCX = reinterpret( x, 0 ); + addon( N, alpha, viewCX, strideX ); + return x; } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/lib/index.js b/lib/node_modules/@stdlib/blas/base/cscal/lib/index.js index 693de614b983..a5e9a447307e 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/cscal/lib/index.js @@ -28,22 +28,22 @@ * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * var cscal = require( '@stdlib/blas/base/cscal' ); * -* var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -* var ca = new Complex64( 2.0, 2.0 ); +* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* cscal( 3, ca, cx, 1 ); -* // cx => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] +* cscal( 3, alpha, x, 1 ); +* // x => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * var cscal = require( '@stdlib/blas/base/cscal' ); * -* var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -* var ca = new Complex64( 2.0, 2.0 ); +* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* cscal.ndarray( 3, ca cx, 1, 0 ); -* // cx => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] +* cscal.ndarray( 3, alpha x, 1, 0 ); +* // x => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] */ // MODULES // diff --git a/lib/node_modules/@stdlib/blas/base/cscal/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/cscal/lib/ndarray.js index 67d642f1b483..d0c9f2d4465e 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/cscal/lib/ndarray.js @@ -29,35 +29,35 @@ var cmulf = require( '@stdlib/complex/float32/base/mul' ); * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. * * @param {PositiveInteger} N - number of indexed elements -* @param {Complex64} ca - constant -* @param {Complex64Array} cx - input array -* @param {integer} strideX - `cx` stride length -* @param {NonNegativeInteger} offsetX - starting `cx` index +* @param {Complex64} alpha - constant +* @param {Complex64Array} x - input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index * @returns {Complex64Array} input array * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * -* var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -* var ca = new Complex64( 2.0, 2.0 ); +* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* cscal( 3, ca, cx, 1, 0 ); -* // cx => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] +* cscal( 3, alpha, x, 1, 0 ); +* // x => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] */ -function cscal( N, ca, cx, strideX, offsetX ) { +function cscal( N, alpha, x, strideX, offsetX ) { var ix; var i; if ( N <= 0 ) { - return cx; + return x; } ix = offsetX; for ( i = 0; i < N; i++ ) { - cx.set( cmulf( ca, cx.get( ix ) ), ix ); + x.set( cmulf( alpha, x.get( ix ) ), ix ); ix += strideX; } - return cx; + return x; } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/cscal/lib/ndarray.native.js index effbc7bedb8a..27ed557819c1 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/cscal/lib/ndarray.native.js @@ -30,26 +30,26 @@ var addon = require( './../src/addon.node' ); * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. * * @param {PositiveInteger} N - number of indexed elements -* @param {Complex64} ca - scalar constant -* @param {Complex64Array} cx - input array -* @param {integer} strideX - `cx` stride length -* @param {NonNegativeInteger} offsetX - starting `cx` index +* @param {Complex64} alpha - scalar constant +* @param {Complex64Array} x - input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index * @returns {Complex64Array} input array * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * -* var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -* var ca = new Complex64( 2.0, 2.0 ); +* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* cscal( cx.length, ca, cx, 1, 0 ); -* // cx => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] +* cscal( x.length, alpha, x, 1, 0 ); +* // x => [ -2.0, 6.0, -2.0, 14.0, -2.0, 22.0 ] */ -function cscal( N, ca, cx, strideX, offsetX ) { - var viewCX = reinterpret( cx, 0 ); - addon.ndarray( N, ca, viewCX, strideX, offsetX ); - return cx; +function cscal( N, alpha, x, strideX, offsetX ) { + var viewCX = reinterpret( x, 0 ); + addon.ndarray( N, alpha, viewCX, strideX, offsetX ); + return x; } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/src/addon.c b/lib/node_modules/@stdlib/blas/base/cscal/src/addon.c index 0ad96dee423e..a7e387dbc432 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/src/addon.c +++ b/lib/node_modules/@stdlib/blas/base/cscal/src/addon.c @@ -36,9 +36,9 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV( env, info, argv, argc, 4 ); STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 ); - STDLIB_NAPI_ARGV_COMPLEX64( env, ca, argv, 1 ); - STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, CX, N, strideX, argv, 2 ); - API_SUFFIX(c_cscal)( N, ca, (void *)CX, strideX ); + STDLIB_NAPI_ARGV_COMPLEX64( env, alpha, argv, 1 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 2 ); + API_SUFFIX(c_cscal)( N, alpha, (void *)X, strideX ); return NULL; } @@ -54,9 +54,9 @@ 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, 3 ); STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 4 ); - STDLIB_NAPI_ARGV_COMPLEX64( env, ca, argv, 1 ); - STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, CX, N, strideX, argv, 2 ); - API_SUFFIX(c_cscal_ndarray)( N, ca, (void *)CX, strideX, offsetX ); + STDLIB_NAPI_ARGV_COMPLEX64( env, alpha, argv, 1 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 2 ); + API_SUFFIX(c_cscal_ndarray)( N, alpha, (void *)X, strideX, offsetX ); return NULL; } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/src/cscal.c b/lib/node_modules/@stdlib/blas/base/cscal/src/cscal.c index cf7f7d7f9a04..b6c2a2f5eaea 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/src/cscal.c +++ b/lib/node_modules/@stdlib/blas/base/cscal/src/cscal.c @@ -26,11 +26,11 @@ * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. * * @param N number of indexed elements -* @param ca scalar constant -* @param CX input array -* @param strideX CX stride length +* @param alpha scalar constant +* @param X input array +* @param strideX X stride length */ -void API_SUFFIX(c_cscal)( const CBLAS_INT N, const stdlib_complex64_t ca, void *CX, const CBLAS_INT strideX ) { +void API_SUFFIX(c_cscal)( const CBLAS_INT N, const stdlib_complex64_t alpha, void *X, const CBLAS_INT strideX ) { CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); - API_SUFFIX(c_cscal_ndarray)( N, ca, CX, strideX, ox ); + API_SUFFIX(c_cscal_ndarray)( N, alpha, X, strideX, ox ); } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/src/cscal.f b/lib/node_modules/@stdlib/blas/base/cscal/src/cscal.f index e54c86ce083e..4e1e3b7206b8 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/src/cscal.f +++ b/lib/node_modules/@stdlib/blas/base/cscal/src/cscal.f @@ -49,19 +49,19 @@ ! > * 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 {complex} ca - scalar constant -! @param {Array} cx - input array -! @param {integer} strideX - `cx` stride length +! @param {complex} alpha - scalar constant +! @param {Array} x - input array +! @param {integer} strideX - `x` stride length !< -subroutine cscal( N, ca, cx, strideX ) +subroutine cscal( N, alpha, x, strideX ) implicit none ! .. ! Scalar arguments: - complex :: ca + complex :: alpha integer :: strideX, N ! .. ! Array arguments: - complex :: cx(*) + complex :: x(*) ! .. ! Local scalars: integer :: ix, i @@ -72,14 +72,14 @@ subroutine cscal( N, ca, cx, strideX ) ! .. if ( strideX == 1 ) then do i = 1, N - cx(i) = ca * cx(i) + x(i) = alpha * x(i) end do else ix = 1 do i = 1, N - cx(ix) = ca * cx(ix) + x(ix) = alpha * x(ix) ix = ix + strideX end do end if return -end subroutine cscal \ No newline at end of file +end subroutine cscal diff --git a/lib/node_modules/@stdlib/blas/base/cscal/src/cscal_cblas.c b/lib/node_modules/@stdlib/blas/base/cscal/src/cscal_cblas.c index eb88db06065c..559bbb1efa51 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/src/cscal_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/cscal/src/cscal_cblas.c @@ -25,34 +25,34 @@ * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. * * @param N number of indexed elements -* @param ca scalar constant -* @param CX input array -* @param strideX CX stride length +* @param alpha scalar constant +* @param X input array +* @param strideX X stride length */ -void API_SUFFIX(c_cscal)( const CBLAS_INT N, const stdlib_complex64_t ca, void *CX, const CBLAS_INT strideX ) { +void API_SUFFIX(c_cscal)( const CBLAS_INT N, const stdlib_complex64_t alpha, void *X, const CBLAS_INT strideX ) { CBLAS_INT sx = strideX; if ( sx < 0 ) { sx = -sx; } - API_SUFFIX(cblas_cscal)( N, ca, CX, sx ); + API_SUFFIX(cblas_cscal)( N, alpha, X, sx ); } /** * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant using alternative indexing semantics. * * @param N number of indexed elements -* @param ca scalar constant -* @param CX input array -* @param strideX CX stride length -* @param offsetX starting index for CX +* @param alpha scalar constant +* @param X input array +* @param strideX X stride length +* @param offsetX starting index for X */ -void API_SUFFIX(c_cscal_ndarray)( const CBLAS_INT N, const stdlib_complex64_t ca, void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { - stdlib_complex64_t *cx = (stdlib_complex64_t *)CX; +void API_SUFFIX(c_cscal_ndarray)( const CBLAS_INT N, const stdlib_complex64_t alpha, void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + stdlib_complex64_t *x = (stdlib_complex64_t *)X; CBLAS_INT sx = strideX; - 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; } - API_SUFFIX(cblas_cscal)( N, ca, (void *)cx, sx ); + API_SUFFIX(cblas_cscal)( N, alpha, (void *)x, sx ); } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/src/cscal_f.c b/lib/node_modules/@stdlib/blas/base/cscal/src/cscal_f.c index 73aaaf0f1d5e..127a2cc56657 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/src/cscal_f.c +++ b/lib/node_modules/@stdlib/blas/base/cscal/src/cscal_f.c @@ -26,34 +26,34 @@ * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. * * @param N number of indexed elements -* @param ca scalar constant -* @param CX input array -* @param strideX CX stride length +* @param alpha scalar constant +* @param X input array +* @param strideX X stride length */ -void API_SUFFIX(c_cscal)( const CBLAS_INT N, const stdlib_complex64_t ca, void *CX, const CBLAS_INT strideX ) { +void API_SUFFIX(c_cscal)( const CBLAS_INT N, const stdlib_complex64_t alpha, void *X, const CBLAS_INT strideX ) { CBLAS_INT sx = strideX; if ( sx < 0 ) { sx = -sx; } - cscal( &N, &ca, CX, &sx ); + cscal( &N, &alpha, X, &sx ); } /** * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant using alternative indexing semantics. * * @param N number of indexed elements -* @param ca scalar constant -* @param CX input array -* @param strideX CX stride length -* @param offsetX starting index for CX +* @param alpha scalar constant +* @param X input array +* @param strideX X stride length +* @param offsetX starting index for X */ -void API_SUFFIX(c_cscal_ndarray)( const CBLAS_INT N, const stdlib_complex64_t ca, void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { - stdlib_complex64_t *cx = (stdlib_complex64_t *)CX; +void API_SUFFIX(c_cscal_ndarray)( const CBLAS_INT N, const stdlib_complex64_t alpha, void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + stdlib_complex64_t *x = (stdlib_complex64_t *)X; CBLAS_INT sx = strideX; - 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; } - cscal( &N, &ca, (void *)cx, &sx ); + cscal( &N, &alpha, (void *)x, &sx ); } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/src/cscal_ndarray.c b/lib/node_modules/@stdlib/blas/base/cscal/src/cscal_ndarray.c index 5ac3d7b15df5..9d44fa303c09 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/src/cscal_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cscal/src/cscal_ndarray.c @@ -26,12 +26,12 @@ * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. * * @param N number of indexed elements -* @param ca scalar constant -* @param CX input array -* @param strideX CX stride length -* @param offsetX starting index for CX +* @param alpha scalar constant +* @param X input array +* @param strideX X stride length +* @param offsetX starting index for X */ -void API_SUFFIX(c_cscal_ndarray)( const CBLAS_INT N, const stdlib_complex64_t ca, void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { +void API_SUFFIX(c_cscal_ndarray)( const CBLAS_INT N, const stdlib_complex64_t alpha, void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { stdlib_complex64_t z; int64_t is1; int64_t i; @@ -39,12 +39,12 @@ void API_SUFFIX(c_cscal_ndarray)( const CBLAS_INT N, const stdlib_complex64_t ca if ( N <= 0 ) { return; } - stdlib_complex64_t *ip1 = (stdlib_complex64_t *)CX; + stdlib_complex64_t *ip1 = (stdlib_complex64_t *)X; is1 = (int64_t)strideX; ip1 += offsetX; for ( i = 0; i < N; i++, ip1 += is1 ) { z = *ip1; - *ip1 = stdlib_base_complex64_mul( ca, z ); + *ip1 = stdlib_base_complex64_mul( alpha, z ); } return; } diff --git a/lib/node_modules/@stdlib/blas/base/cscal/test/test.cscal.js b/lib/node_modules/@stdlib/blas/base/cscal/test/test.cscal.js index 624ab95acbe2..a34ee6a73e4f 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/test/test.cscal.js +++ b/lib/node_modules/@stdlib/blas/base/cscal/test/test.cscal.js @@ -42,16 +42,16 @@ tape( 'the function has an arity of 4', function test( t ) { t.end(); }); -tape( 'the function scales elements from `cx` by `ca`', function test( t ) { +tape( 'the function scales elements from `x` by `alpha`', function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 0.5, // 2 @@ -60,13 +60,13 @@ tape( 'the function scales elements from `cx` by `ca`', function test( t ) { 0.5, // 3 0.0, // 4 0.2 // 4 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 4, ca, cx, 1 ); + cscal( 4, alpha, x, 1 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.19, // 1 -0.17, // 1 0.2, // 2 @@ -75,7 +75,7 @@ tape( 'the function scales elements from `cx` by `ca`', function test( t ) { 0.2, // 3 0.14, // 4 0.08 // 4 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); @@ -88,16 +88,16 @@ tape( 'the function scales elements from `cx` by `ca`', function test( t ) { t.end(); }); -tape( 'the function supports specifying a `cx` stride', function test( t ) { +tape( 'the function supports specifying a `x` stride', function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.1, // 1 0.1, // 1 3.0, @@ -110,13 +110,13 @@ tape( 'the function supports specifying a `cx` stride', function test( t ) { -0.3, // 3 7.0, 2.0 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 3, ca, cx, 2 ); + cscal( 3, alpha, x, 2 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.11, // 1 -0.03, // 1 3.0, @@ -129,7 +129,7 @@ tape( 'the function supports specifying a `cx` stride', function test( t ) { -0.19, // 3 7.0, 2.0 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); @@ -142,16 +142,16 @@ tape( 'the function supports specifying a `cx` stride', function test( t ) { t.end(); }); -tape( 'the function supports specifying a negative `cx` stride', function test( t ) { +tape( 'the function supports specifying a negative `x` stride', function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.1, // 3 0.1, // 3 3.0, @@ -164,13 +164,13 @@ tape( 'the function supports specifying a negative `cx` stride', function test( -0.3, // 1 7.0, 2.0 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 3, ca, cx, -2 ); + cscal( 3, alpha, x, -2 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.11, // 3 -0.03, // 3 3.0, @@ -183,7 +183,7 @@ tape( 'the function supports specifying a negative `cx` stride', function test( -0.19, // 1 7.0, 2.0 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); @@ -197,35 +197,35 @@ tape( 'the function supports specifying a negative `cx` stride', function test( }); tape( 'the function returns a reference to the input array', function test( t ) { + var alpha; var out; - var ca; - var cx; + var x; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - ca = new Complex64( 2.0, 2.0 ); + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - out = cscal( 4, ca, cx, 1 ); + out = cscal( 4, alpha, x, 1 ); - t.strictEqual( out, cx, 'same reference' ); + t.strictEqual( out, x, 'same reference' ); t.end(); }); tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { var expected; var viewX; - var ca; - var cx; + var alpha; + var x; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - ca = new Complex64( 2.0, 2.0 ); + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - viewX = new Float32Array( cx.buffer ); + viewX = new Float32Array( x.buffer ); expected = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cscal( -1, ca, cx, 1 ); + cscal( -1, alpha, x, 1 ); t.deepEqual( viewX, expected, 'returns expected value' ); - cscal( 0, ca, cx, 1 ); + cscal( 0, alpha, x, 1 ); t.deepEqual( viewX, expected, 'returns expected value' ); t.end(); @@ -235,14 +235,14 @@ tape( 'the function supports view offsets', function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; var cx0; var cx1; - var ca; var k; // Initial arrays... - cx0 = new Complex64Array( [ + cx0 = new Complex64Array([ 0.1, -0.3, 8.0, // 1 @@ -253,16 +253,16 @@ tape( 'the function supports view offsets', function test( t ) { 5.0, // 3 2.0, 3.0 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); // Create offset views... cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // begin at 2nd element - cscal( 3, ca, cx1, 1 ); + cscal( 3, alpha, cx1, 1 ); viewX = new Float32Array( cx0.buffer ); - expected = new Float32Array( [ + expected = new Float32Array([ 0.1, -0.3, 9.5, // 1 @@ -273,7 +273,7 @@ tape( 'the function supports view offsets', function test( t ) { 0.6, // 3 2.0, 3.0 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); diff --git a/lib/node_modules/@stdlib/blas/base/cscal/test/test.cscal.native.js b/lib/node_modules/@stdlib/blas/base/cscal/test/test.cscal.native.js index c69e6f27f76f..8d8d12cf8fda 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/test/test.cscal.native.js +++ b/lib/node_modules/@stdlib/blas/base/cscal/test/test.cscal.native.js @@ -51,16 +51,16 @@ tape( 'the function has an arity of 4', opts, function test( t ) { t.end(); }); -tape( 'the function scales elements from `cx` by `ca`', opts, function test( t ) { +tape( 'the function scales elements from `x` by `alpha`', opts, function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 0.5, // 2 @@ -69,13 +69,13 @@ tape( 'the function scales elements from `cx` by `ca`', opts, function test( t ) 0.5, // 3 0.0, // 4 0.2 // 4 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 4, ca, cx, 1 ); + cscal( 4, alpha, x, 1 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.19, // 1 -0.17, // 1 0.2, // 2 @@ -84,7 +84,7 @@ tape( 'the function scales elements from `cx` by `ca`', opts, function test( t ) 0.2, // 3 0.14, // 4 0.08 // 4 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); @@ -97,16 +97,16 @@ tape( 'the function scales elements from `cx` by `ca`', opts, function test( t ) t.end(); }); -tape( 'the function supports specifying a `cx` stride', opts, function test( t ) { +tape( 'the function supports specifying a `x` stride', opts, function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.1, // 1 0.1, // 1 3.0, @@ -119,13 +119,13 @@ tape( 'the function supports specifying a `cx` stride', opts, function test( t ) -0.3, // 3 7.0, 2.0 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 3, ca, cx, 2 ); + cscal( 3, alpha, x, 2 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.11, // 1 -0.03, // 1 3.0, @@ -138,7 +138,7 @@ tape( 'the function supports specifying a `cx` stride', opts, function test( t ) -0.19, // 3 7.0, 2.0 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); @@ -151,16 +151,16 @@ tape( 'the function supports specifying a `cx` stride', opts, function test( t ) t.end(); }); -tape( 'the function supports specifying a negative `cx` stride', opts, function test( t ) { +tape( 'the function supports specifying a negative `x` stride', opts, function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.1, // 3 0.1, // 3 3.0, @@ -173,13 +173,13 @@ tape( 'the function supports specifying a negative `cx` stride', opts, function -0.3, // 1 7.0, 2.0 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 3, ca, cx, -2 ); + cscal( 3, alpha, x, -2 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.11, // 3 -0.03, // 3 3.0, @@ -192,7 +192,7 @@ tape( 'the function supports specifying a negative `cx` stride', opts, function -0.19, // 1 7.0, 2.0 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); @@ -206,35 +206,35 @@ tape( 'the function supports specifying a negative `cx` stride', opts, function }); tape( 'the function returns a reference to the input array', opts, function test( t ) { + var alpha; var out; - var ca; - var cx; + var x; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - ca = new Complex64( 2.0, 2.0 ); + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - out = cscal( 4, ca, cx, 1 ); + out = cscal( 4, alpha, x, 1 ); - t.strictEqual( out, cx, 'same reference' ); + t.strictEqual( out, x, 'same reference' ); t.end(); }); tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', opts, function test( t ) { var expected; var viewX; - var ca; - var cx; + var alpha; + var x; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - ca = new Complex64( 2.0, 2.0 ); + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - viewX = new Float32Array( cx.buffer ); + viewX = new Float32Array( x.buffer ); expected = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cscal( -1, ca, cx, 1 ); + cscal( -1, alpha, x, 1 ); t.deepEqual( viewX, expected, 'returns expected value' ); - cscal( 0, ca, cx, 1 ); + cscal( 0, alpha, x, 1 ); t.deepEqual( viewX, expected, 'returns expected value' ); t.end(); @@ -244,14 +244,14 @@ tape( 'the function supports view offsets', opts, function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; var cx0; var cx1; - var ca; var k; // Initial arrays... - cx0 = new Complex64Array( [ + cx0 = new Complex64Array([ 0.1, -0.3, 8.0, // 1 @@ -262,16 +262,16 @@ tape( 'the function supports view offsets', opts, function test( t ) { 5.0, // 3 2.0, 3.0 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); // Create offset views... cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // begin at 2nd element - cscal( 3, ca, cx1, 1 ); + cscal( 3, alpha, cx1, 1 ); viewX = new Float32Array( cx0.buffer ); - expected = new Float32Array( [ + expected = new Float32Array([ 0.1, -0.3, 9.5, // 1 @@ -282,7 +282,7 @@ tape( 'the function supports view offsets', opts, function test( t ) { 0.6, // 3 2.0, 3.0 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); diff --git a/lib/node_modules/@stdlib/blas/base/cscal/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/cscal/test/test.ndarray.js index 3da9c624be3f..2efd7a94c0a2 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/cscal/test/test.ndarray.js @@ -42,16 +42,16 @@ tape( 'the function has an arity of 5', function test( t ) { t.end(); }); -tape( 'the function scales elements from `cx` by `ca`', function test( t ) { +tape( 'the function scales elements from `x` by `alpha`', function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 0.5, // 2 @@ -64,13 +64,13 @@ tape( 'the function scales elements from `cx` by `ca`', function test( t ) { 3.0, 2.0, 3.0 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 4, ca, cx, 1, 0 ); + cscal( 4, alpha, x, 1, 0 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.19, // 1 -0.17, // 1 0.2, // 2 @@ -83,7 +83,7 @@ tape( 'the function scales elements from `cx` by `ca`', function test( t ) { 3.0, 2.0, 3.0 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); @@ -96,16 +96,16 @@ tape( 'the function scales elements from `cx` by `ca`', function test( t ) { t.end(); }); -tape( 'the function supports specifying a `cx` stride', function test( t ) { +tape( 'the function supports specifying a `x` stride', function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.1, // 1 0.1, // 1 3.0, @@ -118,13 +118,13 @@ tape( 'the function supports specifying a `cx` stride', function test( t ) { -0.3, // 3 7.0, 2.0 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 3, ca, cx, 2, 0 ); + cscal( 3, alpha, x, 2, 0 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.11, // 1 -0.03, // 1 3.0, @@ -137,7 +137,7 @@ tape( 'the function supports specifying a `cx` stride', function test( t ) { -0.19, // 3 7.0, 2.0 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); @@ -150,16 +150,16 @@ tape( 'the function supports specifying a `cx` stride', function test( t ) { t.end(); }); -tape( 'the function supports specifying a negative `cx` stride', function test( t ) { +tape( 'the function supports specifying a negative `x` stride', function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.1, // 3 0.1, // 3 3.0, @@ -172,13 +172,13 @@ tape( 'the function supports specifying a negative `cx` stride', function test( -0.3, // 1 7.0, 2.0 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 3, ca, cx, -2, 4 ); + cscal( 3, alpha, x, -2, 4 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.11, // 3 -0.03, // 3 3.0, @@ -191,7 +191,7 @@ tape( 'the function supports specifying a negative `cx` stride', function test( -0.19, // 1 7.0, 2.0 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); @@ -204,16 +204,16 @@ tape( 'the function supports specifying a negative `cx` stride', function test( t.end(); }); -tape( 'the function supports a `cx` offset', function test( t ) { +tape( 'the function supports a `x` offset', function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.1, 0.1, 3.0, @@ -226,13 +226,13 @@ tape( 'the function supports a `cx` offset', function test( t ) { -0.3, // 2 7.0, // 3 2.0 // 3 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 3, ca, cx, 1, 3 ); + cscal( 3, alpha, x, 1, 3 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.1, 0.1, 3.0, @@ -245,7 +245,7 @@ tape( 'the function supports a `cx` offset', function test( t ) { -0.19, // 2 4.2, // 3 -4.1 // 3 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); @@ -259,35 +259,35 @@ tape( 'the function supports a `cx` offset', function test( t ) { }); tape( 'the function returns a reference to the input array', function test( t ) { + var alpha; var out; - var ca; - var cx; + var x; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - ca = new Complex64( 2.0, 2.0 ); + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - out = cscal( 4, ca, cx, 1, 0 ); + out = cscal( 4, alpha, x, 1, 0 ); - t.strictEqual( out, cx, 'same reference' ); + t.strictEqual( out, x, 'same reference' ); t.end(); }); tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', function test( t ) { var expected; var viewX; - var ca; - var cx; + var alpha; + var x; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - ca = new Complex64( 2.0, 2.0 ); + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - viewX = new Float32Array( cx.buffer ); + viewX = new Float32Array( x.buffer ); expected = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cscal( -1, ca, cx, 1, 0 ); + cscal( -1, alpha, x, 1, 0 ); t.deepEqual( viewX, expected, 'returns expected value' ); - cscal( 0, ca, cx, 1, 0 ); + cscal( 0, alpha, x, 1, 0 ); t.deepEqual( viewX, expected, 'returns expected value' ); t.end(); @@ -297,12 +297,12 @@ tape( 'the function supports complex access patterns', function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.1, 0.1, 3.0, @@ -317,13 +317,13 @@ tape( 'the function supports complex access patterns', function test( t ) { 2.0, 2.0, // 2 3.0 // 2 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 2, ca, cx, 3, 3 ); + cscal( 2, alpha, x, 3, 3 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.1, 0.1, 3.0, @@ -338,7 +338,7 @@ tape( 'the function supports complex access patterns', function test( t ) { 2.0, 2.9, // 2 -0.2 // 2 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); diff --git a/lib/node_modules/@stdlib/blas/base/cscal/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/cscal/test/test.ndarray.native.js index b6b77b5795ce..3499b30cf552 100644 --- a/lib/node_modules/@stdlib/blas/base/cscal/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/cscal/test/test.ndarray.native.js @@ -51,16 +51,16 @@ tape( 'the function has an arity of 5', opts, function test( t ) { t.end(); }); -tape( 'the function scales elements from `cx` by `ca`', opts, function test( t ) { +tape( 'the function scales elements from `x` by `alpha`', opts, function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.3, // 1 0.1, // 1 0.5, // 2 @@ -73,13 +73,13 @@ tape( 'the function scales elements from `cx` by `ca`', opts, function test( t ) 3.0, 2.0, 3.0 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 4, ca, cx, 1, 0 ); + cscal( 4, alpha, x, 1, 0 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.19, // 1 -0.17, // 1 0.2, // 2 @@ -92,7 +92,7 @@ tape( 'the function scales elements from `cx` by `ca`', opts, function test( t ) 3.0, 2.0, 3.0 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); @@ -105,16 +105,16 @@ tape( 'the function scales elements from `cx` by `ca`', opts, function test( t ) t.end(); }); -tape( 'the function supports specifying a `cx` stride', opts, function test( t ) { +tape( 'the function supports specifying a `x` stride', opts, function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.1, // 1 0.1, // 1 3.0, @@ -127,13 +127,13 @@ tape( 'the function supports specifying a `cx` stride', opts, function test( t ) -0.3, // 3 7.0, 2.0 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 3, ca, cx, 2, 0 ); + cscal( 3, alpha, x, 2, 0 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.11, // 1 -0.03, // 1 3.0, @@ -146,7 +146,7 @@ tape( 'the function supports specifying a `cx` stride', opts, function test( t ) -0.19, // 3 7.0, 2.0 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); @@ -159,16 +159,16 @@ tape( 'the function supports specifying a `cx` stride', opts, function test( t ) t.end(); }); -tape( 'the function supports specifying a negative `cx` stride', opts, function test( t ) { +tape( 'the function supports specifying a negative `x` stride', opts, function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.1, // 3 0.1, // 3 3.0, @@ -181,13 +181,13 @@ tape( 'the function supports specifying a negative `cx` stride', opts, function -0.3, // 1 7.0, 2.0 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 3, ca, cx, -2, 4 ); + cscal( 3, alpha, x, -2, 4 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.11, // 3 -0.03, // 3 3.0, @@ -200,7 +200,7 @@ tape( 'the function supports specifying a negative `cx` stride', opts, function -0.19, // 1 7.0, 2.0 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); @@ -213,16 +213,16 @@ tape( 'the function supports specifying a negative `cx` stride', opts, function t.end(); }); -tape( 'the function supports a `cx` offset', opts, function test( t ) { +tape( 'the function supports a `x` offset', opts, function test( t ) { var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.1, 0.1, 3.0, @@ -235,13 +235,13 @@ tape( 'the function supports a `cx` offset', opts, function test( t ) { -0.3, // 2 7.0, // 3 2.0 // 3 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 3, ca, cx, 1, 3 ); + cscal( 3, alpha, x, 1, 3 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.1, 0.1, 3.0, @@ -254,7 +254,7 @@ tape( 'the function supports a `cx` offset', opts, function test( t ) { -0.19, // 2 4.2, // 3 -4.1 // 3 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' ); @@ -268,35 +268,35 @@ tape( 'the function supports a `cx` offset', opts, function test( t ) { }); tape( 'the function returns a reference to the input array', opts, function test( t ) { + var alpha; var out; - var ca; - var cx; + var x; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - ca = new Complex64( 2.0, 2.0 ); + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - out = cscal( 4, ca, cx, 1, 0 ); + out = cscal( 4, alpha, x, 1, 0 ); - t.strictEqual( out, cx, 'same reference' ); + t.strictEqual( out, x, 'same reference' ); t.end(); }); tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the input array unchanged', opts, function test( t ) { var expected; var viewX; - var ca; - var cx; + var alpha; + var x; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - ca = new Complex64( 2.0, 2.0 ); + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - viewX = new Float32Array( cx.buffer ); + viewX = new Float32Array( x.buffer ); expected = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cscal( -1, ca, cx, 1, 0 ); + cscal( -1, alpha, x, 1, 0 ); t.deepEqual( viewX, expected, 'returns expected value' ); - cscal( 0, ca, cx, 1, 0 ); + cscal( 0, alpha, x, 1, 0 ); t.deepEqual( viewX, expected, 'returns expected value' ); t.end(); @@ -306,12 +306,12 @@ tape( 'the function supports complex access patterns', opts, function test( t ) var expected; var delta; var viewX; + var alpha; var tol; - var ca; - var cx; + var x; var k; - cx = new Complex64Array( [ + x = new Complex64Array([ 0.1, 0.1, 3.0, @@ -326,13 +326,13 @@ tape( 'the function supports complex access patterns', opts, function test( t ) 2.0, 2.0, // 2 3.0 // 2 - ] ); - ca = new Complex64( 0.4, -0.7 ); + ]); + alpha = new Complex64( 0.4, -0.7 ); - cscal( 2, ca, cx, 3, 3 ); + cscal( 2, alpha, x, 3, 3 ); - viewX = new Float32Array( cx.buffer ); - expected = new Float32Array( [ + viewX = new Float32Array( x.buffer ); + expected = new Float32Array([ 0.1, 0.1, 3.0, @@ -347,7 +347,7 @@ tape( 'the function supports complex access patterns', opts, function test( t ) 2.0, 2.9, // 2 -0.2 // 2 - ] ); + ]); for ( k = 0; k < expected.length; k++ ) { if ( viewX[ k ] === expected[ k ] ) { t.strictEqual( viewX[ k ], expected[ k ], 'returns expected value' );