diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/README.md b/lib/node_modules/@stdlib/blas/base/caxpy/README.md index 3993fc3def15..dc224a70b8fd 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/README.md +++ b/lib/node_modules/@stdlib/blas/base/caxpy/README.md @@ -30,43 +30,43 @@ limitations under the License. var caxpy = require( '@stdlib/blas/base/caxpy' ); ``` -#### caxpy( N, ca, cx, strideX, cy, strideY ) +#### caxpy( N, alpha, x, strideX, y, strideY ) -Scales values from `cx` by `ca` and adds the result to `cy`. +Scales values from `x` by `alpha` and adds the result to `y`. ```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 cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +var alpha = new Complex64( 2.0, 2.0 ); -caxpy( 3, ca, cx, 1, cy, 1 ); -// cy => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] +caxpy( 3, alpha, x, 1, y, 1 ); +// y => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] ``` The function has the following parameters: - **N**: number of indexed elements. -- **ca**: scalar [`Complex64`][@stdlib/complex/float32/ctor] constant. -- **cx**: first input [`Complex64Array`][@stdlib/array/complex64]. -- **strideX**: index increment for `cx`. -- **cy**: second input [`Complex64Array`][@stdlib/array/complex64]. -- **strideY**: index increment for `cy`. +- **alpha**: scalar [`Complex64`][@stdlib/complex/float32/ctor] constant. +- **x**: first input [`Complex64Array`][@stdlib/array/complex64]. +- **strideX**: index increment for `x`. +- **y**: second input [`Complex64Array`][@stdlib/array/complex64]. +- **strideY**: index increment for `y`. -The `N` and stride parameters determine how values from `cx` are scaled by `ca` and added to `cy`. For example, to scale every other value in `cx` by `ca` and add the result to every other value of `cy`, +The `N` and stride parameters determine how values from `x` are scaled by `alpha` and added to `y`. For example, to scale every other value in `x` by `alpha` and add the result to every other value of `y`, ```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 cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +var alpha = new Complex64( 2.0, 2.0 ); -caxpy( 2, ca, cx, 2, cy, 2 ); -// cy => [ -1.0, 7.0, 1.0, 1.0, -1.0, 23.0, 1.0, 1.0 ] +caxpy( 2, alpha, x, 2, y, 2 ); +// y => [ -1.0, 7.0, 1.0, 1.0, -1.0, 23.0, 1.0, 1.0 ] ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. @@ -78,41 +78,41 @@ var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); // Initial arrays... -var cx0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -var cy0 = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +var x0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +var y0 = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); // Define a scalar constant: -var ca = new Complex64( 2.0, 2.0 ); +var alpha = new Complex64( 2.0, 2.0 ); // Create offset views... -var cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var cy1 = new Complex64Array( cy0.buffer, cy0.BYTES_PER_ELEMENT*2 ); // start at 3rd element +var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var y1 = new Complex64Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element -// Scales values of `cx0` by `ca` starting from second index and add the result to `cy0` starting from third index... -caxpy( 2, ca, cx1, 1, cy1, 1 ); -// cy0 => [ 1.0, 1.0, 1.0, 1.0, -1.0, 15.0, -1.0, 23.0 ] +// Scales values of `x0` by `alpha` starting from second index and add the result to `y0` starting from third index... +caxpy( 2, alpha, x1, 1, y1, 1 ); +// y0 => [ 1.0, 1.0, 1.0, 1.0, -1.0, 15.0, -1.0, 23.0 ] ``` -#### caxpy.ndarray( N, ca, cx, strideX, offsetX, cy, strideY, offsetY ) +#### caxpy.ndarray( N, alpha, x, strideX, offsetX, y, strideY, offsetY ) -Scales values from `cx` by `ca` and adds the result to `cy` using alternative indexing semantics. +Scales values from `x` by `alpha` and adds the result to `y` 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 cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +var alpha = new Complex64( 2.0, 2.0 ); -caxpy.ndarray( 3, ca, cx, 1, 0, cy, 1, 0 ); -// cy => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] +caxpy.ndarray( 3, alpha, x, 1, 0, y, 1, 0 ); +// y => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] ``` The function has the following additional parameters: -- **offsetX**: starting index for `cx`. -- **offsetY**: starting index for `cy`. +- **offsetX**: starting index for `x`. +- **offsetY**: starting index for `y`. While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to scale values in the first input strided array starting from the second element and add the result to the second input array starting from the second element, @@ -120,12 +120,12 @@ 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 cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +var alpha = new Complex64( 2.0, 2.0 ); -caxpy.ndarray( 3, ca, cx, 1, 1, cy, 1, 1 ); -// cy => [ 1.0, 1.0, -1.0, 15.0, -1.0, 23.0, -1.0, 31.0 ] +caxpy.ndarray( 3, alpha, x, 1, 1, y, 1, 1 ); +// y => [ 1.0, 1.0, -1.0, 15.0, -1.0, 23.0, -1.0, 31.0 ] ``` @@ -136,7 +136,7 @@ caxpy.ndarray( 3, ca, cx, 1, 1, cy, 1, 1 ); ## Notes -- If `N <= 0`, both functions return `cy` unchanged. +- If `N <= 0`, both functions return `y` unchanged. - `caxpy()` corresponds to the [BLAS][blas] level 1 function [`caxpy`][caxpy]. @@ -162,17 +162,17 @@ function rand() { return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var cx = filledarrayBy( 10, 'complex64', rand ); -var cy = filledarrayBy( 10, 'complex64', rand ); -var cyc = ccopy( cy.length, cy, 1, zeros( cy.length, 'complex64' ), 1 ); +var x = filledarrayBy( 10, 'complex64', rand ); +var y = filledarrayBy( 10, 'complex64', rand ); +var yc = ccopy( y.length, y, 1, zeros( y.length, 'complex64' ), 1 ); -var ca = new Complex64( 2.0, 2.0 ); +var alpha = new Complex64( 2.0, 2.0 ); -// Scale values from `cx` by `ca` and add the result to `cy`: -caxpy( cx.length, ca, cx, 1, cy, 1 ); +// Scale values from `x` by `alpha` and add the result to `y`: +caxpy( x.length, alpha, x, 1, y, 1 ); // Print the results: -logEach( '(%s)*(%s) + (%s) = %s', ca, cx, cyc, cy ); +logEach( '(%s)*(%s) + (%s) = %s', alpha, x, yc, y ); ``` @@ -205,60 +205,60 @@ logEach( '(%s)*(%s) + (%s) = %s', ca, cx, cyc, cy ); #include "stdlib/blas/base/caxpy.h" ``` -#### c_caxpy( N, ca, \*CX, strideX, \*CY, strideY ) +#### c_caxpy( N, alpha, \*X, strideX, \*Y, strideY ) -Scales values from `cx` by `ca` and adds the result to `cy`. +Scales values from `X` by `alpha` and adds the result to `y`. ```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 }; -float cy[] = { -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 }; +float y[] = { -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_caxpy( 4, ca, (void *)cx, 1, (void *)cy, 1 ); +c_caxpy( 4, alpha, (void *)X, 1, (void *)y, 1 ); ``` The function accepts the following arguments: - **N**: `[in] CBLAS_INT` number of indexed elements. -- **ca**: `[in] stdlib_complex64_t` scalar constant. -- **CX**: `[in] void*` input array. -- **strideX**: `[in] CBLAS_INT` index increment for `CX`. -- **CY**: `[inout] void*` output array. -- **strideY**: `[in] CBLAS_INT` index increment for `CY`. +- **alpha**: `[in] stdlib_complex64_t` scalar constant. +- **X**: `[in] void*` input array. +- **strideX**: `[in] CBLAS_INT` index increment for `X`. +- **Y**: `[inout] void*` output array. +- **strideY**: `[in] CBLAS_INT` index increment for `Y`. ```c -void c_caxpy( const CBLAS_INT N, const stdlib_complex64_t ca, const void *CX, const CBLAS_INT strideX, void *CY, const CBLAS_INT strideY ); +void c_caxpy( const CBLAS_INT N, const stdlib_complex64_t alpha, const void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY ); ``` -#### c_caxpy_ndarray( N, ca, \*CX, strideX, offsetX, \*CY, strideY, offsetY ) +#### c_caxpy_ndarray( N, alpha, \*X, strideX, offsetX, \*Y, strideY, offsetY ) -Scales values from `cx` by `ca` and adds the result to `cy` using alternative indexing semantics. +Scales values from `X` by `alpha` and adds the result to `Y` 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 }; -float cy[] = { -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 }; +float Y[] = { -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_caxpy_ndarray( 4, ca, (void *)cx, 1, 0, (void *)cy, 1, 0 ); +c_caxpy_ndarray( 4, alpha, (void *)X, 1, 0, (void *)Y, 1, 0 ); ``` The function accepts the following arguments: - **N**: `[in] CBLAS_INT` number of indexed elements. -- **ca**: `[in] stdlib_complex64_t` scalar constant. -- **CX**: `[in] void*` input array. -- **strideX**: `[in] CBLAS_INT` index increment for `CX`. -- **offsetX**: `[in] CBLAS_INT` starting index for `CX`. -- **CY**: `[inout] void*` output array. -- **strideY**: `[in] CBLAS_INT` index increment for `CY`. -- **offsetY**: `[in] CBLAS_INT` starting index for `CY`. +- **alpha**: `[in] stdlib_complex64_t` scalar constant. +- **X**: `[in] void*` input array. +- **strideX**: `[in] CBLAS_INT` index increment for `X`. +- **offsetX**: `[in] CBLAS_INT` starting index for `X`. +- **Y**: `[inout] void*` output array. +- **strideY**: `[in] CBLAS_INT` index increment for `Y`. +- **offsetY**: `[in] CBLAS_INT` starting index for `Y`. ```c -void c_caxpy_ndarray( const CBLAS_INT N, const stdlib_complex64_t ca, const void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX, void *CY, const CBLAS_INT strideY, const CBLAS_INT offsetY ); +void c_caxpy_ndarray( const CBLAS_INT N, const stdlib_complex64_t alpha, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, void *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ); ``` @@ -286,11 +286,11 @@ void c_caxpy_ndarray( const CBLAS_INT N, const stdlib_complex64_t ca, const void int main( void ) { // Create strided arrays 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 cy[] = { -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 }; + float Y[] = { -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; @@ -299,20 +299,20 @@ int main( void ) { const int strideX = 1; const int strideY = 1; - // Scale values from `cx` by `ca` and adds the result to `cy`: - c_caxpy( N, ca, (void *)cx, strideX, (void *)cy, strideY ); + // Scale values from `X` by `alpha` and adds the result to `Y`: + c_caxpy( N, alpha, (void *)X, strideX, (void *)Y, strideY ); // Print the result: for ( int i = 0; i < N; i++ ) { - printf( "cy[ %i ] = %f + %fj\n", i, cy[ i*2 ], cy[ (i*2)+1 ] ); + printf( "Y[ %i ] = %f + %fj\n", i, Y[ i*2 ], Y[ (i*2)+1 ] ); } - // Scales values from `cx` by `ca` and adds the result to `cy` using alternative indexing semantics: - c_caxpy_ndarray( N, ca, (void *)cx, -strideX, 3, (void *)cy, -strideY, 3 ); + // Scales values from `X` by `alpha` and adds the result to `Y` using alternative indexing semantics: + c_caxpy_ndarray( N, alpha, (void *)X, -strideX, 3, (void *)Y, -strideY, 3 ); // Print the result: for ( int i = 0; i < N; i++ ) { - printf( "cy[ %i ] = %f + %fj\n", i, cy[ i*2 ], cy[ (i*2)+1 ] ); + printf( "Y[ %i ] = %f + %fj\n", i, Y[ i*2 ], Y[ (i*2)+1 ] ); } } ``` diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.js index b59bd3a45aa8..26764f6febd6 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.js @@ -49,16 +49,16 @@ var options = { */ function createBenchmark( len ) { var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); - cy = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); + x = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); + y = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); - viewY = reinterpret( cy, 0 ); + viewY = reinterpret( y, 0 ); - ca = new Complex64( 1.0, 0.0 ); + alpha = new Complex64( 1.0, 0.0 ); return benchmark; @@ -73,7 +73,7 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - caxpy( cx.length, ca, cx, 1, cy, 1 ); + caxpy( x.length, alpha, x, 1, y, 1 ); if ( isnanf( viewY[ i%(len*2) ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.native.js index 44219212b378..382409abf439 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.native.js @@ -54,16 +54,16 @@ var options = { */ function createBenchmark( len ) { var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); - cy = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); + x = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); + y = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); - viewY = reinterpret( cy, 0 ); + viewY = reinterpret( y, 0 ); - ca = new Complex64( 1.0, 0.0 ); + alpha = new Complex64( 1.0, 0.0 ); return benchmark; @@ -78,7 +78,7 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - caxpy( cx.length, ca, cx, 1, cy, 1 ); + caxpy( x.length, alpha, x, 1, y, 1 ); if ( isnanf( viewY[ i%(len*2) ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.js index 127c8edbcafd..85f5d25d4bf6 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.js @@ -49,16 +49,16 @@ var options = { */ function createBenchmark( len ) { var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); - cy = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); + x = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); + y = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); - viewY = reinterpret( cy, 0 ); + viewY = reinterpret( y, 0 ); - ca = new Complex64( 1.0, 0.0 ); + alpha = new Complex64( 1.0, 0.0 ); return benchmark; @@ -73,7 +73,7 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - caxpy( cx.length, ca, cx, 1, 0, cy, 1, 0 ); + caxpy( x.length, alpha, x, 1, 0, y, 1, 0 ); if ( isnanf( viewY[ i%(len*2) ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.native.js index 9f33a17db875..df92020cfa39 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/benchmark.ndarray.native.js @@ -54,16 +54,16 @@ var options = { */ function createBenchmark( len ) { var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); - cy = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); + x = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); + y = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); - viewY = reinterpret( cy, 0 ); + viewY = reinterpret( y, 0 ); - ca = new Complex64( 1.0, 0.0 ); + alpha = new Complex64( 1.0, 0.0 ); return benchmark; @@ -78,7 +78,7 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - caxpy( cx.length, ca, cx, 1, 0, cy, 1, 0 ); + caxpy( x.length, alpha, x, 1, 0, y, 1, 0 ); if ( isnanf( viewY[ i%(len*2) ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/c/benchmark.length.c index b7367722572f..69d5c9c8d9f2 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/caxpy/benchmark/c/benchmark.length.c @@ -96,30 +96,30 @@ 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 ]; - float cy[ len*2 ]; + stdlib_complex64_t alpha; + float x[ len*2 ]; + float y[ 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; - cy[ i ] = ( rand_float()*2.0f ) - 1.0f; - cy[ 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; + y[ i ] = ( rand_float()*2.0f ) - 1.0f; + y[ i+1 ] = ( rand_float()*2.0f ) - 1.0f; } t = tic(); for ( i = 0; i < iterations; i++ ) { - c_caxpy( len, ca, (void *)cx, 1, (void *)cy, 1 ); - if ( cy[ 0 ] != cy[ 0 ] ) { + c_caxpy( len, alpha, (void *)x, 1, (void *)y, 1 ); + if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); break; } } elapsed = tic() - t; - if ( cy[ 0 ] != cy[ 0 ] ) { + if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } return elapsed; @@ -133,30 +133,30 @@ 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 ]; - float cy[ len*2 ]; + stdlib_complex64_t alpha; + float x[ len*2 ]; + float y[ 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; - cy[ i ] = ( rand_float()*2.0f ) - 1.0f; - cy[ 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; + y[ i ] = ( rand_float()*2.0f ) - 1.0f; + y[ i+1 ] = ( rand_float()*2.0f ) - 1.0f; } t = tic(); for ( i = 0; i < iterations; i++ ) { - c_caxpy_ndarray( len, ca, (void *)cx, 1, 0, (void *)cy, 1, 0 ); - if ( cy[ 0 ] != cy[ 0 ] ) { + c_caxpy_ndarray( len, alpha, (void *)x, 1, 0, (void *)y, 1, 0 ); + if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); break; } } elapsed = tic() - t; - if ( cy[ 0 ] != cy[ 0 ] ) { + if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } return elapsed; diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/caxpy/docs/repl.txt index 58a0bed9ab6b..8704c1522501 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/caxpy/docs/repl.txt @@ -1,69 +1,69 @@ -{{alias}}( N, ca, cx, strideX, cy, strideY ) +{{alias}}( N, alpha, x, strideX, y, strideY ) Scales a single-precision complex floating-point vector by a single- precision complex floating point constant and adds the result to a single- precision complex floating-point vector. - The `N` and stride parameters determine how values from `cx` are scaled by - `ca` and added to `cy`. + The `N` and stride parameters determine how values from `x` are scaled by + `alpha` and added to `y`. 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 `cy` unchanged. + If `N` is less than or equal to `0`, the function returns `y` unchanged. Parameters ---------- N: integer Number of indexed elements. - ca: Complex64 + alpha: Complex64 Scalar constant. - cx: Complex64Array + x: Complex64Array First input array. strideX: integer - Index increment for `cx`. + Index increment for `x`. - cy: Complex64Array + y: Complex64Array Second input array. strideY: integer - Index increment for `cy`. + Index increment for `y`. Returns ------- - cy: Complex64Array + y: Complex64Array Second input array. Examples -------- // Standard usage: - > var cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); - > var cy = new {{alias:@stdlib/array/complex64}}( [ 1.0, 1.0, 1.0, 1.0 ] ); - > var ca = new {{alias:@stdlib/complex/float32/ctor}}( 2.0, 2.0 ); - > {{alias}}( 2, ca, cx, 1, cy, 1 ) + > var x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var y = new {{alias:@stdlib/array/complex64}}( [ 1.0, 1.0, 1.0, 1.0 ] ); + > var alpha = new {{alias:@stdlib/complex/float32/ctor}}( 2.0, 2.0 ); + > {{alias}}( 2, alpha, x, 1, y, 1 ) [ -1.0, 7.0, -1.0, 15.0 ] // Advanced indexing: - > cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); - > cy = new {{alias:@stdlib/array/complex64}}( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - > {{alias}}( 2, ca, cx, -2, cy, 1 ) + > x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + > y = new {{alias:@stdlib/array/complex64}}( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + > {{alias}}( 2, alpha, x, -2, y, 1 ) [ -1.0, 23.0, -1.0, 7.0, 1.0, 1.0 ] // Using typed array views: - > var cx0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); - > var cy0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, 1.0, 1.0, 1.0 ] ); - > var cx1 = new {{alias:@stdlib/array/complex64}}( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); - > var cy1 = new {{alias:@stdlib/array/complex64}}( cy0.buffer, cy0.BYTES_PER_ELEMENT*1 ); - > {{alias}}( 1, ca, cx1, 1, cy1, 1 ) + > var x0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var y0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, 1.0, 1.0, 1.0 ] ); + > var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > var y1 = new {{alias:@stdlib/array/complex64}}( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); + > {{alias}}( 1, alpha, x1, 1, y1, 1 ) [ -1.0, 15.0 ] - > cy0 + > y0 [ 1.0, 1.0, -1.0, 15.0 ] -{{alias}}.ndarray( N, ca, cx, strideX, offsetX, cy, strideY, offsetY ) +{{alias}}.ndarray( N, alpha, x, strideX, offsetX, y, strideY, offsetY ) Scales a single-precision complex floating-point vector by a single- precision complex floating-point constant and adds the result to a single- precision complex floating-point vector using alternative indexing @@ -78,45 +78,45 @@ N: integer Number of indexed elements. - ca: Complex64 + alpha: Complex64 Scalar constant. - cx: Complex64Array + x: Complex64Array First input array. strideX: integer - Index increment for `cx`. + Index increment for `x`. offsetX: integer - Starting index for `cx`. + Starting index for `x`. - cy: Complex64Array + y: Complex64Array Second input array. strideY: integer - Index increment for `cy`. + Index increment for `y`. offsetY: integer - Starting index for `cy`. + Starting index for `y`. Returns ------- - cy: Complex64Array + y: Complex64Array Second input array. Examples -------- // Standard usage: - > var cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); - > var cy = new {{alias:@stdlib/array/complex64}}( [ 1.0, 1.0, 1.0, 1.0 ] ); - > var ca = new {{alias:@stdlib/complex/float32/ctor}}( 2.0, 2.0 ); - > {{alias}}.ndarray( cx.length, ca, cx, 1, 0, cy, 1, 0 ) + > var x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var y = new {{alias:@stdlib/array/complex64}}( [ 1.0, 1.0, 1.0, 1.0 ] ); + > var alpha = new {{alias:@stdlib/complex/float32/ctor}}( 2.0, 2.0 ); + > {{alias}}.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 ) [ -1.0, 7.0, -1.0, 15.0 ] // Advanced indexing: - > cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); - > cy = new {{alias:@stdlib/array/complex64}}( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - > {{alias}}.ndarray( 2, ca, cx, 1, 1, cy, 1, 1 ) + > x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); + > y = new {{alias:@stdlib/array/complex64}}( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + > {{alias}}.ndarray( 2, alpha, x, 1, 1, y, 1, 1 ) [ 1.0, 1.0, -1.0, 15.0, -1.0, 23.0 ] See Also diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/caxpy/docs/types/index.d.ts index 0f26e938646e..72b569bd3bf1 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/caxpy/docs/types/index.d.ts @@ -31,85 +31,85 @@ interface Routine { * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector. * * @param N - number of indexed elements - * @param ca - scalar constant - * @param cx - first input array - * @param strideX - `cx` stride length - * @param cy - second input array - * @param strideY - `cy` stride length + * @param alpha - scalar constant + * @param x - first input array + * @param strideX - `x` stride length + * @param y - second input array + * @param strideY - `y` stride length * @returns second 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 cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + * var alpha = new Complex64( 2.0, 2.0 ); * - * caxpy( cx.length, ca, cx, 1, cy, 1 ); - * // cy => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] + * caxpy( x.length, alpha, x, 1, y, 1 ); + * // y => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] */ - ( N: number, ca: Complex64, cx: Complex64Array, strideX: number, cy: Complex64Array, strideY: number ): Complex64Array; + ( N: number, alpha: Complex64, x: Complex64Array, strideX: number, y: Complex64Array, strideY: number ): Complex64Array; /** * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector. * * @param N - number of indexed elements - * @param ca - scalar constant - * @param cx - first input array - * @param strideX - `cx` stride length - * @param offsetX - starting index for `cx` - * @param cy - second input array - * @param strideY - `cy` stride length - * @param offsetY - starting index for `cy` + * @param alpha - scalar constant + * @param x - first input array + * @param strideX - `x` stride length + * @param offsetX - starting index for `x` + * @param y - second input array + * @param strideY - `y` stride length + * @param offsetY - starting index for `y` * @returns second 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 cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + * var alpha = new Complex64( 2.0, 2.0 ); * - * caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, 1, 0 ); - * // cy => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] + * caxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 ); + * // y => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] */ - ndarray( N: number, ca: Complex64, cx: Complex64Array, strideX: number, offsetX: number, cy: Complex64Array, strideY: number, offsetY: number ): Complex64Array; + ndarray( N: number, alpha: Complex64, x: Complex64Array, strideX: number, offsetX: number, y: Complex64Array, strideY: number, offsetY: number ): Complex64Array; } /** * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector. * * @param N - number of indexed elements -* @param ca - scalar constant -* @param cx - first input array -* @param strideX - `cx` stride length -* @param cy - second input array -* @param strideY - `cy` stride length +* @param alpha - scalar constant +* @param x - first input array +* @param strideX - `x` stride length +* @param y - second input array +* @param strideY - `y` stride length * @returns second 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, 7.0, 8.0 ] ); -* var cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* caxpy( 2, ca, cx, 2, cy, 2 ); -* // cy => [ -1.0, 7.0, 1.0, 1.0, -1.0, 23.0, 1.0, 1.0 ] +* caxpy( 2, alpha, x, 2, y, 2 ); +* // y => [ -1.0, 7.0, 1.0, 1.0, -1.0, 23.0, 1.0, 1.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, 7.0, 8.0 ] ); -* var cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* caxpy.ndarray( 3, ca, cx, 1, 1, cy, 1, 1 ); -* // cy => [ 1.0, 1.0, -1.0, 15.0, -1.0, 23.0, -1.0, 31.0 ] +* caxpy.ndarray( 3, alpha, x, 1, 1, y, 1, 1 ); +* // y => [ 1.0, 1.0, -1.0, 15.0, -1.0, 23.0, -1.0, 31.0 ] */ declare var caxpy: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/caxpy/docs/types/test.ts index e7ffcb48981d..52b8a7a6cb1c 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/caxpy/docs/types/test.ts @@ -25,276 +25,276 @@ import caxpy = require( './index' ); // The function returns a Complex64Array... { - const cx = new Complex64Array( 10 ); - const cy = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); - caxpy( cx.length, ca, cx, 1, cy, 1 ); // $ExpectType Complex64Array + caxpy( x.length, alpha, x, 1, y, 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 cy = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - caxpy( '10', ca, cx, 1, cy, 1 ); // $ExpectError - caxpy( true, ca, cx, 1, cy, 1 ); // $ExpectError - caxpy( false, ca, cx, 1, cy, 1 ); // $ExpectError - caxpy( null, ca, cx, 1, cy, 1 ); // $ExpectError - caxpy( undefined, ca, cx, 1, cy, 1 ); // $ExpectError - caxpy( [], ca, cx, 1, cy, 1 ); // $ExpectError - caxpy( {}, ca, cx, 1, cy, 1 ); // $ExpectError - caxpy( ( cx: number ): number => cx, ca, cx, 1, cy, 1 ); // $ExpectError + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + caxpy( '10', alpha, x, 1, y, 1 ); // $ExpectError + caxpy( true, alpha, x, 1, y, 1 ); // $ExpectError + caxpy( false, alpha, x, 1, y, 1 ); // $ExpectError + caxpy( null, alpha, x, 1, y, 1 ); // $ExpectError + caxpy( undefined, alpha, x, 1, y, 1 ); // $ExpectError + caxpy( [], alpha, x, 1, y, 1 ); // $ExpectError + caxpy( {}, alpha, x, 1, y, 1 ); // $ExpectError + caxpy( ( x: number ): number => x, alpha, x, 1, y, 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 ); - const cy = new Complex64Array( 10 ); - - caxpy( cx.length, 10, cx, 1, cy, 1 ); // $ExpectError - caxpy( cx.length, '10', cx, 1, cy, 1 ); // $ExpectError - caxpy( cx.length, true, cx, 1, cy, 1 ); // $ExpectError - caxpy( cx.length, false, cx, 1, cy, 1 ); // $ExpectError - caxpy( cx.length, null, cx, 1, cy, 1 ); // $ExpectError - caxpy( cx.length, undefined, cx, 1, cy, 1 ); // $ExpectError - caxpy( cx.length, [ '1' ], cx, 1, cy, 1 ); // $ExpectError - caxpy( cx.length, {}, cx, 1, cy, 1 ); // $ExpectError - caxpy( cx.length, ( cx: number ): number => cx, cx, 1, cy, 1 ); // $ExpectError + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + + caxpy( x.length, 10, x, 1, y, 1 ); // $ExpectError + caxpy( x.length, '10', x, 1, y, 1 ); // $ExpectError + caxpy( x.length, true, x, 1, y, 1 ); // $ExpectError + caxpy( x.length, false, x, 1, y, 1 ); // $ExpectError + caxpy( x.length, null, x, 1, y, 1 ); // $ExpectError + caxpy( x.length, undefined, x, 1, y, 1 ); // $ExpectError + caxpy( x.length, [ '1' ], x, 1, y, 1 ); // $ExpectError + caxpy( x.length, {}, x, 1, y, 1 ); // $ExpectError + caxpy( x.length, ( x: number ): number => x, x, 1, y, 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 cy = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - caxpy( cx.length, ca, 10, 1, cy, 1 ); // $ExpectError - caxpy( cx.length, ca, '10', 1, cy, 1 ); // $ExpectError - caxpy( cx.length, ca, true, 1, cy, 1 ); // $ExpectError - caxpy( cx.length, ca, false, 1, cy, 1 ); // $ExpectError - caxpy( cx.length, ca, null, 1, cy, 1 ); // $ExpectError - caxpy( cx.length, ca, undefined, 1, cy, 1 ); // $ExpectError - caxpy( cx.length, ca, [ '1' ], 1, cy, 1 ); // $ExpectError - caxpy( cx.length, ca, {}, 1, cy, 1 ); // $ExpectError - caxpy( cx.length, ca, ( cx: number ): number => cx, 1, cy, 1 ); // $ExpectError + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + caxpy( x.length, alpha, 10, 1, y, 1 ); // $ExpectError + caxpy( x.length, alpha, '10', 1, y, 1 ); // $ExpectError + caxpy( x.length, alpha, true, 1, y, 1 ); // $ExpectError + caxpy( x.length, alpha, false, 1, y, 1 ); // $ExpectError + caxpy( x.length, alpha, null, 1, y, 1 ); // $ExpectError + caxpy( x.length, alpha, undefined, 1, y, 1 ); // $ExpectError + caxpy( x.length, alpha, [ '1' ], 1, y, 1 ); // $ExpectError + caxpy( x.length, alpha, {}, 1, y, 1 ); // $ExpectError + caxpy( x.length, alpha, ( x: number ): number => x, 1, y, 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 cy = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - caxpy( cx.length, ca, cx, '10', cy, 1 ); // $ExpectError - caxpy( cx.length, ca, cx, true, cy, 1 ); // $ExpectError - caxpy( cx.length, ca, cx, false, cy, 1 ); // $ExpectError - caxpy( cx.length, ca, cx, null, cy, 1 ); // $ExpectError - caxpy( cx.length, ca, cx, undefined, cy, 1 ); // $ExpectError - caxpy( cx.length, ca, cx, [], cy, 1 ); // $ExpectError - caxpy( cx.length, ca, cx, {}, cy, 1 ); // $ExpectError - caxpy( cx.length, ca, cx, ( cx: number ): number => cx, cy, 1 ); // $ExpectError + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + caxpy( x.length, alpha, x, '10', y, 1 ); // $ExpectError + caxpy( x.length, alpha, x, true, y, 1 ); // $ExpectError + caxpy( x.length, alpha, x, false, y, 1 ); // $ExpectError + caxpy( x.length, alpha, x, null, y, 1 ); // $ExpectError + caxpy( x.length, alpha, x, undefined, y, 1 ); // $ExpectError + caxpy( x.length, alpha, x, [], y, 1 ); // $ExpectError + caxpy( x.length, alpha, x, {}, y, 1 ); // $ExpectError + caxpy( x.length, alpha, x, ( x: number ): number => x, y, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a fifth argument which is not a Complex64Array... { - const cx = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - caxpy( cx.length, ca, cx, 1, 10, 1 ); // $ExpectError - caxpy( cx.length, ca, cx, 1, '10', 1 ); // $ExpectError - caxpy( cx.length, ca, cx, 1, true, 1 ); // $ExpectError - caxpy( cx.length, ca, cx, 1, false, 1 ); // $ExpectError - caxpy( cx.length, ca, cx, 1, null, 1 ); // $ExpectError - caxpy( cx.length, ca, cx, 1, undefined, 1 ); // $ExpectError - caxpy( cx.length, ca, cx, 1, [ '1' ], 1 ); // $ExpectError - caxpy( cx.length, ca, cx, 1, {}, 1 ); // $ExpectError - caxpy( cx.length, ca, cx, 1, ( cx: number ): number => cx, 1 ); // $ExpectError + const x = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + caxpy( x.length, alpha, x, 1, 10, 1 ); // $ExpectError + caxpy( x.length, alpha, x, 1, '10', 1 ); // $ExpectError + caxpy( x.length, alpha, x, 1, true, 1 ); // $ExpectError + caxpy( x.length, alpha, x, 1, false, 1 ); // $ExpectError + caxpy( x.length, alpha, x, 1, null, 1 ); // $ExpectError + caxpy( x.length, alpha, x, 1, undefined, 1 ); // $ExpectError + caxpy( x.length, alpha, x, 1, [ '1' ], 1 ); // $ExpectError + caxpy( x.length, alpha, x, 1, {}, 1 ); // $ExpectError + caxpy( x.length, alpha, x, 1, ( x: number ): number => x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a sixth argument which is not a number... { - const cx = new Complex64Array( 10 ); - const cy = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - caxpy( cx.length, ca, cx, 1, cy, '10' ); // $ExpectError - caxpy( cx.length, ca, cx, 1, cy, true ); // $ExpectError - caxpy( cx.length, ca, cx, 1, cy, false ); // $ExpectError - caxpy( cx.length, ca, cx, 1, cy, null ); // $ExpectError - caxpy( cx.length, ca, cx, 1, cy, undefined ); // $ExpectError - caxpy( cx.length, ca, cx, 1, cy, [] ); // $ExpectError - caxpy( cx.length, ca, cx, 1, cy, {} ); // $ExpectError - caxpy( cx.length, ca, cx, 1, cy, ( cx: number ): number => cx ); // $ExpectError + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + caxpy( x.length, alpha, x, 1, y, '10' ); // $ExpectError + caxpy( x.length, alpha, x, 1, y, true ); // $ExpectError + caxpy( x.length, alpha, x, 1, y, false ); // $ExpectError + caxpy( x.length, alpha, x, 1, y, null ); // $ExpectError + caxpy( x.length, alpha, x, 1, y, undefined ); // $ExpectError + caxpy( x.length, alpha, x, 1, y, [] ); // $ExpectError + caxpy( x.length, alpha, x, 1, y, {} ); // $ExpectError + caxpy( x.length, alpha, x, 1, y, ( 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 cy = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); caxpy(); // $ExpectError - caxpy( cx.length ); // $ExpectError - caxpy( cx.length, ca ); // $ExpectError - caxpy( cx.length, ca, cx ); // $ExpectError - caxpy( cx.length, ca, cx, 1 ); // $ExpectError - caxpy( cx.length, ca, cx, 1, cy ); // $ExpectError - caxpy( cx.length, ca, cx, 1, cy, 1, 10 ); // $ExpectError + caxpy( x.length ); // $ExpectError + caxpy( x.length, alpha ); // $ExpectError + caxpy( x.length, alpha, x ); // $ExpectError + caxpy( x.length, alpha, x, 1 ); // $ExpectError + caxpy( x.length, alpha, x, 1, y ); // $ExpectError + caxpy( x.length, alpha, x, 1, y, 1, 10 ); // $ExpectError } // Attached to main export is an `ndarray` method which returns a Complex64Array... { - const cx = new Complex64Array( 10 ); - const cy = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, 1, 0 ); // $ExpectType Complex64Array + caxpy.ndarray( x.length, alpha, x, 1, 0, y, 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 cy = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - caxpy.ndarray( '10', ca, cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( true, ca, cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( false, ca, cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( null, ca, cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( undefined, ca, cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( [], ca, cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( {}, ca, cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( ( cx: number ): number => cx, ca, cx, 1, 0, cy, 1, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + caxpy.ndarray( '10', alpha, x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( true, alpha, x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( false, alpha, x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( null, alpha, x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( undefined, alpha, x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( [], alpha, x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( {}, alpha, x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( ( x: number ): number => x, alpha, x, 1, 0, y, 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 ); - const cy = new Complex64Array( 10 ); - - caxpy.ndarray( cx.length, 10, cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, '10', cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, true, cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, false, cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, null, cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, undefined, cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, [ '1' ], cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, {}, cx, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ( cx: number ): number => cx, cx, 1, 0, cy, 1, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + + caxpy.ndarray( x.length, 10, x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, '10', x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, true, x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, false, x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, null, x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, undefined, x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, [ '1' ], x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, {}, x, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, ( x: number ): number => x, x, 1, 0, y, 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 cy = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - caxpy.ndarray( cx.length, ca, 10, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, '10', 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, true, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, false, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, null, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, undefined, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, [ '1' ], 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, {}, 1, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, ( cx: number ): number => cx, 1, 0, cy, 1, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + caxpy.ndarray( x.length, alpha, 10, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, '10', 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, true, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, false, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, null, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, undefined, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, [ '1' ], 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, {}, 1, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, ( x: number ): number => x, 1, 0, y, 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 cy = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - caxpy.ndarray( cx.length, ca, cx, '10', 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, true, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, false, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, null, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, undefined, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, [], 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, {}, 0, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, ( cx: number ): number => cx, 0, cy, 1, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + caxpy.ndarray( x.length, alpha, x, '10', 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, true, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, false, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, null, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, undefined, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, [], 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, {}, 0, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, ( x: number ): number => x, 0, y, 1, 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 cy = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - caxpy.ndarray( cx.length, ca, cx, 1, '10', cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, true, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, false, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, null, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, undefined, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, [], cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, {}, cy, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, ( cx: number ): number => cx, cy, 1, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + caxpy.ndarray( x.length, alpha, x, 1, '10', y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, true, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, false, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, null, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, undefined, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, [], y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, {}, y, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, ( x: number ): number => x, y, 1, 0 ); // $ExpectError } // The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a Complex64Array... { - const cx = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - caxpy.ndarray( cx.length, ca, cx, 1, 0, 10, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, '10', 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, true, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, false, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, null, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, undefined, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, [ '1' ], 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, {}, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, ( cx: number ): number => cx, 1, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + caxpy.ndarray( x.length, alpha, x, 1, 0, 10, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, '10', 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, true, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, false, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, null, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, undefined, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, [ '1' ], 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, {}, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError } // The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a number... { - const cx = new Complex64Array( 10 ); - const cy = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, '10', 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, true, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, false, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, null, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, undefined, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, [], 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, {}, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, ( cx: number ): number => cx, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + caxpy.ndarray( x.length, alpha, x, 1, 0, y, '10', 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, true, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, false, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, null, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, undefined, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, [], 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, {}, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, ( x: number ): number => x, 0 ); // $ExpectError } // The compiler throws an error if the `ndarray` method is provided an eighth argument which is not a number... { - const cx = new Complex64Array( 10 ); - const cy = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); - - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, 1, '10' ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, 1, true ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, 1, false ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, 1, null ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, 1, undefined ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, 1, [] ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, 1, {} ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, 1, ( cx: number ): number => cx ); // $ExpectError + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + caxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, '10' ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, true ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, false ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, null ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, undefined ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, [] ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, {} ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, 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 cy = new Complex64Array( 10 ); - const ca = new Complex64( 2.0, 2.0 ); + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); caxpy.ndarray(); // $ExpectError - caxpy.ndarray( cx.length ); // $ExpectError - caxpy.ndarray( cx.length, ca ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, 1 ); // $ExpectError - caxpy.ndarray( cx.length, ca, cx, 1, 0, cy, 1, 0, 10 ); // $ExpectError + caxpy.ndarray( x.length ); // $ExpectError + caxpy.ndarray( x.length, alpha ); // $ExpectError + caxpy.ndarray( x.length, alpha, x ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, 1 ); // $ExpectError + caxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0, 10 ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/caxpy/examples/c/example.c index 2fc282ec34d7..5880a7a9030e 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/caxpy/examples/c/example.c @@ -22,11 +22,11 @@ int main( void ) { // Create strided arrays 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 cy[] = { -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 }; + float y[] = { -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; @@ -36,18 +36,18 @@ int main( void ) { const int strideY = 1; // Scale the elements of the array: - c_caxpy( N, ca, (void *)cx, strideX, (void *)cy, strideY ); + c_caxpy( N, alpha, (void *)x, strideX, (void *)y, strideY ); // Print the result: for ( int i = 0; i < N; i++ ) { - printf( "cy[ %i ] = %f + %fj\n", i, cy[ i*2 ], cy[ (i*2)+1 ] ); + printf( "y[ %i ] = %f + %fj\n", i, y[ i*2 ], y[ (i*2)+1 ] ); } // Scale the elements of the array: - c_caxpy_ndarray( N, ca, (void *)cx, -strideX, 3, (void *)cy, -strideY, 3 ); + c_caxpy_ndarray( N, alpha, (void *)x, -strideX, 3, (void *)y, -strideY, 3 ); // Print the result: for ( int i = 0; i < N; i++ ) { - printf( "cy[ %i ] = %f + %fj\n", i, cy[ i*2 ], cy[ (i*2)+1 ] ); + printf( "y[ %i ] = %f + %fj\n", i, y[ i*2 ], y[ (i*2)+1 ] ); } } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/examples/index.js b/lib/node_modules/@stdlib/blas/base/caxpy/examples/index.js index d88440e7f0e7..8c4e00366e53 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/examples/index.js @@ -30,14 +30,14 @@ function rand() { return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -var cx = filledarrayBy( 10, 'complex64', rand ); -var cy = filledarrayBy( 10, 'complex64', rand ); -var cyc = ccopy( cy.length, cy, 1, zeros( cy.length, 'complex64' ), 1 ); +var x = filledarrayBy( 10, 'complex64', rand ); +var y = filledarrayBy( 10, 'complex64', rand ); +var yc = ccopy( y.length, y, 1, zeros( y.length, 'complex64' ), 1 ); -var ca = new Complex64( 2.0, 2.0 ); +var alpha = new Complex64( 2.0, 2.0 ); -// Scale values from `cx` by `ca` and add the result to `cy`: -caxpy( cx.length, ca, cx, 1, cy, 1 ); +// Scale values from `x` by `alpha` and add the result to `y`: +caxpy( x.length, alpha, x, 1, y, 1 ); // Print the results: -logEach( '(%s)*(%s) + (%s) = %s', ca, cx, cyc, cy ); +logEach( '(%s)*(%s) + (%s) = %s', alpha, x, yc, y ); diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/include/stdlib/blas/base/caxpy.h b/lib/node_modules/@stdlib/blas/base/caxpy/include/stdlib/blas/base/caxpy.h index ab622037d610..686adf89a644 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/include/stdlib/blas/base/caxpy.h +++ b/lib/node_modules/@stdlib/blas/base/caxpy/include/stdlib/blas/base/caxpy.h @@ -35,12 +35,12 @@ extern "C" { /** * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector. */ -void API_SUFFIX(c_caxpy)( const CBLAS_INT N, const stdlib_complex64_t ca, const void *CX, const CBLAS_INT strideX, void *CY, const CBLAS_INT strideY ); +void API_SUFFIX(c_caxpy)( const CBLAS_INT N, const stdlib_complex64_t alpha, const void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY ); /** * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector using alternative indexing semantics. */ -void API_SUFFIX(c_caxpy_ndarray)( const CBLAS_INT N, const stdlib_complex64_t ca, const void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX, void *CY, const CBLAS_INT strideY, const CBLAS_INT offsetY ); +void API_SUFFIX(c_caxpy_ndarray)( const CBLAS_INT N, const stdlib_complex64_t alpha, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, void *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ); #ifdef __cplusplus } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/include/stdlib/blas/base/caxpy_cblas.h b/lib/node_modules/@stdlib/blas/base/caxpy/include/stdlib/blas/base/caxpy_cblas.h index f6916ab67da3..178225b2e527 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/include/stdlib/blas/base/caxpy_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/caxpy/include/stdlib/blas/base/caxpy_cblas.h @@ -35,7 +35,7 @@ extern "C" { /** * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector. */ -void API_SUFFIX(cblas_caxpy)( const CBLAS_INT N, const stdlib_complex64_t ca, const void *CX, const CBLAS_INT strideX, void *CY, const CBLAS_INT strideY ); +void API_SUFFIX(cblas_caxpy)( const CBLAS_INT N, const stdlib_complex64_t alpha, const void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY ); #ifdef __cplusplus } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/lib/caxpy.js b/lib/node_modules/@stdlib/blas/base/caxpy/lib/caxpy.js index be111b3c5f43..dec1b4ceb7af 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/lib/caxpy.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/lib/caxpy.js @@ -30,28 +30,28 @@ var ndarray = require( './ndarray.js' ); * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector. * * @param {PositiveInteger} N - number of indexed elements -* @param {Complex64} ca - scalar constant -* @param {Complex64Array} cx - first input array -* @param {integer} strideX - `cx` stride length -* @param {Complex64Array} cy - second input array -* @param {integer} strideY - `cy` stride length +* @param {Complex64} alpha - scalar constant +* @param {Complex64Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {Complex64Array} y - second input array +* @param {integer} strideY - `y` stride length * @returns {Complex64Array} second 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 cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* caxpy( 3, ca, cx, 1, cy, 1 ); -* // cy => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] +* caxpy( 3, alpha, x, 1, y, 1 ); +* // y => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] */ -function caxpy( N, ca, cx, strideX, cy, strideY ) { +function caxpy( N, alpha, x, strideX, y, strideY ) { var ix = stride2offset( N, strideX ); var iy = stride2offset( N, strideY ); - return ndarray( N, ca, cx, strideX, ix, cy, strideY, iy ); + return ndarray( N, alpha, x, strideX, ix, y, strideY, iy ); } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/lib/caxpy.native.js b/lib/node_modules/@stdlib/blas/base/caxpy/lib/caxpy.native.js index 399345d908ba..8d663e17e8d7 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/lib/caxpy.native.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/lib/caxpy.native.js @@ -30,29 +30,29 @@ var addon = require( './../src/addon.node' ); * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector. * * @param {PositiveInteger} N - number of indexed elements -* @param {Complex64} ca - scalar constant -* @param {Complex64Array} cx - first input array -* @param {integer} strideX - `cx` stride length -* @param {Complex64Array} cy - second input array -* @param {integer} strideY - `cy` stride length +* @param {Complex64} alpha - scalar constant +* @param {Complex64Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {Complex64Array} y - second input array +* @param {integer} strideY - `y` stride length * @returns {Complex64Array} second 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 cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* caxpy( 3, ca, cx, 1, cy, 1 ); -* // cy => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] +* caxpy( 3, alpha, x, 1, y, 1 ); +* // y => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] */ -function caxpy( N, ca, cx, strideX, cy, strideY ) { - var viewCX = reinterpret( cx, 0 ); - var viewCY = reinterpret( cy, 0 ); - addon( N, ca, viewCX, strideX, viewCY, strideY ); - return cy; +function caxpy( N, alpha, x, strideX, y, strideY ) { + var viewX = reinterpret( x, 0 ); + var viewY = reinterpret( y, 0 ); + addon( N, alpha, viewX, strideX, viewY, strideY ); + return y; } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/lib/index.js b/lib/node_modules/@stdlib/blas/base/caxpy/lib/index.js index e03a87ee5ce5..91d3884c7a5d 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/lib/index.js @@ -28,24 +28,24 @@ * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * var caxpy = require( '@stdlib/blas/base/caxpy' ); * -* var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -* var cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* caxpy( 3, ca, cx, 1, cy, 1 ); -* // cy => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] +* caxpy( 3, alpha, x, 1, y, 1 ); +* // y => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * var caxpy = require( '@stdlib/blas/base/caxpy' ); * -* var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); -* var cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* caxpy.ndarray( 3, ca cx, 1, 0, cy, 1, 0); -* // cy => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] +* caxpy.ndarray( 3, alpha x, 1, 0, y, 1, 0); +* // y => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] */ // MODULES // diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/caxpy/lib/ndarray.js index f43da14b46ad..d9a9ba079553 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/lib/ndarray.js @@ -31,42 +31,42 @@ var caddf = require( '@stdlib/complex/float32/base/add' ); * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector. * * @param {PositiveInteger} N - number of indexed elements -* @param {Complex64} ca - scalar constant -* @param {Complex64Array} cx - first input array -* @param {integer} strideX - `cx` stride length -* @param {integer} offsetX - starting index for `cx` -* @param {Complex64Array} cy - second input array -* @param {integer} strideY - `cy` stride length -* @param {integer} offsetY - starting index for `cy` +* @param {Complex64} alpha - scalar constant +* @param {Complex64Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {integer} offsetX - starting index for `x` +* @param {Complex64Array} y - second input array +* @param {integer} strideY - `y` stride length +* @param {integer} offsetY - starting index for `y` * @returns {Complex64Array} second 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 cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* caxpy( 3, ca, cx, 1, 0, cy, 1, 0 ); -* // cy => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] +* caxpy( 3, alpha, x, 1, 0, y, 1, 0 ); +* // y => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] */ -function caxpy( N, ca, cx, strideX, offsetX, cy, strideY, offsetY ) { +function caxpy( N, alpha, x, strideX, offsetX, y, strideY, offsetY ) { var ix; var iy; var i; - if ( N <= 0 || scabs1( ca ) === 0.0 ) { - return cy; + if ( N <= 0 || scabs1( alpha ) === 0.0 ) { + return y; } ix = offsetX; iy = offsetY; for ( i = 0; i < N; i++ ) { - cy.set( caddf( cmulf( ca, cx.get( ix ) ), cy.get( iy ) ), iy ); + y.set( caddf( cmulf( alpha, x.get( ix ) ), y.get( iy ) ), iy ); ix += strideX; iy += strideY; } - return cy; + return y; } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/caxpy/lib/ndarray.native.js index a05bd5971498..45f90499aa94 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/lib/ndarray.native.js @@ -30,31 +30,31 @@ var addon = require( './../src/addon.node' ); * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector using alternative indexing semantics. * * @param {PositiveInteger} N - number of indexed elements -* @param {Complex64} ca - scalar constant -* @param {Complex64Array} cx - first input array -* @param {integer} strideX - `cx` stride length -* @param {integer} offsetX - starting index for `cx` -* @param {Complex64Array} cy - second input array -* @param {integer} strideY - `cy` stride length -* @param {integer} offsetY - starting index for `cy` +* @param {Complex64} alpha - scalar constant +* @param {Complex64Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {integer} offsetX - starting index for `x` +* @param {Complex64Array} y - second input array +* @param {integer} strideY - `y` stride length +* @param {integer} offsetY - starting index for `y` * @returns {Complex64Array} second 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 cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 2.0, 2.0 ); * -* caxpy( 3, ca, cx, 1, 0, cy, 1, 0 ); -* // cy => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] +* caxpy( 3, alpha, x, 1, 0, y, 1, 0 ); +* // y => [ -1.0, 7.0, -1.0, 15.0, -1.0, 23.0 ] */ -function caxpy( N, ca, cx, strideX, offsetX, cy, strideY, offsetY ) { - var viewCX = reinterpret( cx, 0 ); - var viewCY = reinterpret( cy, 0 ); - addon.ndarray( N, ca, viewCX, strideX, offsetX, viewCY, strideY, offsetY ); - return cy; +function caxpy( N, alpha, x, strideX, offsetX, y, strideY, offsetY ) { + var viewX = reinterpret( x, 0 ); + var viewY = reinterpret( y, 0 ); + addon.ndarray( N, alpha, viewX, strideX, offsetX, viewY, strideY, offsetY ); + return y; } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/src/addon.c b/lib/node_modules/@stdlib/blas/base/caxpy/src/addon.c index 8fd4b68c169a..5300308bb243 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/src/addon.c +++ b/lib/node_modules/@stdlib/blas/base/caxpy/src/addon.c @@ -37,10 +37,10 @@ static napi_value addon( 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, strideY, argv, 5 ); - STDLIB_NAPI_ARGV_COMPLEX64( env, ca, argv, 1 ); - STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, CX, N, strideX, argv, 2 ); - STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, CY, N, strideY, argv, 4 ); - API_SUFFIX(c_caxpy)( N, ca, (void *)CX, strideX, (void *)CY, strideY ); + STDLIB_NAPI_ARGV_COMPLEX64( env, alpha, argv, 1 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 2 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, Y, N, strideY, argv, 4 ); + API_SUFFIX(c_caxpy)( N, alpha, (void *)X, strideX, (void *)Y, strideY ); return NULL; } @@ -58,10 +58,10 @@ static napi_value addon_method( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 4 ); STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 6 ); STDLIB_NAPI_ARGV_INT64( env, offsetY, argv, 7 ); - STDLIB_NAPI_ARGV_COMPLEX64( env, ca, argv, 1 ); - STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, CX, N, strideX, argv, 2 ); - STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, CY, N, strideY, argv, 5 ); - API_SUFFIX(c_caxpy_ndarray)( N, ca, (void *)CX, strideX, offsetX, (void *)CY, strideY, offsetY ); + STDLIB_NAPI_ARGV_COMPLEX64( env, alpha, argv, 1 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 2 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, Y, N, strideY, argv, 5 ); + API_SUFFIX(c_caxpy_ndarray)( N, alpha, (void *)X, strideX, offsetX, (void *)Y, strideY, offsetY ); return NULL; } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/src/caxpy.c b/lib/node_modules/@stdlib/blas/base/caxpy/src/caxpy.c index f76affe3259f..0f61d83ee8fd 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/src/caxpy.c +++ b/lib/node_modules/@stdlib/blas/base/caxpy/src/caxpy.c @@ -25,14 +25,14 @@ * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector. * * @param N number of indexed elements -* @param ca scalar constant -* @param CX input array -* @param strideX CX stride length -* @param CY output array -* @param strideY CY stride length +* @param alpha scalar constant +* @param X input array +* @param strideX X stride length +* @param Y output array +* @param strideY Y stride length */ -void API_SUFFIX(c_caxpy)( const CBLAS_INT N, const stdlib_complex64_t ca, const void *CX, const CBLAS_INT strideX, void *CY, const CBLAS_INT strideY ) { +void API_SUFFIX(c_caxpy)( const CBLAS_INT N, const stdlib_complex64_t alpha, const void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY ) { CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); CBLAS_INT oy = stdlib_strided_stride2offset( N, strideY ); - API_SUFFIX(c_caxpy_ndarray)( N, ca, CX, strideX, ox, CY, strideY, oy ); + API_SUFFIX(c_caxpy_ndarray)( N, alpha, X, strideX, ox, Y, strideY, oy ); } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/src/caxpy_cblas.c b/lib/node_modules/@stdlib/blas/base/caxpy/src/caxpy_cblas.c index e7633f6d2e53..31e1dfc93118 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/src/caxpy_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/caxpy/src/caxpy_cblas.c @@ -25,33 +25,33 @@ * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector. * * @param N number of indexed elements -* @param ca scalar constant -* @param CX input array -* @param strideX CX stride length -* @param CY output array -* @param strideY CY stride length +* @param alpha scalar constant +* @param X input array +* @param strideX X stride length +* @param Y output array +* @param strideY Y stride length */ -void API_SUFFIX(c_caxpy)( const CBLAS_INT N, const stdlib_complex64_t ca, const void *CX, const CBLAS_INT strideX, void *CY, const CBLAS_INT strideY ) { - API_SUFFIX(cblas_caxpy)( N, ca, CX, strideX, CY, strideY ); +void API_SUFFIX(c_caxpy)( const CBLAS_INT N, const stdlib_complex64_t alpha, const void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY ) { + API_SUFFIX(cblas_caxpy)( N, alpha, X, strideX, Y, strideY ); } /** * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector 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 CY output array -* @param strideY CY stride length -* @param offsetY starting index for CY +* @param alpha scalar constant +* @param X input array +* @param strideX X stride length +* @param offsetX starting index for X +* @param Y output array +* @param strideY Y stride length +* @param offsetY starting index for Y */ -void API_SUFFIX(c_caxpy_ndarray)( const CBLAS_INT N, const stdlib_complex64_t ca, const void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX, void *CY, const CBLAS_INT strideY, const CBLAS_INT offsetY ) { - stdlib_complex64_t *cx = (stdlib_complex64_t *)CX; - stdlib_complex64_t *cy = (stdlib_complex64_t *)CY; +void API_SUFFIX(c_caxpy_ndarray)( const CBLAS_INT N, const stdlib_complex64_t alpha, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, void *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) { + stdlib_complex64_t *x = (stdlib_complex64_t *)X; + stdlib_complex64_t *y = (stdlib_complex64_t *)Y; - cx += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); // adjust array pointer - cy += stdlib_strided_min_view_buffer_index( N, strideY, offsetY ); // adjust array pointer - API_SUFFIX(cblas_caxpy)( N, ca, (void *)cx, sx, (void *)cy, sy ); + x += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); // adjust array pointer + y += stdlib_strided_min_view_buffer_index( N, strideY, offsetY ); // adjust array pointer + API_SUFFIX(cblas_caxpy)( N, alpha, (void *)x, sx, (void *)y, sy ); } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/src/caxpy_ndarray.c b/lib/node_modules/@stdlib/blas/base/caxpy/src/caxpy_ndarray.c index 0d52ca340a57..1d7d5802b55c 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/src/caxpy_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/caxpy/src/caxpy_ndarray.c @@ -28,15 +28,15 @@ * Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector 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 CY output array -* @param strideY CY stride length -* @param offsetY starting index for CY +* @param alpha scalar constant +* @param X input array +* @param strideX X stride length +* @param offsetX starting index for X +* @param Y output array +* @param strideY Y stride length +* @param offsetY starting index for Y */ -void API_SUFFIX(c_caxpy_ndarray)( const CBLAS_INT N, const stdlib_complex64_t ca, const void *CX, const CBLAS_INT strideX, const CBLAS_INT offsetX, void *CY, const CBLAS_INT strideY, const CBLAS_INT offsetY ) { +void API_SUFFIX(c_caxpy_ndarray)( const CBLAS_INT N, const stdlib_complex64_t alpha, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, void *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) { stdlib_complex64_t x; stdlib_complex64_t y; int64_t is1; @@ -46,11 +46,11 @@ void API_SUFFIX(c_caxpy_ndarray)( const CBLAS_INT N, const stdlib_complex64_t ca if ( N <= 0 ) { return; } - if ( c_scabs1( ca ) == 0.0f ) { + if ( c_scabs1( alpha ) == 0.0f ) { return; } - stdlib_complex64_t *ip1 = (stdlib_complex64_t *)CX; - stdlib_complex64_t *ip2 = (stdlib_complex64_t *)CY; + stdlib_complex64_t *ip1 = (stdlib_complex64_t *)X; + stdlib_complex64_t *ip2 = (stdlib_complex64_t *)Y; is1 = (int64_t)strideX; is2 = (int64_t)strideY; ip1 += offsetX; @@ -58,7 +58,7 @@ void API_SUFFIX(c_caxpy_ndarray)( const CBLAS_INT N, const stdlib_complex64_t ca for ( i = 0; i < N; i++, ip1 += is1, ip2 += is2 ) { x = *ip1; y = *ip2; - *ip2 = stdlib_base_complex64_add( stdlib_base_complex64_mul( ca, x ), y ); + *ip2 = stdlib_base_complex64_add( stdlib_base_complex64_mul( alpha, x ), y ); } return; } diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/test/test.caxpy.js b/lib/node_modules/@stdlib/blas/base/caxpy/test/test.caxpy.js index c38510e38750..e230f11c317e 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/test/test.caxpy.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/test/test.caxpy.js @@ -71,14 +71,14 @@ tape( 'the function has an arity of 6', function test( t ) { t.end(); }); -tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy`', function test( t ) { +tape( 'the function scales elements from `x` by `alpha` and adds the result to `y`', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -94,7 +94,7 @@ tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -110,11 +110,11 @@ tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 1, cy, 1 ); + caxpy( 4, alpha, x, 1, y, 1 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 1 -1.41, // 1 @@ -135,14 +135,14 @@ tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy t.end(); }); -tape( 'the function supports a `cx` stride', function test( t ) { +tape( 'the function supports a `x` stride', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, @@ -158,7 +158,7 @@ tape( 'the function supports a `cx` stride', function test( t ) { -0.6, // 4 0.6 // 4 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -174,11 +174,11 @@ tape( 'the function supports a `cx` stride', function test( t ) { 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 2, cy, 1 ); + caxpy( 4, alpha, x, 2, y, 1 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 1 -1.41, // 1 @@ -199,14 +199,14 @@ tape( 'the function supports a `cx` stride', function test( t ) { t.end(); }); -tape( 'the function supports a `cy` stride', function test( t ) { +tape( 'the function supports a `y` stride', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -222,7 +222,7 @@ tape( 'the function supports a `cy` stride', function test( t ) { -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, @@ -238,11 +238,11 @@ tape( 'the function supports a `cy` stride', function test( t ) { 0.8, // 4 -0.7 // 4 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 1, cy, 2 ); + caxpy( 4, alpha, x, 1, y, 2 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 1 -1.41, // 1 @@ -264,39 +264,39 @@ tape( 'the function supports a `cy` stride', function test( t ) { }); tape( 'the function returns a reference to the output array', function test( t ) { + var alpha; var out; - var ca; - var cx; - var cy; + var x; + var y; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cy = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.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 ] ); + y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - out = caxpy( cx.length, ca, cx, 1, cy, 1 ); + out = caxpy( x.length, alpha, x, 1, y, 1 ); - t.strictEqual( out, cy, 'same reference' ); + t.strictEqual( out, y, 'same reference' ); t.end(); }); -tape( 'if provided `ca` parameter equal to `0`, the function returns the second input array unchanged', function test( t ) { +tape( 'if provided `alpha` parameter equal to `0`, the function returns the second input array unchanged', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - ca = new Complex64( 0.0, 0.0 ); + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + alpha = new Complex64( 0.0, 0.0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - caxpy( -1, ca, cx, 1, 0, cy, 1, 0 ); + caxpy( -1, alpha, x, 1, 0, y, 1, 0 ); t.deepEqual( viewY, expected, 'returns expected value' ); - caxpy( 0, ca, cx, 1, 0, cy, 1, 0 ); + caxpy( 0, alpha, x, 1, 0, y, 1, 0 ); t.deepEqual( viewY, expected, 'returns expected value' ); t.end(); @@ -305,34 +305,34 @@ tape( 'if provided `ca` parameter equal to `0`, the function returns the second tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the second input array unchanged', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 ] ); + y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - caxpy( -1, ca, cx, 1, cy, 1 ); + caxpy( -1, alpha, x, 1, y, 1 ); t.deepEqual( viewY, expected, 'returns expected value' ); - caxpy( 0, ca, cx, 1, cy, 1 ); + caxpy( 0, alpha, x, 1, y, 1 ); t.deepEqual( viewY, expected, 'returns expected value' ); t.end(); }); -tape( 'the function supports negative `cx` strides', function test( t ) { +tape( 'the function supports negative `x` strides', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 4 -0.8, // 4 -0.4, @@ -348,7 +348,7 @@ tape( 'the function supports negative `cx` strides', function test( t ) { -0.6, // 1 0.6 // 1 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -364,11 +364,11 @@ tape( 'the function supports negative `cx` strides', function test( t ) { 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, -2, cy, 1 ); + caxpy( 4, alpha, x, -2, y, 1 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.78, // 1 0.06, // 1 @@ -389,14 +389,14 @@ tape( 'the function supports negative `cx` strides', function test( t ) { t.end(); }); -tape( 'the function supports negative `cy` strides', function test( t ) { +tape( 'the function supports negative `y` strides', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, @@ -412,7 +412,7 @@ tape( 'the function supports negative `cy` strides', function test( t ) { -0.6, // 4 0.6 // 4 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 4 -0.6, // 4 -0.9, @@ -428,11 +428,11 @@ tape( 'the function supports negative `cy` strides', function test( t ) { 0.8, // 1 -0.7 // 1 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 2, cy, -2 ); + caxpy( 4, alpha, x, 2, y, -2 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.78, // 4 0.06, // 4 @@ -456,11 +456,11 @@ tape( 'the function supports negative `cy` strides', function test( t ) { tape( 'the function supports complex access patterns', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 4 -0.8, // 4 -0.4, // 3 @@ -476,7 +476,7 @@ tape( 'the function supports complex access patterns', function test( t ) { -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 4 -0.6, // 4 -0.9, @@ -492,11 +492,11 @@ tape( 'the function supports complex access patterns', function test( t ) { 0.8, // 1 -0.7 // 1 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, -1, cy, -2 ); + caxpy( 4, alpha, x, -1, y, -2 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 4 -1.41, // 4 @@ -520,11 +520,11 @@ tape( 'the function supports complex access patterns', function test( t ) { tape( 'the function supports view offsets', function test( t ) { var expected; var viewY; + var alpha; var cx0; var cy0; var cx1; var cy1; - var ca; // Initial arrays... cx0 = new Complex64Array([ @@ -545,13 +545,13 @@ tape( 'the function supports view offsets', function test( t ) { ]); // Define a scalar constant: - ca = new Complex64( 2.0, 2.0 ); + alpha = new Complex64( 2.0, 2.0 ); // Create offset views... cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // begin at the 2nd element cy1 = new Complex64Array( cy0.buffer, cy0.BYTES_PER_ELEMENT*2 ); // begin at the 3rd element - caxpy( 1, ca, cx1, 1, cy1, 1 ); + caxpy( 1, alpha, cx1, 1, cy1, 1 ); viewY = new Float32Array( cy0.buffer ); expected = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, -1.0, 15.0 ] ); diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/test/test.caxpy.native.js b/lib/node_modules/@stdlib/blas/base/caxpy/test/test.caxpy.native.js index 905507b109d1..2546fb1a9206 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/test/test.caxpy.native.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/test/test.caxpy.native.js @@ -80,14 +80,14 @@ tape( 'the function has an arity of 6', opts, function test( t ) { t.end(); }); -tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy`', opts, function test( t ) { +tape( 'the function scales elements from `x` by `alpha` and adds the result to `y`', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -103,7 +103,7 @@ tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -119,11 +119,11 @@ tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 1, cy, 1 ); + caxpy( 4, alpha, x, 1, y, 1 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 1 -1.41, // 1 @@ -144,14 +144,14 @@ tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy t.end(); }); -tape( 'the function supports a `cx` stride', opts, function test( t ) { +tape( 'the function supports a `x` stride', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, @@ -167,7 +167,7 @@ tape( 'the function supports a `cx` stride', opts, function test( t ) { -0.6, // 4 0.6 // 4 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -183,11 +183,11 @@ tape( 'the function supports a `cx` stride', opts, function test( t ) { 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 2, cy, 1 ); + caxpy( 4, alpha, x, 2, y, 1 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 1 -1.41, // 1 @@ -208,14 +208,14 @@ tape( 'the function supports a `cx` stride', opts, function test( t ) { t.end(); }); -tape( 'the function supports a `cy` stride', opts, function test( t ) { +tape( 'the function supports a `y` stride', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -231,7 +231,7 @@ tape( 'the function supports a `cy` stride', opts, function test( t ) { -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, @@ -247,11 +247,11 @@ tape( 'the function supports a `cy` stride', opts, function test( t ) { 0.8, // 4 -0.7 // 4 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 1, cy, 2 ); + caxpy( 4, alpha, x, 1, y, 2 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 1 -1.41, // 1 @@ -273,39 +273,39 @@ tape( 'the function supports a `cy` stride', opts, function test( t ) { }); tape( 'the function returns a reference to the output array', opts, function test( t ) { + var alpha; var out; - var ca; - var cx; - var cy; + var x; + var y; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cy = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.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 ] ); + y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - out = caxpy( cx.length, ca, cx, 1, cy, 1 ); + out = caxpy( x.length, alpha, x, 1, y, 1 ); - t.strictEqual( out, cy, 'same reference' ); + t.strictEqual( out, y, 'same reference' ); t.end(); }); -tape( 'if provided `ca` parameter equal to `0`, the function returns the second input array unchanged', opts, function test( t ) { +tape( 'if provided `alpha` parameter equal to `0`, the function returns the second input array unchanged', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - ca = new Complex64( 0.0, 0.0 ); + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + alpha = new Complex64( 0.0, 0.0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - caxpy( -1, ca, cx, 1, cy, 1 ); + caxpy( -1, alpha, x, 1, y, 1 ); t.deepEqual( viewY, expected, 'returns expected value' ); - caxpy( 0, ca, cx, 1, cy, 1 ); + caxpy( 0, alpha, x, 1, y, 1 ); t.deepEqual( viewY, expected, 'returns expected value' ); t.end(); @@ -314,34 +314,34 @@ tape( 'if provided `ca` parameter equal to `0`, the function returns the second tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the second input array unchanged', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 ] ); + y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - caxpy( -1, ca, cx, 1, cy, 1 ); + caxpy( -1, alpha, x, 1, y, 1 ); t.deepEqual( viewY, expected, 'returns expected value' ); - caxpy( 0, ca, cx, 1, cy, 1 ); + caxpy( 0, alpha, x, 1, y, 1 ); t.deepEqual( viewY, expected, 'returns expected value' ); t.end(); }); -tape( 'the function supports negative `cx` strides', opts, function test( t ) { +tape( 'the function supports negative `x` strides', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 4 -0.8, // 4 -0.4, @@ -357,7 +357,7 @@ tape( 'the function supports negative `cx` strides', opts, function test( t ) { -0.6, // 1 0.6 // 1 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -373,11 +373,11 @@ tape( 'the function supports negative `cx` strides', opts, function test( t ) { 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, -2, cy, 1 ); + caxpy( 4, alpha, x, -2, y, 1 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.78, // 1 0.06, // 1 @@ -398,14 +398,14 @@ tape( 'the function supports negative `cx` strides', opts, function test( t ) { t.end(); }); -tape( 'the function supports negative `cy` strides', opts, function test( t ) { +tape( 'the function supports negative `y` strides', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, @@ -421,7 +421,7 @@ tape( 'the function supports negative `cy` strides', opts, function test( t ) { -0.6, // 4 0.6 // 4 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 4 -0.6, // 4 -0.9, @@ -437,11 +437,11 @@ tape( 'the function supports negative `cy` strides', opts, function test( t ) { 0.8, // 1 -0.7 // 1 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 2, cy, -2 ); + caxpy( 4, alpha, x, 2, y, -2 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.78, // 4 0.06, // 4 @@ -465,11 +465,11 @@ tape( 'the function supports negative `cy` strides', opts, function test( t ) { tape( 'the function supports complex access patterns', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 4 -0.8, // 4 -0.4, // 3 @@ -485,7 +485,7 @@ tape( 'the function supports complex access patterns', opts, function test( t ) -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 4 -0.6, // 4 -0.9, @@ -501,11 +501,11 @@ tape( 'the function supports complex access patterns', opts, function test( t ) 0.8, // 1 -0.7 // 1 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, -1, cy, -2 ); + caxpy( 4, alpha, x, -1, y, -2 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 4 -1.41, // 4 @@ -529,14 +529,14 @@ tape( 'the function supports complex access patterns', opts, function test( t ) tape( 'the function supports view offsets', opts, function test( t ) { var expected; var viewY; - var cx0; - var cy0; - var cx1; - var cy1; - var ca; + var alpha; + var x0; + var y0; + var x1; + var y1; // Initial arrays... - cx0 = new Complex64Array([ + x0 = new Complex64Array([ 1.0, 2.0, 3.0, // 1 @@ -544,7 +544,7 @@ tape( 'the function supports view offsets', opts, function test( t ) { 5.0, 6.0 ]); - cy0 = new Complex64Array([ + y0 = new Complex64Array([ 1.0, 1.0, 1.0, @@ -554,15 +554,15 @@ tape( 'the function supports view offsets', opts, function test( t ) { ]); // Define a scalar constant: - ca = new Complex64( 2.0, 2.0 ); + alpha = new Complex64( 2.0, 2.0 ); // Create offset views... - cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // begin at the 2nd element - cy1 = new Complex64Array( cy0.buffer, cy0.BYTES_PER_ELEMENT*2 ); // begin at the 3rd element + x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // begin at the 2nd element + y1 = new Complex64Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // begin at the 3rd element - caxpy( 1, ca, cx1, 1, cy1, 1 ); + caxpy( 1, alpha, x1, 1, y1, 1 ); - viewY = new Float32Array( cy0.buffer ); + viewY = new Float32Array( y0.buffer ); expected = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, -1.0, 15.0 ] ); t.deepEqual( viewY, expected, 'returns expected value' ); diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/caxpy/test/test.ndarray.js index 9cc06fcac38e..f888dd4c9c0e 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/test/test.ndarray.js @@ -71,14 +71,14 @@ tape( 'the function has an arity of 8', function test( t ) { t.end(); }); -tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy`', function test( t ) { +tape( 'the function scales elements from `x` by `alpha` and adds the result to `y`', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -94,7 +94,7 @@ tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -110,11 +110,11 @@ tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 1, 0, cy, 1, 0 ); + caxpy( 4, alpha, x, 1, 0, y, 1, 0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 1 -1.41, // 1 @@ -135,14 +135,14 @@ tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy t.end(); }); -tape( 'the function supports a `cx` stride', function test( t ) { +tape( 'the function supports a `x` stride', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, @@ -158,7 +158,7 @@ tape( 'the function supports a `cx` stride', function test( t ) { -0.6, // 4 0.6 // 4 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -174,11 +174,11 @@ tape( 'the function supports a `cx` stride', function test( t ) { 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 2, 0, cy, 1, 0 ); + caxpy( 4, alpha, x, 2, 0, y, 1, 0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 1 -1.41, // 1 @@ -199,14 +199,14 @@ tape( 'the function supports a `cx` stride', function test( t ) { 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 viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, -0.8, -0.4, // 1 @@ -222,7 +222,7 @@ tape( 'the function supports a `cx` offset', function test( t ) { -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -238,11 +238,11 @@ tape( 'the function supports a `cx` offset', function test( t ) { 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 3, ca, cx, 2, 1, cy, 1, 0 ); + caxpy( 3, alpha, x, 2, 1, y, 1, 0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ -0.05, // 1 -0.6, // 1 @@ -263,14 +263,14 @@ tape( 'the function supports a `cx` offset', function test( t ) { t.end(); }); -tape( 'the function supports a `cy` stride', function test( t ) { +tape( 'the function supports a `y` stride', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -286,7 +286,7 @@ tape( 'the function supports a `cy` stride', function test( t ) { -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, @@ -302,11 +302,11 @@ tape( 'the function supports a `cy` stride', function test( t ) { 0.8, // 4 -0.7 // 4 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 1, 0, cy, 2, 0 ); + caxpy( 4, alpha, x, 1, 0, y, 2, 0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 1 -1.41, // 1 @@ -327,14 +327,14 @@ tape( 'the function supports a `cy` stride', function test( t ) { t.end(); }); -tape( 'the function supports a `cy` offset', function test( t ) { +tape( 'the function supports a `y` offset', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -350,7 +350,7 @@ tape( 'the function supports a `cy` offset', function test( t ) { -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, -0.6, -0.9, // 1 @@ -366,11 +366,11 @@ tape( 'the function supports a `cy` offset', function test( t ) { 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 3, ca, cx, 1, 0, cy, 2, 1 ); + caxpy( 3, alpha, x, 1, 0, y, 2, 1 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.6, -0.6, @@ -392,39 +392,39 @@ tape( 'the function supports a `cy` offset', function test( t ) { }); tape( 'the function returns a reference to the output array', function test( t ) { + var alpha; var out; - var ca; - var cx; - var cy; + var x; + var y; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cy = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.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 ] ); + y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - out = caxpy( cx.length, ca, cx, 1, 0, cy, 1, 0 ); + out = caxpy( x.length, alpha, x, 1, 0, y, 1, 0 ); - t.strictEqual( out, cy, 'same reference' ); + t.strictEqual( out, y, 'same reference' ); t.end(); }); -tape( 'if provided `ca` parameter equal to `0`, the function returns the second input array unchanged', function test( t ) { +tape( 'if provided `alpha` parameter equal to `0`, the function returns the second input array unchanged', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - ca = new Complex64( 0.0, 0.0 ); + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + alpha = new Complex64( 0.0, 0.0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - caxpy( -1, ca, cx, 1, 0, cy, 1, 0 ); + caxpy( -1, alpha, x, 1, 0, y, 1, 0 ); t.deepEqual( viewY, expected, 'returns expected value' ); - caxpy( 0, ca, cx, 1, 0, cy, 1, 0 ); + caxpy( 0, alpha, x, 1, 0, y, 1, 0 ); t.deepEqual( viewY, expected, 'returns expected value' ); t.end(); @@ -433,34 +433,34 @@ tape( 'if provided `ca` parameter equal to `0`, the function returns the second tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the second input array unchanged', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 ] ); + y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - caxpy( -1, ca, cx, 1, 0, cy, 1, 0 ); + caxpy( -1, alpha, x, 1, 0, y, 1, 0 ); t.deepEqual( viewY, expected, 'returns expected value' ); - caxpy( 0, ca, cx, 1, 0, cy, 1, 0 ); + caxpy( 0, alpha, x, 1, 0, y, 1, 0 ); t.deepEqual( viewY, expected, 'returns expected value' ); t.end(); }); -tape( 'the function supports a negative `cx` stride', function test( t ) { +tape( 'the function supports a negative `x` stride', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 4 -0.8, // 4 -0.4, @@ -476,7 +476,7 @@ tape( 'the function supports a negative `cx` stride', function test( t ) { -0.6, // 1 0.6 // 1 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -492,11 +492,11 @@ tape( 'the function supports a negative `cx` stride', function test( t ) { 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, -2, 6, cy, 1, 0 ); + caxpy( 4, alpha, x, -2, 6, y, 1, 0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.78, // 1 0.06, // 1 @@ -517,14 +517,14 @@ tape( 'the function supports a negative `cx` stride', function test( t ) { t.end(); }); -tape( 'the function supports a negative `cy` stride', function test( t ) { +tape( 'the function supports a negative `y` stride', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, @@ -540,7 +540,7 @@ tape( 'the function supports a negative `cy` stride', function test( t ) { -0.6, // 4 0.6 // 4 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 4 -0.6, // 4 -0.9, @@ -556,11 +556,11 @@ tape( 'the function supports a negative `cy` stride', function test( t ) { 0.8, // 1 -0.7 // 1 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 2, 0, cy, -2, 6 ); + caxpy( 4, alpha, x, 2, 0, y, -2, 6 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.78, // 4 0.06, // 4 @@ -584,11 +584,11 @@ tape( 'the function supports a negative `cy` stride', function test( t ) { tape( 'the function supports complex access patterns', function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 4 -0.8, // 4 -0.4, // 3 @@ -604,7 +604,7 @@ tape( 'the function supports complex access patterns', function test( t ) { -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 4 -0.6, // 4 -0.9, @@ -620,11 +620,11 @@ tape( 'the function supports complex access patterns', function test( t ) { 0.8, // 1 -0.7 // 1 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, -1, 3, cy, -2, 6 ); + caxpy( 4, alpha, x, -1, 3, y, -2, 6 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 4 -1.41, // 4 diff --git a/lib/node_modules/@stdlib/blas/base/caxpy/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/caxpy/test/test.ndarray.native.js index cd9a8455b236..8029cf533998 100644 --- a/lib/node_modules/@stdlib/blas/base/caxpy/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/caxpy/test/test.ndarray.native.js @@ -80,14 +80,14 @@ tape( 'the function has an arity of 8', opts, function test( t ) { t.end(); }); -tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy`', opts, function test( t ) { +tape( 'the function scales elements from `x` by `alpha` and adds the result to `y`', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -103,7 +103,7 @@ tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -119,11 +119,11 @@ tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 1, 0, cy, 1, 0 ); + caxpy( 4, alpha, x, 1, 0, y, 1, 0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 1 -1.41, // 1 @@ -144,14 +144,14 @@ tape( 'the function scales elements from `cx` by `ca` and adds the result to `cy t.end(); }); -tape( 'the function supports a `cx` stride', opts, function test( t ) { +tape( 'the function supports a `x` stride', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, @@ -167,7 +167,7 @@ tape( 'the function supports a `cx` stride', opts, function test( t ) { -0.6, // 4 0.6 // 4 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -183,11 +183,11 @@ tape( 'the function supports a `cx` stride', opts, function test( t ) { 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 2, 0, cy, 1, 0 ); + caxpy( 4, alpha, x, 2, 0, y, 1, 0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 1 -1.41, // 1 @@ -208,14 +208,14 @@ tape( 'the function supports a `cx` stride', opts, function test( t ) { 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 viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, -0.8, -0.4, // 1 @@ -231,7 +231,7 @@ tape( 'the function supports a `cx` offset', opts, function test( t ) { -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -247,11 +247,11 @@ tape( 'the function supports a `cx` offset', opts, function test( t ) { 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 3, ca, cx, 2, 1, cy, 1, 0 ); + caxpy( 3, alpha, x, 2, 1, y, 1, 0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ -0.05, // 1 -0.6, // 1 @@ -272,14 +272,14 @@ tape( 'the function supports a `cx` offset', opts, function test( t ) { t.end(); }); -tape( 'the function supports a `cy` stride', opts, function test( t ) { +tape( 'the function supports a `y` stride', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -295,7 +295,7 @@ tape( 'the function supports a `cy` stride', opts, function test( t ) { -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, @@ -311,11 +311,11 @@ tape( 'the function supports a `cy` stride', opts, function test( t ) { 0.8, // 4 -0.7 // 4 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 1, 0, cy, 2, 0 ); + caxpy( 4, alpha, x, 1, 0, y, 2, 0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 1 -1.41, // 1 @@ -336,14 +336,14 @@ tape( 'the function supports a `cy` stride', opts, function test( t ) { t.end(); }); -tape( 'the function supports a `cy` offset', opts, function test( t ) { +tape( 'the function supports a `y` offset', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -359,7 +359,7 @@ tape( 'the function supports a `cy` offset', opts, function test( t ) { -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, -0.6, -0.9, // 1 @@ -375,11 +375,11 @@ tape( 'the function supports a `cy` offset', opts, function test( t ) { 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 3, ca, cx, 1, 0, cy, 2, 1 ); + caxpy( 3, alpha, x, 1, 0, y, 2, 1 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.6, -0.6, @@ -401,39 +401,39 @@ tape( 'the function supports a `cy` offset', opts, function test( t ) { }); tape( 'the function returns a reference to the output array', opts, function test( t ) { + var alpha; var out; - var ca; - var cx; - var cy; + var x; + var y; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cy = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.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 ] ); + y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - out = caxpy( cx.length, ca, cx, 1, 0, cy, 1, 0 ); + out = caxpy( x.length, alpha, x, 1, 0, y, 1, 0 ); - t.strictEqual( out, cy, 'same reference' ); + t.strictEqual( out, y, 'same reference' ); t.end(); }); -tape( 'if provided `ca` parameter equal to `0`, the function returns the second input array unchanged', opts, function test( t ) { +tape( 'if provided `alpha` parameter equal to `0`, the function returns the second input array unchanged', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - ca = new Complex64( 0.0, 0.0 ); + x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + alpha = new Complex64( 0.0, 0.0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - caxpy( -1, ca, cx, 1, 0, cy, 1, 0 ); + caxpy( -1, alpha, x, 1, 0, y, 1, 0 ); t.deepEqual( viewY, expected, 'returns expected value' ); - caxpy( 0, ca, cx, 1, 0, cy, 1, 0 ); + caxpy( 0, alpha, x, 1, 0, y, 1, 0 ); t.deepEqual( viewY, expected, 'returns expected value' ); t.end(); @@ -442,34 +442,34 @@ tape( 'if provided `ca` parameter equal to `0`, the function returns the second tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the second input array unchanged', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 ] ); + y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + alpha = new Complex64( 2.0, 2.0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); - caxpy( -1, ca, cx, 1, 0, cy, 1, 0 ); + caxpy( -1, alpha, x, 1, 0, y, 1, 0 ); t.deepEqual( viewY, expected, 'returns expected value' ); - caxpy( 0, ca, cx, 1, 0, cy, 1, 0 ); + caxpy( 0, alpha, x, 1, 0, y, 1, 0 ); t.deepEqual( viewY, expected, 'returns expected value' ); t.end(); }); -tape( 'the function supports a negative `cx` stride', opts, function test( t ) { +tape( 'the function supports a negative `x` stride', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 4 -0.8, // 4 -0.4, @@ -485,7 +485,7 @@ tape( 'the function supports a negative `cx` stride', opts, function test( t ) { -0.6, // 1 0.6 // 1 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -501,11 +501,11 @@ tape( 'the function supports a negative `cx` stride', opts, function test( t ) { 0.8, -0.7 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, -2, 6, cy, 1, 0 ); + caxpy( 4, alpha, x, -2, 6, y, 1, 0 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.78, // 1 0.06, // 1 @@ -526,14 +526,14 @@ tape( 'the function supports a negative `cx` stride', opts, function test( t ) { t.end(); }); -tape( 'the function supports a negative `cy` stride', opts, function test( t ) { +tape( 'the function supports a negative `y` stride', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 1 -0.8, // 1 -0.4, @@ -549,7 +549,7 @@ tape( 'the function supports a negative `cy` stride', opts, function test( t ) { -0.6, // 4 0.6 // 4 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 4 -0.6, // 4 -0.9, @@ -565,11 +565,11 @@ tape( 'the function supports a negative `cy` stride', opts, function test( t ) { 0.8, // 1 -0.7 // 1 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, 2, 0, cy, -2, 6 ); + caxpy( 4, alpha, x, 2, 0, y, -2, 6 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.78, // 4 0.06, // 4 @@ -593,11 +593,11 @@ tape( 'the function supports a negative `cy` stride', opts, function test( t ) { tape( 'the function supports complex access patterns', opts, function test( t ) { var expected; var viewY; - var ca; - var cx; - var cy; + var alpha; + var x; + var y; - cx = new Complex64Array([ + x = new Complex64Array([ 0.7, // 4 -0.8, // 4 -0.4, // 3 @@ -613,7 +613,7 @@ tape( 'the function supports complex access patterns', opts, function test( t ) -0.6, 0.6 ]); - cy = new Complex64Array([ + y = new Complex64Array([ 0.6, // 4 -0.6, // 4 -0.9, @@ -629,11 +629,11 @@ tape( 'the function supports complex access patterns', opts, function test( t ) 0.8, // 1 -0.7 // 1 ]); - ca = new Complex64( 0.4, -0.7 ); + alpha = new Complex64( 0.4, -0.7 ); - caxpy( 4, ca, cx, -1, 3, cy, -2, 6 ); + caxpy( 4, alpha, x, -1, 3, y, -2, 6 ); - viewY = new Float32Array( cy.buffer ); + viewY = new Float32Array( y.buffer ); expected = new Float32Array([ 0.32, // 4 -1.41, // 4