diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/README.md b/lib/node_modules/@stdlib/blas/base/zdscal/README.md index 49d5fc189255..bafcd446aa95 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/zdscal/README.md @@ -149,6 +149,151 @@ console.log( zx.toString() ); + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/blas/base/zdscal.h" +``` + +#### c_zdscal( N, alpha, \*X, strideX ) + +Scales a double-precision complex floating-point vector by a double-precision floating-point constant. + +```c +#include "stdlib/complex/float64/ctor.h" + +stdlib_complex128_t x[] = { + stdlib_complex128( 1.0, 2.0 ), + stdlib_complex128( 3.0, 4.0 ), + stdlib_complex128( 5.0, 6.0 ) +}; + +c_zdscal( 3, 2.0, x, 1 ); +``` + +The function accepts the following arguments: + +- **N**: `[in] CBLAS_INT` number of indexed elements. +- **alpha**: `[in] double` constant. +- **x**: `[inout] stdlib_complex128_t*` input array. +- **strideX**: `[in] CBLAS_INT` index increment for `x`. + +```c +void c_zdscal( const CBLAS_INT N, const double alpha, stdlib_complex128_t *X, const CBLAS_INT strideX ); +``` + +#### c_zdscal_ndarray( N, alpha, \*X, strideX, offsetX ) + +Scales a double-precision complex floating-point vector by a double-precision floating-point constant using alternative indexing semantics. + +```c +#include "stdlib/complex/float64/ctor.h" + +stdlib_complex128_t x[] = { + stdlib_complex128( 1.0, 2.0 ), + stdlib_complex128( 3.0, 4.0 ), + stdlib_complex128( 5.0, 6.0 ) +}; + +c_zdscal_ndarray( 3, 2.0, x, 1, 0 ); +``` + +The function accepts the following arguments: + +- **N**: `[in] CBLAS_INT` number of indexed elements. +- **alpha**: `[in] double` constant. +- **x**: `[inout] void*` input array. +- **strideX**: `[in] CBLAS_INT` index increment for `x`. +- **offsetX**: `[in] CBLAS_INT` starting index for `x`. + +```c +void c_zdscal_ndarray( const CBLAS_INT N, const double alpha, stdlib_complex128_t *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/blas/base/zdscal.h" +#include "stdlib/complex/float64/ctor.h" +#include "stdlib/complex/float64/real.h" +#include "stdlib/complex/float64/imag.h" +#include + +int main( void ) { + // Create strided arrays: + stdlib_complex128_t x[] = { + stdlib_complex128( 1.0, 2.0 ), + stdlib_complex128( 3.0, 4.0 ), + stdlib_complex128( 5.0, 6.0 ), + stdlib_complex128( 7.0, 8.0 ) + }; + + // Specify the number of elements: + const int N = 4; + + // Specify stride lengths: + const int strideX = 1; + + c_zdscal( N, 2.0, (void *)x, strideX ); + + // Print the result: + for ( int i = 0; i < N; i++ ) { + printf( "x[ %i ] = %lf + %lfj\n", i, stdlib_complex128_real( x[ i ] ), stdlib_complex128_imag( x[ i ] ) ); + } + + c_zdscal_ndarray( N, 2.0, (void *)x, strideX, 0 ); + + // Print the result: + for ( int i = 0; i < N; i++ ) { + printf( "x[ %i ] = %lf + %lfj\n", i, stdlib_complex128_real( x[ i ] ), stdlib_complex128_imag( x[ i ] ) ); + } +} +``` + +
+ + + +
+ + +