From 0538961650558fa4de2def08141e5132ae260862 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 25 May 2025 10:39:51 +0530 Subject: [PATCH 01/44] feat: add C implementation for blas/base/zdscal --- .../blas/base/zdscal/src/zdscal_ndarray.c | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal_ndarray.c diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal_ndarray.c b/lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal_ndarray.c new file mode 100644 index 000000000000..1eaf30d1661e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal_ndarray.c @@ -0,0 +1,47 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/blas/base/zdscal.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/complex/float64/base/scale.h" + +/** +* Scales a double-precision complex floating-point vector by a double-precision floating-point constant using alternative indexing semantics. +* +* @param N number of indexed elements +* @param alpha constant +* @param X input array +* @param strideX X stride length +* @param offsetX starting index for X +*/ +void API_SUFFIX(c_zdscal_ndarray)( const CBLAS_INT N, const double alpha, void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { + double *x = (double *)X; + CBLAS_INT ix; + CBLAS_INT sx; + CBLAS_INT i; + double tmp; + + if ( N <= 0 || alpha == 1.0 ) { + return; + } + sx = strideX * 2; + ix = offsetX * 2; + for ( i = 0; i < N; i++ ) { + } + return; +} From 0dc7cda814df856231eef8323e1689407bb4e77f Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 25 May 2025 23:12:34 +0530 Subject: [PATCH 02/44] chore: add implementation --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/zdscal/README.md | 130 +++++++ .../base/zdscal/benchmark/benchmark.native.js | 113 ++++++ .../benchmark/benchmark.ndarray.native.js | 113 ++++++ .../blas/base/zdscal/benchmark/c/Makefile | 146 ++++++++ .../zdscal/benchmark/c/benchmark.length.c | 192 +++++++++++ .../base/zdscal/benchmark/fortran/Makefile | 141 ++++++++ .../benchmark/fortran/benchmark.length.f | 210 ++++++++++++ .../@stdlib/blas/base/zdscal/binding.gyp | 265 ++++++++++++++ .../blas/base/zdscal/examples/c/Makefile | 146 ++++++++ .../blas/base/zdscal/examples/c/example.c | 48 +++ .../@stdlib/blas/base/zdscal/include.gypi | 70 ++++ .../zdscal/include/stdlib/blas/base/zdscal.h | 49 +++ .../include/stdlib/blas/base/zdscal_cblas.h | 44 +++ .../include/stdlib/blas/base/zdscal_fortran.h | 43 +++ .../@stdlib/blas/base/zdscal/lib/native.js | 35 ++ .../blas/base/zdscal/lib/ndarray.native.js | 57 ++++ .../blas/base/zdscal/lib/zdscal.native.js | 57 ++++ .../@stdlib/blas/base/zdscal/manifest.json | 322 ++++++++++++++++++ .../@stdlib/blas/base/zdscal/package.json | 3 + .../@stdlib/blas/base/zdscal/src/Makefile | 70 ++++ .../@stdlib/blas/base/zdscal/src/addon.c | 65 ++++ .../@stdlib/blas/base/zdscal/src/zdscal.c | 35 ++ .../@stdlib/blas/base/zdscal/src/zdscal.f | 80 +++++ .../blas/base/zdscal/src/zdscal_cblas.c | 50 +++ .../@stdlib/blas/base/zdscal/src/zdscal_f.c | 51 +++ .../blas/base/zdscal/src/zdscal_ndarray.c | 11 +- .../base/zdscal/test/test.ndarray.native.js | 276 +++++++++++++++ .../base/zdscal/test/test.zdscal.native.js | 226 ++++++++++++ 28 files changed, 3043 insertions(+), 5 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/benchmark/benchmark.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/benchmark/benchmark.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/benchmark/c/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/benchmark/fortran/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/benchmark/fortran/benchmark.length.f create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/binding.gyp create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/examples/c/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/examples/c/example.c create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/include.gypi create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal.h create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_cblas.h create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/lib/native.js create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/lib/ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/lib/zdscal.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/manifest.json create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/src/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/src/addon.c create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal.c create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal.f create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal_cblas.c create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal_f.c create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/test/test.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/zdscal/test/test.zdscal.native.js diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/README.md b/lib/node_modules/@stdlib/blas/base/zdscal/README.md index 49d5fc189255..8bc72da40065 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/zdscal/README.md @@ -149,6 +149,136 @@ 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 ) }; // interleaved real and imaginary components + +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 +stdlib_complex128_t x[] = { stdlib_complex128( 1.0, 2.0 ), stdlib_complex128( 3.0, 4.0 ), stdlib_complex128( 5.0, 6.0 ) }; // interleaved real and imaginary components + +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 ] ) ); + } +} +``` + +
+ + + +
+ + + From 6ff7063f66407a562c3ce43c09baef62eaa6e3c9 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:30:28 -0700 Subject: [PATCH 26/44] docs: revert changes Signed-off-by: Athan --- .../@stdlib/blas/base/zdscal/README.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/README.md b/lib/node_modules/@stdlib/blas/base/zdscal/README.md index d7cf099f89db..564e01debe5e 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/zdscal/README.md @@ -199,6 +199,32 @@ The function accepts the following arguments: - **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` scalar constant. +- **X**: `[inout] void*` input array. +- **strideX**: `[in] CBLAS_INT` index increment for `x`. +- **offsetX**: `[in] CBLAS_INT` starting index for `x`. +```c +void c_zdscal_ndarray( const CBLAS_INT N, const double alpha, stdlib_complex128_t *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); void c_zdscal( const CBLAS_INT N, const double alpha, void *X, const CBLAS_INT strideX ); ``` From 85d428e9389fac63bf875f3f9b5ac151c15cdfa0 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:30:57 -0700 Subject: [PATCH 27/44] docs: fix type Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/zdscal/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/README.md b/lib/node_modules/@stdlib/blas/base/zdscal/README.md index 564e01debe5e..5975ae5bbd49 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/zdscal/README.md @@ -199,7 +199,7 @@ The function accepts the following arguments: - **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 ); +void c_zdscal( const CBLAS_INT N, const double alpha, void *X, const CBLAS_INT strideX ); ``` #### c_zdscal_ndarray( N, alpha, \*X, strideX, offsetX ) From 784e08aee180c96795f366a76e8d1279ae640d15 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:31:28 -0700 Subject: [PATCH 28/44] docs: fix signature Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/zdscal/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/README.md b/lib/node_modules/@stdlib/blas/base/zdscal/README.md index 5975ae5bbd49..987d232603e3 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/zdscal/README.md @@ -224,8 +224,7 @@ The function accepts the following arguments: - **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 ); -void c_zdscal( const CBLAS_INT N, const double alpha, void *X, const CBLAS_INT strideX ); +void c_zdscal_ndarray( const CBLAS_INT N, const double alpha, void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); ``` From 553f334f1983d901628b8a738e5b3baedaf803ef Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:32:18 -0700 Subject: [PATCH 29/44] style: fix spacing Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/zdscal/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/README.md b/lib/node_modules/@stdlib/blas/base/zdscal/README.md index 987d232603e3..c3cbe4c0fdc9 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/zdscal/README.md @@ -217,12 +217,14 @@ stdlib_complex128_t x[] = { 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` scalar constant. - **X**: `[inout] void*` input array. - **strideX**: `[in] CBLAS_INT` index increment for `x`. - **offsetX**: `[in] CBLAS_INT` starting index for `x`. + ```c void c_zdscal_ndarray( const CBLAS_INT N, const double alpha, void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); ``` From 736d82017e13a8d01b42ccef741f2ba5624e19be Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:32:41 -0700 Subject: [PATCH 30/44] docs: fix spacing Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/zdscal/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/README.md b/lib/node_modules/@stdlib/blas/base/zdscal/README.md index c3cbe4c0fdc9..3f949efc9b40 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/zdscal/README.md @@ -219,6 +219,7 @@ 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` scalar constant. - **X**: `[inout] void*` input array. From e9d0c829628add5c533808b0a2ca21b8b6cb11fe Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:33:30 -0700 Subject: [PATCH 31/44] docs: remove comment Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/zdscal/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/README.md b/lib/node_modules/@stdlib/blas/base/zdscal/README.md index 3f949efc9b40..2b9cccf39736 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/zdscal/README.md @@ -256,7 +256,6 @@ void c_zdscal_ndarray( const CBLAS_INT N, const double alpha, void *X, const CBL #include int main( void ) { - // Create strided arrays: stdlib_complex128_t x[] = { stdlib_complex128( 1.0, 2.0 ), stdlib_complex128( 3.0, 4.0 ), From 075da311eee26f1617f4855203ffa83242edc4d4 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:33:54 -0700 Subject: [PATCH 32/44] docs: fix comment Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/zdscal/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/README.md b/lib/node_modules/@stdlib/blas/base/zdscal/README.md index 2b9cccf39736..33f3a114dfef 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/README.md +++ b/lib/node_modules/@stdlib/blas/base/zdscal/README.md @@ -266,7 +266,7 @@ int main( void ) { // Specify the number of elements: const int N = 4; - // Specify stride lengths: + // Specify the stride length: const int strideX = 1; c_zdscal( N, 2.0, (void *)x, strideX ); From 9cbecf0d44a95c15adb96388fa407eb0f7ba6b58 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:36:38 -0700 Subject: [PATCH 33/44] bench: add cast Signed-off-by: Athan --- .../@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c index 0494dfdd0407..1f8cca017908 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c @@ -109,7 +109,7 @@ static double benchmark1( int iterations, int len ) { } t = tic(); for ( i = 0; i < iterations; i++ ) { - c_zdscal( len, 2.0, x, 1 ); + c_zdscal( len, 2.0, (void *)x, 1 ); if ( stdlib_base_is_nan( stdlib_complex128_real( x[ i%len ] ) ) ) { printf( "should not return NaN\n" ); break; From 90c0dcd12a8789691c858e6eac8317e3af99e9a7 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:37:13 -0700 Subject: [PATCH 34/44] bench: add cast Signed-off-by: Athan --- .../@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c index 1f8cca017908..e4124b662fb7 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c @@ -140,7 +140,7 @@ static double benchmark2( int iterations, int len ) { } t = tic(); for ( i = 0; i < iterations; i++ ) { - c_zdscal_ndarray( len, 2.0, x, 1, 0 ); + c_zdscal_ndarray( len, 2.0, (void *)x, 1, 0 ); if ( stdlib_base_is_nan( stdlib_complex128_real( x[ i%len ] ) ) ) { printf( "should not return NaN\n" ); break; From 082d52147eb7b53e7dc744937fdf404af65952ed Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:38:24 -0700 Subject: [PATCH 35/44] docs: update comments Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/zdscal/examples/c/example.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/zdscal/examples/c/example.c index ebd10457f2a3..0ddf172fb4a1 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/zdscal/examples/c/example.c @@ -23,7 +23,6 @@ #include int main( void ) { - // Create strided arrays: stdlib_complex128_t x[] = { stdlib_complex128( 1.0, 2.0 ), stdlib_complex128( 3.0, 4.0 ), @@ -34,7 +33,7 @@ int main( void ) { // Specify the number of elements: const int N = 4; - // Specify stride lengths: + // Specify the stride length: const int strideX = 1; c_zdscal( N, 2.0, (void *)x, strideX ); From 967b40b41f81300b342df11497a9f53a619caa97 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:39:47 -0700 Subject: [PATCH 36/44] refactor: update include guards Signed-off-by: Athan --- .../blas/base/zdscal/include/stdlib/blas/base/zdscal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal.h b/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal.h index 80598f26325c..c0c2e20ce271 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal.h +++ b/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal.h @@ -19,8 +19,8 @@ /** * Header file containing function declarations for the C interface to the BLAS Level 1 routine `zdscal`. */ -#ifndef ZDSCAL_H -#define ZDSCAL_H +#ifndef STDLIB_BLAS_BASE_ZDSCAL_H +#define STDLIB_BLAS_BASE_ZDSCAL_H #include "stdlib/blas/base/shared.h" #include "stdlib/complex/float64/ctor.h" @@ -46,4 +46,4 @@ void API_SUFFIX(c_zdscal_ndarray)( const CBLAS_INT N, const double alpha, void * } #endif -#endif // !ZDSCAL_H +#endif // !STDLIB_BLAS_BASE_ZDSCAL_H From 56f9199558d4358c75c442e4d014009fd3cbce5a Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:40:43 -0700 Subject: [PATCH 37/44] refactor: update include guards Signed-off-by: Athan --- .../base/zdscal/include/stdlib/blas/base/zdscal_cblas.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_cblas.h b/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_cblas.h index 8a7ab3118617..30ebf3ba4a94 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_cblas.h @@ -19,8 +19,8 @@ /** * Header file containing function declarations for the C interface to the CBLAS Level 1 routine `cblas_zdscal`. */ -#ifndef ZDSCAL_CBLAS_H -#define ZDSCAL_CBLAS_H +#ifndef STDLIB_BLAS_BASE_ZDSCAL_CBLAS_H +#define STDLIB_BLAS_BASE_ZDSCAL_CBLAS_H #include "stdlib/blas/base/shared.h" #include "stdlib/complex/float64/ctor.h" @@ -41,4 +41,4 @@ void API_SUFFIX(cblas_zdscal)( const CBLAS_INT N, const double alpha, void *X, c } #endif -#endif // !ZDSCAL_CBLAS_H +#endif // !STDLIB_BLAS_BASE_ZDSCAL_CBLAS_H From a4f2ca6158de533fdd566d132719fbce2ab6eb9d Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:41:36 -0700 Subject: [PATCH 38/44] refactor: update include guards and fix include Signed-off-by: Athan --- .../zdscal/include/stdlib/blas/base/zdscal_fortran.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h b/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h index fc9497d7b1bf..1616e9b0f21a 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h +++ b/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h @@ -16,13 +16,13 @@ * limitations under the License. */ -#include "stdlib/complex/float64/ctor.h" - /** * Header file containing function declarations for the Fortran interface to the BLAS Level 1 routine `zdscal`. */ -#ifndef ZDSCAL_FORTRAN_H -#define ZDSCAL_FORTRAN_H +#ifndef STDLIB_BLAS_BASE_ZDSCAL_FORTRAN_H +#define STDLIB_BLAS_BASE_ZDSCAL_FORTRAN_H + +#include "stdlib/complex/float64/ctor.h" /* * If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C/Fortran compiler (a Fortran compiler must be configured to not attach underscores). @@ -40,4 +40,4 @@ void zdscal( const CBLAS_INT *, const double *, stdlib_complex128_t *, const CBL } #endif -#endif // !ZDSCAL_FORTRAN_H +#endif // !STDLIB_BLAS_BASE_ZDSCAL_FORTRAN_H From 06b0a12c4997eb296a99a11207fb7a9385414e03 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:42:23 -0700 Subject: [PATCH 39/44] fix: use correct signature Signed-off-by: Athan --- .../blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h b/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h index 1616e9b0f21a..fa65034a001c 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h +++ b/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h @@ -34,7 +34,7 @@ extern "C" { /** * Scales a double-precision complex floating-point vector by a double-precision floating-point constant. */ -void zdscal( const CBLAS_INT *, const double *, stdlib_complex128_t *, const CBLAS_INT * ); +void zdscal( const int *, const double *, void *, const int * ); #ifdef __cplusplus } From 3cc2649c191c1c4dd7358faf3db32603dfa92242 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:42:45 -0700 Subject: [PATCH 40/44] refactor: remove include Signed-off-by: Athan --- .../blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h b/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h index fa65034a001c..6dea31066b8b 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h +++ b/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_fortran.h @@ -22,8 +22,6 @@ #ifndef STDLIB_BLAS_BASE_ZDSCAL_FORTRAN_H #define STDLIB_BLAS_BASE_ZDSCAL_FORTRAN_H -#include "stdlib/complex/float64/ctor.h" - /* * If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C/Fortran compiler (a Fortran compiler must be configured to not attach underscores). */ From 1a62c94c7e06123ff3ef822f00d9cd1c7854b804 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:43:08 -0700 Subject: [PATCH 41/44] refactor: remove include Signed-off-by: Athan --- .../@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal.h b/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal.h index c0c2e20ce271..0fa04368ab65 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal.h +++ b/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal.h @@ -23,7 +23,6 @@ #define STDLIB_BLAS_BASE_ZDSCAL_H #include "stdlib/blas/base/shared.h" -#include "stdlib/complex/float64/ctor.h" /* * If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. From 8b63622adfcf13366caa49384395c4551a008f2a Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:43:39 -0700 Subject: [PATCH 42/44] refactor: remove include Signed-off-by: Athan --- .../blas/base/zdscal/include/stdlib/blas/base/zdscal_cblas.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_cblas.h b/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_cblas.h index 30ebf3ba4a94..66abc8a4cf2c 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/zdscal/include/stdlib/blas/base/zdscal_cblas.h @@ -23,7 +23,6 @@ #define STDLIB_BLAS_BASE_ZDSCAL_CBLAS_H #include "stdlib/blas/base/shared.h" -#include "stdlib/complex/float64/ctor.h" /* * If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. From 5da223332898b631c120af767396a4620ac2bb8f Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:51:31 -0700 Subject: [PATCH 43/44] style: add spaces Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal.f | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal.f b/lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal.f index 5af46b8bdcb7..8b14bd61e036 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal.f +++ b/lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal.f @@ -68,12 +68,12 @@ subroutine zdscal( N, alpha, x, strideX ) ! .. if ( strideX == 1 ) then do i = 1, N - x( i ) = cmplx(alpha*dble(x(i)),alpha*aimag(x(i)), kind=kind(0.0d0)) + x( i ) = cmplx( alpha*dble(x(i)), alpha*aimag(x(i)), kind=kind(0.0d0) ) end do else nstrideX = N * strideX; do i = 1, nstrideX, strideX - x( i ) = cmplx(alpha*dble(x(i)),alpha*aimag(x(i)), kind=kind(0.0d0)) + x( i ) = cmplx( alpha*dble(x(i)), alpha*aimag(x(i)), kind=kind(0.0d0) ) end do end if return From 03664e125ccba4e4e4d4961c857e85cdb33cf348 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 6 Sep 2025 23:58:05 -0700 Subject: [PATCH 44/44] refactor: remove unnecessary variable Signed-off-by: Athan --- .../@stdlib/blas/base/zdscal/src/zdscal_ndarray.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal_ndarray.c b/lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal_ndarray.c index 7cb4408cbea1..4f873eff4d2c 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/zdscal/src/zdscal_ndarray.c @@ -33,17 +33,15 @@ void API_SUFFIX(c_zdscal_ndarray)( const CBLAS_INT N, const double alpha, void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { stdlib_complex128_t *x = (stdlib_complex128_t *)X; CBLAS_INT ix; - CBLAS_INT sx; CBLAS_INT i; if ( N <= 0 || alpha == 1.0 ) { return; } - sx = strideX; ix = offsetX; for ( i = 0; i < N; i++ ) { x[ ix ] = stdlib_base_complex128_scale( alpha, x[ ix ] ); - ix += sx; + ix += strideX; } return; }