From c390f0832e059bf80e2305acbb3eaf762db53023 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 04:32:53 +0000 Subject: [PATCH 01/51] feat: add c 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: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/src/Makefile | 70 +++++++ .../@stdlib/blas/base/cgemv/src/addon.c | 125 ++++++++++++ .../@stdlib/blas/base/cgemv/src/cgemv.c | 119 +++++++++++ .../@stdlib/blas/base/cgemv/src/cgemv_cblas.c | 43 ++++ .../blas/base/cgemv/src/cgemv_ndarray.c | 190 ++++++++++++++++++ 5 files changed, 547 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/src/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/src/addon.c create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_cblas.c create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/Makefile b/lib/node_modules/@stdlib/blas/base/cgemv/src/Makefile new file mode 100644 index 000000000000..7733b6180cb4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2025 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. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + + +# RULES # + +#/ +# Removes generated files for building an add-on. +# +# @example +# make clean-addon +#/ +clean-addon: + $(QUIET) -rm -f *.o *.node + +.PHONY: clean-addon + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: clean-addon + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/addon.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/addon.c new file mode 100644 index 000000000000..85fa667e7538 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/addon.c @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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/cgemv.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/napi/export.h" +#include "stdlib/napi/argv.h" +#include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_int32.h" +#include "stdlib/napi/argv_complex64.h" +#include "stdlib/napi/argv_strided_complex64array.h" +#include "stdlib/napi/argv_strided_complex64array2d.h" +#include + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon( napi_env env, napi_callback_info info ) { + CBLAS_INT xlen; + CBLAS_INT ylen; + CBLAS_INT sa1; + CBLAS_INT sa2; + + STDLIB_NAPI_ARGV( env, info, argv, argc, 12 ); + + STDLIB_NAPI_ARGV_INT32( env, layout, argv, 0 ); + STDLIB_NAPI_ARGV_INT32( env, trans, argv, 1 ); + + STDLIB_NAPI_ARGV_INT64( env, M, argv, 2 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 3 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 8 ); + STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 11 ); + STDLIB_NAPI_ARGV_INT64( env, LDA, argv, 6 ); + + STDLIB_NAPI_ARGV_COMPLEX64( env, alpha, argv, 4 ); + STDLIB_NAPI_ARGV_COMPLEX64( env, beta, argv, 9 ); + + if ( trans == CblasNoTrans ) { + xlen = N; + ylen = M; + } else { + xlen = M; + ylen = N; + } + if ( layout == CblasColMajor ) { + sa1 = 1; + sa2 = LDA; + } else { // layout === CblasRowMajor + sa1 = LDA; + sa2 = 1; + } + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, xlen, strideX, argv, 7 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, Y, ylen, strideY, argv, 10 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY2D( env, A, M, N, sa1, sa2, argv, 5 ); + + API_SUFFIX(c_cgemv)( layout, trans, M, N, alpha, A, LDA, X, strideX, beta, Y, strideY ); + + return NULL; +} + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon_method( napi_env env, napi_callback_info info ) { + CBLAS_INT xlen; + CBLAS_INT ylen; + + STDLIB_NAPI_ARGV( env, info, argv, argc, 15 ); + + STDLIB_NAPI_ARGV_INT32( env, trans, argv, 0 ); + + STDLIB_NAPI_ARGV_INT64( env, M, argv, 1 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 2 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 9 ); + STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 10 ); + STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 13 ); + STDLIB_NAPI_ARGV_INT64( env, offsetY, argv, 14 ); + STDLIB_NAPI_ARGV_INT64( env, strideA1, argv, 5 ); + STDLIB_NAPI_ARGV_INT64( env, strideA2, argv, 6 ); + STDLIB_NAPI_ARGV_INT64( env, offsetA, argv, 7 ); + + STDLIB_NAPI_ARGV_COMPLEX64( env, alpha, argv, 3 ); + STDLIB_NAPI_ARGV_COMPLEX64( env, beta, argv, 11 ); + + if ( trans == CblasNoTrans ) { + xlen = N; + ylen = M; + } else { + xlen = M; + ylen = N; + } + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, xlen, strideX, argv, 8 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, Y, ylen, strideY, argv, 12 ); + STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY2D( env, A, M, N, strideA1, strideA2, argv, 4 ); + + API_SUFFIX(c_cgemv_ndarray)( trans, M, N, alpha, A, strideA1, strideA2, offsetA, X, strideX, offsetX, beta, Y, strideY, offsetY ); + + return NULL; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "ndarray", addon_method ) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c new file mode 100644 index 000000000000..b0204fff8984 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c @@ -0,0 +1,119 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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/cgemv.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/blas/base/xerbla.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/strided/base/stride2offset.h" +#include "stdlib/complex/float32/base/assert/is_equal.h" + +/** +* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y`, where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. +* +* @param layout storage layout +* @param trans specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param M number of rows in the matrix `A` +* @param N number of columns in the matrix `A` +* @param alpha scalar constant +* @param A input matrix +* @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param X first input vector +* @param strideX `X` stride length +* @param beta scalar constant +* @param Y second input vector +* @param strideY `Y` stride length +* @return output value +*/ +void API_SUFFIX(c_cgemv)( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t alpha, const void *A, const CBLAS_INT LDA, const void *X, const CBLAS_INT strideX, const stdlib_complex64_t beta, void *Y, const CBLAS_INT strideY ) { + stdlib_complex64_t zero; + stdlib_complex64_t one; + CBLAS_INT vala; + CBLAS_INT xlen; + CBLAS_INT ylen; + CBLAS_INT sa1; + CBLAS_INT sa2; + CBLAS_INT ox; + CBLAS_INT oy; + CBLAS_INT v; + + // Perform input argument validation... + if ( layout != CblasRowMajor && layout != CblasColMajor ) { + c_xerbla( 1, "c_cgemv", "Error: invalid argument. First argument must be a valid storage layout. Value: `%d`.", layout ); + return; + } + if ( trans != CblasTrans && trans != CblasConjTrans && trans != CblasNoTrans ) { + c_xerbla( 2, "c_cgemv", "Error: invalid argument. Second argument must be a valid transpose operation. Value: `%d`.", trans ); + return; + } + if ( M < 0 ) { + c_xerbla( 3, "c_cgemv", "Error: invalid argument. Third argument must be a nonnegative integer. Value: `%d`.", M ); + return; + } + if ( N < 0 ) { + c_xerbla( 4, "c_cgemv", "Error: invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.", N ); + return; + } + if ( strideX == 0 ) { + c_xerbla( 9, "c_cgemv", "Error: invalid argument. Ninth argument must be a nonzero. Value: `%d`.", strideX ); + return; + } + if ( strideY == 0 ) { + c_xerbla( 12, "c_cgemv", "Error: invalid argument. Twelfth argument must be a nonzero. Value: `%d`.", strideY ); + return; + } + if ( layout == CblasColMajor ) { + v = M; + } else { + v = N; + } + // max(1, v) + if ( v < 1 ) { + vala = 1; + } else { + vala = v; + } + if ( LDA < v ) { + c_xerbla( 10, "c_cgemv", "Error: invalid argument. Seventh argument must be greater than or equal to max(1,%d). Value: `%d`.", vala, LDA ); + return; + } + zero = stdlib_complex64( 0.0, 0.0 ); + one = stdlib_complex64( 1.0, 0.0 ); + // Check whether we can avoid computation altogether... + if ( M == 0 || N == 0 || ( stdlib_base_complex64_is_equal( alpha, zero ) && stdlib_base_complex64_is_equal( beta, one ) ) ) { + return; + } + if ( trans == CblasNoTrans ) { + xlen = N; + ylen = M; + } else { + xlen = M; + ylen = N; + } + if ( layout == CblasColMajor ) { + sa1 = 1; + sa2 = LDA; + } else { // layout === CblasRowMajor + sa1 = LDA; + sa2 = 1; + } + ox = stdlib_strided_stride2offset( xlen, strideX ); + oy = stdlib_strided_stride2offset( ylen, strideY ); + API_SUFFIX(c_cgemv_ndarray)( trans, M, N, alpha, A, sa1, sa2, 0, X, strideX, ox, beta, Y, strideY, oy ); + return; +} diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_cblas.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_cblas.c new file mode 100644 index 000000000000..d25e98ce6d88 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_cblas.c @@ -0,0 +1,43 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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/cgemv.h" +#include "stdlib/blas/base/cgemv_cblas.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/blas/base/shared.h" + +/** +* Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. +* +* @param layout storage layout +* @param trans specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param M number of rows in the matrix `A` +* @param N number of columns in the matrix `A` +* @param alpha scalar constant +* @param A input matrix +* @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param x first input vector +* @param strideX `x` stride length +* @param beta scalar constant +* @param y second input vector +* @param strideY `y` stride length +* @return output value +*/ +void API_SUFFIX(c_cgemv)( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t alpha, const void *A, const CBLAS_INT LDA, const void *X, const CBLAS_INT strideX, const stdlib_complex64_t beta, void *Y, const CBLAS_INT strideY ) { + API_SUFFIX(cblas_cgemv)( layout, trans, M, N, alpha, A, LDA, X, strideX, beta, Y, strideY ); +} diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c new file mode 100644 index 000000000000..b227225f3b2c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -0,0 +1,190 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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/dgemv.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/blas/base/xerbla.h" +#include "stdlib/blas/base/cscal.h" +#include "stdlib/blas/ext/base/cfill.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/complex/float32/conj.h" +#include "stdlib/complex/float32/base/mul.h" +#include "stdlib/complex/float32/base/mul_add.h" +#include "stdlib/ndarray/base/assert/is_row_major.h" +#include "stdlib/complex/float32/base/assert/is_equal.h" + +/** +* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y`, using alternative indexing semantics and where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. +* +* @param trans specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param M number of rows in the matrix `A` +* @param N number of columns in the matrix `A` +* @param alpha scalar constant +* @param A input matrix +* @param strideA1 stride of the first dimension of `A` +* @param strideA1 stride of the second dimension of `A` +* @param offsetA starting index for `A` +* @param X first input vector +* @param strideX `X` stride length +* @param offsetX starting index for `X` +* @param beta scalar constant +* @param Y second input vector +* @param strideY `Y` stride length +* @param offsetY starting index for `Y` +* @return output value +*/ +void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t alpha, const void *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const stdlib_complex64_t beta, void *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) { + const stdlib_complex64_t *ap = (stdlib_complex64_t *)A; + const stdlib_complex64_t *xp = (stdlib_complex64_t *)X; + stdlib_complex64_t *yp = (stdlib_complex64_t *)Y; + stdlib_complex64_t aval; + stdlib_complex64_t zero; + stdlib_complex64_t one; + stdlib_complex64_t tmp; + int64_t sa[ 2 ]; + CBLAS_INT isrm; + CBLAS_INT xlen; + CBLAS_INT ylen; + CBLAS_INT da0; + CBLAS_INT da1; + CBLAS_INT ix; + CBLAS_INT iy; + CBLAS_INT ia; + CBLAS_INT i0; + CBLAS_INT i1; + + // Note on variable naming convention: da#, i# where # corresponds to the loop number, with `0` being the innermost loop... + + // Perform input argument validation... + if ( trans != CblasTrans && trans != CblasConjTrans && trans != CblasNoTrans ) { + c_xerbla( 1, "c_cgemv_ndarray", "Error: invalid argument. First argument must be a valid transpose operation. Value: `%d`.", trans ); + return; + } + if ( M < 0 ) { + c_xerbla( 2, "c_cgemv_ndarray", "Error: invalid argument. Second argument must be a nonnegative integer. Value: `%d`.", M ); + return; + } + if ( N < 0 ) { + c_xerbla( 3, "c_cgemv_ndarray", "Error: invalid argument. Third argument must be a nonnegative integer. Value: `%d`.", N ); + return; + } + if ( strideX == 0 ) { + c_xerbla( 10, "c_cgemv_ndarray", "Error: invalid argument. Tenth argument must be a nonzero. Value: `%d`.", strideX ); + return; + } + if ( strideY == 0 ) { + c_xerbla( 14, "c_cgemv_ndarray", "Error: invalid argument. Fourteenth argument must be a nonzero. Value: `%d`.", strideY ); + return; + } + zero = stdlib_complex64( 0.0, 0.0 ); + one = stdlib_complex64( 1.0, 0.0 ); + // Check whether we can avoid computation altogether... + if ( M == 0 || N == 0 || ( stdlib_base_complex64_is_equal( alpha, zero ) && stdlib_base_complex64_is_equal( beta, one ) ) ) { + return; + } + // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... + sa[ 0 ] = strideA1; + sa[ 1 ] = strideA2; + isrm = stdlib_ndarray_is_row_major( 2, sa ); + if ( trans == CblasNoTrans ) { + xlen = N; + ylen = M; + } else { + xlen = M; + ylen = N; + } + // Y = beta * Y + if ( stdlib_base_complex64_is_equal( beta, zero ) ) { + API_SUFFIX(stdlib_strided_cfill_ndarray)( ylen, alpha, Y, strideY, offsetY ); + } else if ( !stdlib_base_complex64_is_equal( beta, one ) ) { + API_SUFFIX(c_cscal_ndarray)( ylen, beta, Y, strideY, offsetY ); + } + if ( stdlib_base_complex64_is_equal( alpha, zero ) ) { + return; + } + // Form: Y = α*A*X + Y + if ( + ( !isrm && trans == CblasNoTrans ) || + ( isrm && trans != CblasNoTrans ) + ) { + if ( isrm ) { + // For row-major matrices, the last dimension has the fastest changing index... + da0 = strideA2; // offset increment for innermost loop + da1 = strideA1 - ( ylen*strideA2 ); // offset increment for outermost loop + } else { // isColMajor + // For column-major matrices, the first dimension has the fastest changing index... + da0 = strideA1; // offset increment for innermost loop + da1 = strideA2 - ( ylen*strideA1 ); // offset increment for outermost loop + } + ia = offsetA; + ix = offsetX; + for ( i1 = 0; i1 < xlen; i1++ ) { + tmp = stdlib_base_complex64_mul( alpha, xp[ ix ] ); + if ( stdlib_base_complex64_is_equal( tmp, zero )) { + ia += da0 * ylen; + } else { + iy = offsetY; + for ( i0 = 0; i0 < ylen; i0++ ) { + if ( trans == CblasConjTrans ) { + aval = stdlib_complex64_conj( ap[ ia ] ); + } else { + aval = ap[ ia ]; + } + yp[ iy ] = stdlib_base_complex64_muladd( aval, tmp, yp[ iy ] ); + iy += strideY; + ia += da0; + } + } + ix += strideX; + ia += da1; + } + return; + } + // Form: Y = α*A^T*X + Y + + // ( !isrm && trans !== CblasNoTrans ) || ( isrm && trans === CblasNoTrans ) + if ( isrm ) { + // For row-major matrices, the last dimension has the fastest changing index... + da0 = strideA2; // offset increment for innermost loop + da1 = strideA1 - ( xlen*strideA2 ); // offset increment for outermost loop + } else { // isColMajor + // For column-major matrices, the first dimension has the fastest changing index... + da0 = strideA1; // offset increment for innermost loop + da1 = strideA2 - ( xlen*strideA1 ); // offset increment for outermost loop + } + ia = offsetA; + iy = offsetY; + for ( i1 = 0; i1 < ylen; i1++ ) { + tmp = zero; + ix = offsetX; + for ( i0 = 0; i0 < ylen; i0++ ) { + if ( trans == CblasConjTrans ) { + aval = stdlib_complex64_conj( ap[ ia ] ); + } else { + aval = ap[ ia ]; + } + tmp = stdlib_base_complex64_muladd( aval, xp[ ix ], tmp ); + iy += strideY; + ia += da0; + } + yp[ iy ] = stdlib_base_complex64_muladd( alpha, tmp, yp[ iy ] ); + iy += strideY; + ia += da1; + } + return; +} From f0b231b6354baa665c17812863f5840d4b207267 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 04:46:36 +0000 Subject: [PATCH 02/51] feat: add headers --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/binding.gyp | 265 ++++++++++++++++++ .../@stdlib/blas/base/cgemv/include.gypi | 70 +++++ .../cgemv/include/stdlib/blas/base/cgemv.h | 48 ++++ .../include/stdlib/blas/base/cgemv_cblas.h | 48 ++++ .../@stdlib/blas/base/cgemv/package.json | 3 + .../@stdlib/blas/base/cgemv/src/Makefile | 2 +- 6 files changed, 435 insertions(+), 1 deletion(-) create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/binding.gyp create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/include.gypi create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/binding.gyp b/lib/node_modules/@stdlib/blas/base/cgemv/binding.gyp new file mode 100644 index 000000000000..60dce9d0b31a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/binding.gyp @@ -0,0 +1,265 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 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. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Fortran compiler (to override -Dfortran_compiler=): + 'fortran_compiler%': 'gfortran', + + # Fortran compiler flags: + 'fflags': [ + # Specify the Fortran standard to which a program is expected to conform: + '-std=f95', + + # Indicate that the layout is free-form source code: + '-ffree-form', + + # Aggressive optimization: + '-O3', + + # Enable commonly used warning options: + '-Wall', + + # Warn if source code contains problematic language features: + '-Wextra', + + # Warn if a procedure is called without an explicit interface: + '-Wimplicit-interface', + + # Do not transform names of entities specified in Fortran source files by appending underscores (i.e., don't mangle names, thus allowing easier usage in C wrappers): + '-fno-underscoring', + + # Warn if source code contains Fortran 95 extensions and C-language constructs: + '-pedantic', + + # Compile but do not link (output is an object file): + '-c', + ], + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + + # Define custom build actions for particular inputs: + 'rules': [ + { + # Define a rule for processing Fortran files: + 'extension': 'f', + + # Define the pathnames to be used as inputs when performing processing: + 'inputs': [ + # Full path of the current input: + '<(RULE_INPUT_PATH)' + ], + + # Define the outputs produced during processing: + 'outputs': [ + # Store an output object file in a directory for placing intermediate results (only accessible within a single target): + '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).<(obj)' + ], + + # Define the rule for compiling Fortran based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + + # Rule to compile Fortran on Windows: + { + 'rule_name': 'compile_fortran_windows', + 'message': 'Compiling Fortran file <(RULE_INPUT_PATH) on Windows...', + + 'process_outputs_as_sources': 0, + + # Define the command-line invocation: + 'action': [ + '<(fortran_compiler)', + '<@(fflags)', + '<@(_inputs)', + '-o', + '<@(_outputs)', + ], + }, + + # Rule to compile Fortran on non-Windows: + { + 'rule_name': 'compile_fortran_linux', + 'message': 'Compiling Fortran file <(RULE_INPUT_PATH) on Linux...', + + 'process_outputs_as_sources': 1, + + # Define the command-line invocation: + 'action': [ + '<(fortran_compiler)', + '<@(fflags)', + '-fPIC', # generate platform-independent code + '<@(_inputs)', + '-o', + '<@(_outputs)', + ], + } + ], # end condition (OS=="win") + ], # end conditions + }, # end rule (extension=="f") + ], # end rules + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/include.gypi b/lib/node_modules/@stdlib/blas/base/cgemv/include.gypi new file mode 100644 index 000000000000..dcb556d250e8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/include.gypi @@ -0,0 +1,70 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 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. + +# A GYP include file for building a Node.js native add-on. +# +# Note that nesting variables is required due to how GYP processes a configuration. Any variables defined within a nested 'variables' section is defined in the outer scope. Thus, conditions in the outer variable scope are free to use these variables without running into "variable undefined" errors. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +# +# Variable nesting hacks: +# +# [3]: https://chromium.googlesource.com/external/skia/gyp/+/master/common_variables.gypi +# [4]: https://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?revision=127004 +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + 'variables': { + # Host BLAS library (to override -Dblas=): + 'blas%': '', + + # Path to BLAS library (to override -Dblas_dir=): + 'blas_dir%': '', + }, # end variables + + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + '<@(blas_dir)', + ' Date: Thu, 23 Apr 2026 06:49:32 +0000 Subject: [PATCH 03/51] docs: add c exmaple --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/cgemv/examples/c/Makefile | 146 ++++++++++++++++++ .../blas/base/cgemv/examples/c/exmaple.c | 59 +++++++ .../cgemv/include/stdlib/blas/base/cgemv.h | 1 + .../include/stdlib/blas/base/cgemv_cblas.h | 1 + 4 files changed, 207 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/examples/c/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/examples/c/exmaple.c diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/examples/c/Makefile b/lib/node_modules/@stdlib/blas/base/cgemv/examples/c/Makefile new file mode 100644 index 000000000000..c8f8e9a1517b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 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. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := example.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled examples. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/examples/c/exmaple.c b/lib/node_modules/@stdlib/blas/base/cgemv/examples/c/exmaple.c new file mode 100644 index 000000000000..1991193b3d15 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/examples/c/exmaple.c @@ -0,0 +1,59 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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/cgemv.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/complex/float32/ctor.h" +#include + +int main( void ) { + // Define a 3x3 matrix stored in row-major order: + const float A[ 3*3 ] = { + 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, + 4.0f, 4.0f, 5.0f, 5.0f, 6.0f, 6.0f, + 7.0f, 7.0f, 8.0f, 8.0f, 9.0f, 9.0f + }; + + // Define `x` and `y` vectors: + const float x[ 3 ] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f }; + float y[ 3 ] = { 3.0f, 3.0f, 2.0f, 2.0f, 1.0f, 1.0f }; + + // Create complex scalars: + const stdlib_complex64_t alpha = stdlib_complex64( 0.5f, 0.5f ); + const stdlib_complex64_t beta = stdlib_complex64( 0.5f, -0.5f ); + + // Specify the number of elements along each dimension of `A`: + const int M = 3; + const int N = 3; + + // Perform the matrix-vector operation `y = α*A*x + β*y`: + c_cgemv( CblasRowMajor, CblasNoTrans, M, N, alpha, (void *)A, M, (void *)x, 1, beta, (void *)y, 1 ); + + // Print the result: + for ( int i = 0; i < N; i++ ) { + printf( "y[ %i ] = %f + %fj\n", i, y[ i*2 ], y[ (i*2)+1 ] ); + } + + // Perform the matrix-vector operation `y = α*A*x + β*y` using alternative indexing semantics: + c_cgemv_ndarray( CblasNoTrans, M, N, alpha, (void *)A, N, 1, 0, (void *)x, 1, 0, beta, (void *)y, 1, 0 ); + + // Print the result: + for ( int i = 0; i < N; i++ ) { + printf( "y[ %i ] = %f + %fj\n", i, y[ i*2 ], y[ (i*2)+1 ] ); + } +} diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h index d710b3c7e6ab..6ae711a482e6 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h +++ b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h @@ -23,6 +23,7 @@ #define CGEMV_H #include "stdlib/blas/base/shared.h" +#include "stdlib/complex/float32/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. diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h index 8499217a4c1e..151b7a0ed05a 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h @@ -23,6 +23,7 @@ #define CGEMV_CBLAS_H #include "stdlib/blas/base/shared.h" +#include "stdlib/complex/float32/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 0f6c632f88b182761951074a5178b7637a1be734 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 06:50:02 +0000 Subject: [PATCH 04/51] bench: add c benchmark --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/cgemv/benchmark/c/Makefile | 146 ++++++++++++ .../base/cgemv/benchmark/c/benchmark.length.c | 216 ++++++++++++++++++ 2 files changed, 362 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/Makefile new file mode 100644 index 000000000000..0756dc7da20a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 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. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := benchmark.length.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c new file mode 100644 index 000000000000..bc36f2557cb4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c @@ -0,0 +1,216 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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/cgemv.h" +#include +#include +#include +#include +#include +#include "stdlib/complex/float32/ctor.h" + +#define NAME "cgemv" +#define ITERATIONS 10000000 +#define REPEATS 3 +#define MIN 1 +#define MAX 6 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param iterations number of iterations +* @param elapsed elapsed time in seconds +*/ +static void print_results( int iterations, double elapsed ) { + double rate = (double)iterations / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", iterations ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [0,1). +* +* @return random number +*/ +static float rand_float( void ) { + int r = rand(); + return (float)r / ( (float)RAND_MAX + 1.0f ); +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param N array dimension size +* @return elapsed time in seconds +*/ +static double benchmark1( int iterations, int N ) { + stdlib_complex64_t alpha; + stdlib_complex64_t beta; + double elapsed; + float A[ N*N ]; + float x[ N ]; + float y[ N ]; + double t; + int i; + int j; + + alpha = stdlib_complex64( 0.5f, 0.5f ); + beta = stdlib_complex64( 0.5f, -0.5f ); + + for ( i = 0, j = 0; i < N; i++, j += 2 ) { + 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; + A[ j ] = ( rand_float()*2.0f ) - 1.0f; + A[ j+1 ] = ( rand_float()*2.0f ) - 1.0f; + } + t = tic(); + for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar + c_cgemv( CblasRowMajor, CblasNoTrans, N, N, alpha, (void *)A, N, (void *)x, 1, beta, (void *)y, 1 ); + if ( y[ i%N ] != y[ i%N ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( y[ i%N ] != y[ i%N ] ) { + printf( "should not return NaN\n" ); + } + return elapsed; +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param N array dimension size +* @return elapsed time in seconds +*/ +static double benchmark2( int iterations, int N ) { + stdlib_complex64_t alpha; + stdlib_complex64_t beta; + double elapsed; + float A[ N*N ]; + float x[ N ]; + float y[ N ]; + double t; + int i; + int j; + + alpha = stdlib_complex64( 0.5f, 0.5f ); + beta = stdlib_complex64( 0.5f, -0.5f ); + + for ( i = 0, j = 0; i < N; i++, j += 2 ) { + 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; + A[ j ] = ( rand_float()*2.0f ) - 1.0f; + A[ j+1 ] = ( rand_float()*2.0f ) - 1.0f; + } + t = tic(); + for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar + c_cgemv_ndarray( CblasNoTrans, N, N, alpha, (void *)A, N, 1, 0, (void *)x, 1, 0, beta, (void *)y, 1, 0 ); + if ( y[ i%N ] != y[ i%N ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( y[ i%N ] != y[ i%N ] ){ + printf( "should not return NaN\n" ); + } + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int count; + int iter; + int N; + int i; + int j; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + count = 0; + for ( i = MIN; i <= MAX; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + iter = ITERATIONS / pow( 10, i-1 ); + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:size=%d\n", NAME, N*N ); + elapsed = benchmark1( iter, N ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:ndarray:size=%d\n", NAME, N*N ); + elapsed = benchmark2( iter, N ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + } + print_summary( count, count ); +} From b9159f700474800b1a1d4665d889971cecf532e1 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 06:50:33 +0000 Subject: [PATCH 05/51] chore: add c manifest.json --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/manifest.json | 541 ++++++++++++++++++ 1 file changed, 541 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/manifest.json diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json b/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json new file mode 100644 index 000000000000..8ed6bebadbae --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json @@ -0,0 +1,541 @@ +{ + "options": { + "task": "build", + "os": "linux", + "blas": "", + "wasm": false + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "os": "linux", + "blas": "", + "wasm": false, + "src": [ + "./src/cgemv.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv_complex64.h", + "@stdlib/napi/argv_strided_complex64array.h", + "@stdlib/napi/argv_strided_complex64array2d.h" + ] + }, + { + "task": "benchmark", + "os": "linux", + "blas": "", + "wasm": false, + "src": [ + "./src/cgemv.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + { + "task": "examples", + "os": "linux", + "blas": "", + "wasm": false, + "src": [ + "./src/cgemv.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + + { + "task": "build", + "os": "linux", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/cgemv_cblas.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv_complex64.h", + "@stdlib/napi/argv_strided_complex64array.h", + "@stdlib/napi/argv_strided_complex64array2d.h" + ] + }, + { + "task": "benchmark", + "os": "linux", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/cgemv_cblas.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + { + "task": "examples", + "os": "linux", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/cgemv_cblas.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + + { + "task": "build", + "os": "mac", + "blas": "", + "wasm": false, + "src": [ + "./src/cgemv.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv_complex64.h", + "@stdlib/napi/argv_strided_complex64array.h", + "@stdlib/napi/argv_strided_complex64array2d.h" + ] + }, + { + "task": "benchmark", + "os": "mac", + "blas": "", + "wasm": false, + "src": [ + "./src/cgemv.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + { + "task": "examples", + "os": "mac", + "blas": "", + "wasm": false, + "src": [ + "./src/cgemv.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + + { + "task": "build", + "os": "mac", + "blas": "apple_accelerate_framework", + "wasm": false, + "src": [ + "./src/cgemv_cblas.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lblas" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv_complex64.h", + "@stdlib/napi/argv_strided_complex64array.h", + "@stdlib/napi/argv_strided_complex64array2d.h" + ] + }, + { + "task": "benchmark", + "os": "mac", + "blas": "apple_accelerate_framework", + "wasm": false, + "src": [ + "./src/cgemv_cblas.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lblas" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + { + "task": "examples", + "os": "mac", + "blas": "apple_accelerate_framework", + "wasm": false, + "src": [ + "./src/cgemv_cblas.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lblas" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + + { + "task": "build", + "os": "mac", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/cgemv_cblas.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv_complex64.h", + "@stdlib/napi/argv_strided_complex64array.h", + "@stdlib/napi/argv_strided_complex64array2d.h" + ] + }, + { + "task": "benchmark", + "os": "mac", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/cgemv_cblas.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + { + "task": "examples", + "os": "mac", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/cgemv_cblas.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + + { + "task": "build", + "os": "win", + "blas": "", + "wasm": false, + "src": [ + "./src/cgemv.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv_complex64.h", + "@stdlib/napi/argv_strided_complex64array.h", + "@stdlib/napi/argv_strided_complex64array2d.h" + ] + }, + { + "task": "benchmark", + "os": "win", + "blas": "", + "wasm": false, + "src": [ + "./src/cgemv.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + { + "task": "examples", + "os": "win", + "blas": "", + "wasm": false, + "src": [ + "./src/cgemv.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + + { + "task": "build", + "os": "", + "blas": "", + "wasm": true, + "src": [ + "./src/cgemv.c", + "./src/cgemv_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/blas/base/cscal", + "@stdlib/blas/ext/base/cfill", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + } + ] +} From a39cf6908a7b02109bed0bd0e8418a67d41fcbdb Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 07:19:41 +0000 Subject: [PATCH 06/51] fix: adds dependency in manifest.json --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/manifest.json | 112 +++++++++++++++--- .../blas/base/cgemv/src/cgemv_ndarray.c | 2 +- 2 files changed, 95 insertions(+), 19 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json b/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json index 8ed6bebadbae..4955858512bd 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json +++ b/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json @@ -47,15 +47,19 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", "@stdlib/napi/argv-int32", - "@stdlib/napi/argv_complex64.h", - "@stdlib/napi/argv_strided_complex64array.h", - "@stdlib/napi/argv_strided_complex64array2d.h" + "@stdlib/napi/argv-complex64", + "@stdlib/napi/argv-strided-complex64array", + "@stdlib/napi/argv-strided-complex64array2d" ] }, { @@ -77,6 +81,10 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -100,6 +108,10 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -127,15 +139,19 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", "@stdlib/napi/argv-int32", - "@stdlib/napi/argv_complex64.h", - "@stdlib/napi/argv_strided_complex64array.h", - "@stdlib/napi/argv_strided_complex64array2d.h" + "@stdlib/napi/argv-complex64", + "@stdlib/napi/argv-strided-complex64array", + "@stdlib/napi/argv-strided-complex64array2d" ] }, { @@ -160,6 +176,10 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -186,6 +206,10 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -210,15 +234,19 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", "@stdlib/napi/argv-int32", - "@stdlib/napi/argv_complex64.h", - "@stdlib/napi/argv_strided_complex64array.h", - "@stdlib/napi/argv_strided_complex64array2d.h" + "@stdlib/napi/argv-complex64", + "@stdlib/napi/argv-strided-complex64array", + "@stdlib/napi/argv-strided-complex64array2d" ] }, { @@ -240,6 +268,10 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -263,6 +295,10 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -289,15 +325,19 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", "@stdlib/napi/argv-int32", - "@stdlib/napi/argv_complex64.h", - "@stdlib/napi/argv_strided_complex64array.h", - "@stdlib/napi/argv_strided_complex64array2d.h" + "@stdlib/napi/argv-complex64", + "@stdlib/napi/argv-strided-complex64array", + "@stdlib/napi/argv-strided-complex64array2d" ] }, { @@ -321,6 +361,10 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -346,6 +390,10 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -373,15 +421,19 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", "@stdlib/napi/argv-int32", - "@stdlib/napi/argv_complex64.h", - "@stdlib/napi/argv_strided_complex64array.h", - "@stdlib/napi/argv_strided_complex64array2d.h" + "@stdlib/napi/argv-complex64", + "@stdlib/napi/argv-strided-complex64array", + "@stdlib/napi/argv-strided-complex64array2d" ] }, { @@ -406,6 +458,10 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -432,6 +488,10 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -456,15 +516,19 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", "@stdlib/napi/argv-int32", - "@stdlib/napi/argv_complex64.h", - "@stdlib/napi/argv_strided_complex64array.h", - "@stdlib/napi/argv_strided_complex64array2d.h" + "@stdlib/napi/argv-complex64", + "@stdlib/napi/argv-strided-complex64array", + "@stdlib/napi/argv-strided-complex64array2d" ] }, { @@ -486,6 +550,10 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -509,6 +577,10 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -533,6 +605,10 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/base/assert/is-equal", + "@stdlib/complex/float32/conj", + "@stdlib/complex/float32/base/mul", + "@stdlib/complex/float32/base/mul-add", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c index b227225f3b2c..5bcdf64d6701 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -16,7 +16,7 @@ * limitations under the License. */ -#include "stdlib/blas/base/dgemv.h" +#include "stdlib/blas/base/cgemv.h" #include "stdlib/blas/base/shared.h" #include "stdlib/blas/base/xerbla.h" #include "stdlib/blas/base/cscal.h" From 65a0402bc2b11cd649a092e6d974b2f15e04c2fc Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 07:21:49 +0000 Subject: [PATCH 07/51] fix: fixs file name --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/examples/c/{exmaple.c => example.c} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/node_modules/@stdlib/blas/base/cgemv/examples/c/{exmaple.c => example.c} (100%) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/examples/c/exmaple.c b/lib/node_modules/@stdlib/blas/base/cgemv/examples/c/example.c similarity index 100% rename from lib/node_modules/@stdlib/blas/base/cgemv/examples/c/exmaple.c rename to lib/node_modules/@stdlib/blas/base/cgemv/examples/c/example.c From 338de8c86dfe8378ec55dafce65324c13ba6892e Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 07:23:47 +0000 Subject: [PATCH 08/51] fix: fixs array size --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/examples/c/example.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/cgemv/examples/c/example.c index 1991193b3d15..838413430a4a 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/examples/c/example.c @@ -23,15 +23,15 @@ int main( void ) { // Define a 3x3 matrix stored in row-major order: - const float A[ 3*3 ] = { + const float A[ 3*3*2 ] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, 4.0f, 4.0f, 5.0f, 5.0f, 6.0f, 6.0f, 7.0f, 7.0f, 8.0f, 8.0f, 9.0f, 9.0f }; // Define `x` and `y` vectors: - const float x[ 3 ] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f }; - float y[ 3 ] = { 3.0f, 3.0f, 2.0f, 2.0f, 1.0f, 1.0f }; + const float x[ 3*2 ] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f }; + float y[ 3*2 ] = { 3.0f, 3.0f, 2.0f, 2.0f, 1.0f, 1.0f }; // Create complex scalars: const stdlib_complex64_t alpha = stdlib_complex64( 0.5f, 0.5f ); From 7fd18c2a33374ff146bc610937056d6be26a5aad Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 08:54:49 +0000 Subject: [PATCH 09/51] fix: fixs array size --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c index bc36f2557cb4..dec9db676717 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c @@ -99,9 +99,9 @@ static double benchmark1( int iterations, int N ) { stdlib_complex64_t alpha; stdlib_complex64_t beta; double elapsed; - float A[ N*N ]; - float x[ N ]; - float y[ N ]; + float A[ N*N*2 ]; + float x[ N*2 ]; + float y[ N*2 ]; double t; int i; int j; From 801f26fa89a4fa5492565e28413f253318fac10f Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 09:07:09 +0000 Subject: [PATCH 10/51] fix: fixs array size --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c index dec9db676717..55447e808f87 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c @@ -144,9 +144,9 @@ static double benchmark2( int iterations, int N ) { stdlib_complex64_t alpha; stdlib_complex64_t beta; double elapsed; - float A[ N*N ]; - float x[ N ]; - float y[ N ]; + float A[ N*N*2 ]; + float x[ N*2 ]; + float y[ N*2 ]; double t; int i; int j; From 0d522f0c20d9a7b914c5cacf8fae638274e8bba4 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 09:11:36 +0000 Subject: [PATCH 11/51] fix: fixs dependency --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/manifest.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json b/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json index 4955858512bd..1e735c174c58 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json +++ b/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json @@ -47,6 +47,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -81,6 +82,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -108,6 +110,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -139,6 +142,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -176,6 +180,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -206,6 +211,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -234,6 +240,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -268,6 +275,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -295,6 +303,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -325,6 +334,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -361,6 +371,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -390,6 +401,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -421,6 +433,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -458,6 +471,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -488,6 +502,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -516,6 +531,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -550,6 +566,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -577,6 +594,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -605,6 +623,7 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", + "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", From 2f0743dad622b1ab91437586dfb68a4165a21de1 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 09:47:57 +0000 Subject: [PATCH 12/51] chore: remve unsed dpendencyo --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/cgemv/benchmark/c/Makefile | 2 +- .../base/cgemv/benchmark/c/benchmark.length.c | 6 +++--- .../@stdlib/blas/base/cgemv/manifest.json | 19 ------------------- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/Makefile index 0756dc7da20a..9f97140e7cb0 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/Makefile +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/Makefile @@ -1,7 +1,7 @@ #/ # @license Apache-2.0 # -# Copyright (c) 2026 The Stdlib Authors. +# 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. diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c index 55447e808f87..dec9db676717 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c @@ -144,9 +144,9 @@ static double benchmark2( int iterations, int N ) { stdlib_complex64_t alpha; stdlib_complex64_t beta; double elapsed; - float A[ N*N*2 ]; - float x[ N*2 ]; - float y[ N*2 ]; + float A[ N*N ]; + float x[ N ]; + float y[ N ]; double t; int i; int j; diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json b/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json index 1e735c174c58..4955858512bd 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json +++ b/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json @@ -47,7 +47,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -82,7 +81,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -110,7 +108,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -142,7 +139,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -180,7 +176,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -211,7 +206,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -240,7 +234,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -275,7 +268,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -303,7 +295,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -334,7 +325,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -371,7 +361,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -401,7 +390,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -433,7 +421,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -471,7 +458,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -502,7 +488,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -531,7 +516,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -566,7 +550,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -594,7 +577,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", @@ -623,7 +605,6 @@ "@stdlib/blas/base/xerbla", "@stdlib/blas/base/cscal", "@stdlib/blas/ext/base/cfill", - "@stdlib/complex/float32/ctor", "@stdlib/complex/float32/base/assert/is-equal", "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", From 42d84a870d6610923b215a4880ac3b61c17a302c Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 09:53:48 +0000 Subject: [PATCH 13/51] chore: update copy right year --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/benchmark/c/Makefile | 2 +- .../@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/Makefile index 9f97140e7cb0..0756dc7da20a 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/Makefile +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/Makefile @@ -1,7 +1,7 @@ #/ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c index dec9db676717..55447e808f87 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c @@ -144,9 +144,9 @@ static double benchmark2( int iterations, int N ) { stdlib_complex64_t alpha; stdlib_complex64_t beta; double elapsed; - float A[ N*N ]; - float x[ N ]; - float y[ N ]; + float A[ N*N*2 ]; + float x[ N*2 ]; + float y[ N*2 ]; double t; int i; int j; From 3bf074f14de8ba59942058b19f6695a5a5bc9c44 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 11:43:12 +0000 Subject: [PATCH 14/51] feat: add jas warppers for native bindings --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/cgemv/lib/cgemv.native.js | 119 ++++++++++++++++++ .../@stdlib/blas/base/cgemv/lib/native.js | 35 ++++++ .../blas/base/cgemv/lib/ndarray.native.js | 104 +++++++++++++++ 3 files changed, 258 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/lib/cgemv.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/lib/native.js create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/lib/ndarray.native.js diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/lib/cgemv.native.js b/lib/node_modules/@stdlib/blas/base/cgemv/lib/cgemv.native.js new file mode 100644 index 000000000000..6349f0eddbd9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/lib/cgemv.native.js @@ -0,0 +1,119 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +// MODULES // + +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isMatrixTranspose = require( '@stdlib/blas/base/assert/is-transpose-operation' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var max = require( '@stdlib/math/base/special/fast/max' ); +var resolveOrder = require( '@stdlib/blas/base/layout-resolve-enum' ); +var resolveTrans = require( '@stdlib/blas/base/transpose-operation-resolve-enum' ); +var format = require( '@stdlib/string/format' ); +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. +* +* @param {string} order - storage layout +* @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {NonNegativeInteger} M - number of rows in the matrix `A` +* @param {NonNegativeInteger} N - number of columns in the matrix `A` +* @param {number} alpha - scalar constant +* @param {Complex64Array} A - input matrix +* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Complex64Array} x - first input vector +* @param {integer} strideX - `x` stride length +* @param {number} beta - scalar constant +* @param {Complex64Array} y - second input vector +* @param {integer} strideY - `y` stride length +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must be a valid transpose operation +* @throws {RangeError} third argument must be a nonnegative integer +* @throws {RangeError} fourth argument must be a nonnegative integer +* @throws {RangeError} seventh argument must be a valid stride +* @throws {RangeError} ninth argument must be non-zero +* @throws {RangeError} twelfth argument must be non-zero +* @returns {Complex64Array} `y` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var A = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0 ] ); +* var y = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* cgemv( 'column-major', 'no-transpose', 4, 2, alpha, A, 4, x, 1, beta, y, 1 ); +* // y => [ -10.0, 11.0, -12.0, 14.0, -14.0, 17.0, -16.0, 20.0 ] +*/ +function cgemv( order, trans, M, N, alpha, A, LDA, x, strideX, beta, y, strideY ) { // eslint-disable-line max-params, max-len + var viewA; + var viewX; + var viewY; + var vala; + + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( !isMatrixTranspose( trans ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be a valid transpose operation. Value: `%s`.', trans ) ); + } + if ( M < 0 ) { + throw new RangeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%d`.', M ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( strideX === 0 ) { + throw new RangeError( format( 'invalid argument. Ninth argument must be non-zero. Value: `%d`.', strideX ) ); + } + if ( strideY === 0 ) { + throw new RangeError( format( 'invalid argument. Twelfth argument must be non-zero. Value: `%d`.', strideY ) ); + } + if ( isColumnMajor( order ) ) { + vala = M; + } else { + vala = N; + } + if ( LDA < max( 1, vala ) ) { + throw new RangeError( format( 'invalid argument. Seventh argument must be greater than or equal to max(1,%d). Value: `%d`.', vala, LDA ) ); + } + // Check if we can early return... + if ( M === 0 || N === 0 ) { + return y; + } + viewA = reinterpret( A, 0 ); + viewX = reinterpret( x, 0 ); + viewY = reinterpret( y, 0 ); + addon( resolveOrder( order ), resolveTrans( trans ), M, N, alpha, viewA, LDA, viewX, strideX, beta, viewY, strideY ); // eslint-disable-line max-len + return y; +} + + +// EXPORTS // + +module.exports = cgemv; diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/lib/native.js b/lib/node_modules/@stdlib/blas/base/cgemv/lib/native.js new file mode 100644 index 000000000000..d7030c400194 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/lib/native.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var cgemv = require( './cgemv.native.js' ); +var ndarray = require( './ndarray.native.js' ); + + +// MAIN // + +setReadOnly( cgemv, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = cgemv; diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/cgemv/lib/ndarray.native.js new file mode 100644 index 000000000000..c943cfe4aee6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/lib/ndarray.native.js @@ -0,0 +1,104 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +// MODULES // + +var isMatrixTranspose = require( '@stdlib/blas/base/assert/is-transpose-operation' ); +var resolveTrans = require( '@stdlib/blas/base/transpose-operation-resolve-enum' ); +var format = require( '@stdlib/string/format' ); +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. +* +* @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {NonNegativeInteger} M - number of rows in the matrix `A` +* @param {NonNegativeInteger} N - number of columns in the matrix `A` +* @param {Complex64} alpha - scalar constant +* @param {Complex64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Complex64Array} x - first input vector +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {Complex64} beta - scalar constant +* @param {Complex64Array} y - second input vector +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting index for `y` +* @throws {TypeError} first argument must be a valid transpose operation +* @throws {RangeError} second argument must be a nonnegative integer +* @throws {RangeError} third argument must be a nonnegative integer +* @throws {RangeError} tenth argument must be non-zero +* @throws {RangeError} fourteenth argument must be non-zero +* @returns {Complex64Array} `y` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var A = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0 ] ); +* var y = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* cgemv( 'no-transpose', 4, 2, alpha, A, 1, 4, 0, x, 1, 0, beta, y, 1, 0 ); +* // y => [ -10.0, 11.0, -12.0, 14.0, -14.0, 17.0, -16.0, 20.0 ] +*/ +function cgemv( trans, M, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len + var viewA; + var viewX; + var viewY; + + if ( !isMatrixTranspose( trans ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid transpose operation. Value: `%s`.', trans ) ); + } + if ( M < 0 ) { + throw new RangeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%d`.', M ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( strideX === 0 ) { + throw new RangeError( format( 'invalid argument. Tenth argument must be non-zero. Value: `%d`.', strideX ) ); + } + if ( strideY === 0 ) { + throw new RangeError( format( 'invalid argument. Fourteenth argument must be non-zero. Value: `%d`.', strideY ) ); + } + // Check if we can early return... + if ( M === 0 || N === 0 ) { + return y; + } + viewA = reinterpret( A, 0 ); + viewX = reinterpret( x, 0 ); + viewY = reinterpret( y, 0 ); + addon.ndarray( resolveTrans( trans ), M, N, alpha, viewA, strideA1, strideA2, offsetA, viewX, strideX, offsetX, beta, viewY, strideY, offsetY ); // eslint-disable-line max-len + return y; +} + + +// EXPORTS // + +module.exports = cgemv; From a3a89a3ac9e9287b561205c75958a6cb340c10f3 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 12:39:22 +0000 Subject: [PATCH 15/51] fix: fix pointers and bounds --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c | 2 +- lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c index b0204fff8984..313b43d53606 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c @@ -89,7 +89,7 @@ void API_SUFFIX(c_cgemv)( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE trans vala = v; } if ( LDA < v ) { - c_xerbla( 10, "c_cgemv", "Error: invalid argument. Seventh argument must be greater than or equal to max(1,%d). Value: `%d`.", vala, LDA ); + c_xerbla( 7, "c_cgemv", "Error: invalid argument. Seventh argument must be greater than or equal to max(1,%d). Value: `%d`.", vala, LDA ); return; } zero = stdlib_complex64( 0.0, 0.0 ); diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c index 5bcdf64d6701..c000d67c8518 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -172,14 +172,14 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M for ( i1 = 0; i1 < ylen; i1++ ) { tmp = zero; ix = offsetX; - for ( i0 = 0; i0 < ylen; i0++ ) { + for ( i0 = 0; i0 < xlen; i0++ ) { if ( trans == CblasConjTrans ) { aval = stdlib_complex64_conj( ap[ ia ] ); } else { aval = ap[ ia ]; } tmp = stdlib_base_complex64_muladd( aval, xp[ ix ], tmp ); - iy += strideY; + ix += strideX; ia += da0; } yp[ iy ] = stdlib_base_complex64_muladd( alpha, tmp, yp[ iy ] ); From 6ee54af3a39df4f4c0277f9db9f1b79a5b99fd45 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 12:42:45 +0000 Subject: [PATCH 16/51] test: add test suite for c --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/cgemv/test/test.cgemv.native.js | 1007 +++++++++++++ .../base/cgemv/test/test.ndarray.native.js | 1328 +++++++++++++++++ 2 files changed, 2335 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/test/test.cgemv.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/test/test.ndarray.native.js diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/test/test.cgemv.native.js b/lib/node_modules/@stdlib/blas/base/cgemv/test/test.cgemv.native.js new file mode 100644 index 000000000000..99b517b12728 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/test/test.cgemv.native.js @@ -0,0 +1,1007 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// FIXTURES // + +var cnt = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_nt.json' ); +var ct = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_t.json' ); +var cct = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_ct.json' ); +var cxnyn = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_xnyn.json' ); +var cxpyn = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_xpyn.json' ); +var cxnyp = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_xnyp.json' ); +var cxpyp = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_xpyp.json' ); +var cx = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_x_zeros.json' ); +var cxb = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_x_zeros_beta_one.json' ); +var ca = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_alpha_zero.json' ); +var rnt = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_nt.json' ); +var rt = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_t.json' ); +var rct = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_ct.json' ); +var rxnyn = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_xnyn.json' ); +var rxpyn = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_xpyn.json' ); +var rxnyp = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_xnyp.json' ); +var rxpyp = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_xpyp.json' ); +var rx = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_x_zeros.json' ); +var rxb = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_x_zeros_beta_one.json' ); +var ra = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_alpha_zero.json' ); + + +// VARIABLES // + +var cgemv = tryRequire( resolve( __dirname, './../lib/cgemv.native.js' ) ); +var opts = { + 'skip': ( cgemv instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof cgemv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 12', opts, function test( t ) { + t.strictEqual( cgemv.length, 12, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rnt; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cgemv( value, data.trans, data.M, data.N, new Complex64( data.alpha[0], data.alpha[1] ), new Complex64Array( data.A ), data.lda, new Complex64Array( data.x ), data.strideX, new Complex64( data.beta[0], data.beta[1] ), new Complex64Array( data.y ), data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rnt; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cgemv( data.order, value, data.M, data.N, new Complex64( data.alpha[0], data.alpha[1] ), new Complex64Array( data.A ), data.lda, new Complex64Array( data.x ), data.strideX, new Complex64( data.beta[0], data.beta[1] ), new Complex64Array( data.y ), data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rnt; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cgemv( data.order, data.trans, value, data.N, new Complex64( data.alpha[0], data.alpha[1] ), new Complex64Array( data.A ), data.lda, new Complex64Array( data.x ), data.strideX, new Complex64( data.beta[0], data.beta[1] ), new Complex64Array( data.y ), data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rnt; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cgemv( data.order, data.trans, data.M, value, new Complex64( data.alpha[0], data.alpha[1] ), new Complex64Array( data.A ), data.lda, new Complex64Array( data.x ), data.strideX, new Complex64( data.beta[0], data.beta[1] ), new Complex64Array( data.y ), data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid seventh argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rnt; + + values = [ + 0, + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cgemv( data.order, data.trans, data.M, data.N, new Complex64( data.alpha[0], data.alpha[1] ), new Complex64Array( data.A ), value, new Complex64Array( data.x ), data.strideX, new Complex64( data.beta[0], data.beta[1] ), new Complex64Array( data.y ), data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid ninth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rnt; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cgemv( data.order, data.trans, data.M, data.N, new Complex64( data.alpha[0], data.alpha[1] ), new Complex64Array( data.A ), data.lda, new Complex64Array( data.x ), value, new Complex64( data.beta[0], data.beta[1] ), new Complex64Array( data.y ), data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid twelfth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rnt; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cgemv( data.order, data.trans, data.M, data.N, new Complex64( data.alpha[0], data.alpha[1] ), new Complex64Array( data.A ), data.lda, new Complex64Array( data.x ), data.strideX, new Complex64( data.beta[0], data.beta[1] ), new Complex64Array( data.y ), value ); + }; + } +}); + +tape( 'the function performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` (row-major, no-transpose)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rnt; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` (column-major, no-transpose)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cnt; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` (row-major, transpose)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rt; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` (column-major, transpose)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ct; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` (row-major, conjugate-transpose)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rct; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` (column-major, conjugate-transpose)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cct; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (column-major)', opts, function test( t ) { + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ct; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.end(); +}); + +tape( 'if either `M` or `N` is `0`, the function returns the second input vector unchanged (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rt; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = cgemv( data.order, data.trans, 0, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + out = cgemv( data.order, data.trans, data.M, 0, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if either `M` or `N` is `0`, the function returns the second input vector unchanged (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ct; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = cgemv( data.order, data.trans, 0, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + out = cgemv( data.order, data.trans, data.M, 0, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rt; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ct; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxb; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxb; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ra; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ca; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `0`, the function zeros the second input vector (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ra; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 0.0, 0.0 ); + + expected = new Complex64Array( y.length ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `0`, the function zeros the second input vector (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ca; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 0.0, 0.0 ); + + expected = new Complex64Array( y.length ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rx; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cx; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxpyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxpyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxnyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxnyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxpyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxpyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxnyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxnyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.order, data.trans, data.M, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/cgemv/test/test.ndarray.native.js new file mode 100644 index 000000000000..62b917fbbd65 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/test/test.ndarray.native.js @@ -0,0 +1,1328 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// FIXTURES // + +var cap = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_complex_access_pattern.json' ); +var cnt = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_nt.json' ); +var ct = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_t.json' ); +var cct = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_ct.json' ); +var coa = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_oa.json' ); +var csa1sa2 = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_sa1_sa2.json' ); +var csa1nsa2 = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_sa1n_sa2.json' ); +var csa1sa2n = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_sa1_sa2n.json' ); +var csa1nsa2n = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_sa1n_sa2n.json' ); +var cxnyn = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_xnyn.json' ); +var cxpyn = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_xpyn.json' ); +var cxnyp = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_xnyp.json' ); +var cxpyp = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_xpyp.json' ); +var cx = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_x_zeros.json' ); +var cxb = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_x_zeros_beta_one.json' ); +var ca = require( '@stdlib/blas/base/cgemv/test/fixtures/column_major_alpha_zero.json' ); +var rap = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_complex_access_pattern.json' ); +var rnt = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_nt.json' ); +var rt = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_t.json' ); +var rct = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_ct.json' ); +var roa = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_oa.json' ); +var rsa1sa2 = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_sa1_sa2.json' ); +var rsa1nsa2 = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_sa1n_sa2.json' ); +var rsa1sa2n = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_sa1_sa2n.json' ); +var rsa1nsa2n = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_sa1n_sa2n.json' ); +var rxnyn = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_xnyn.json' ); +var rxpyn = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_xpyn.json' ); +var rxnyp = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_xnyp.json' ); +var rxpyp = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_xpyp.json' ); +var rx = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_x_zeros.json' ); +var rxb = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_x_zeros_beta_one.json' ); +var ra = require( '@stdlib/blas/base/cgemv/test/fixtures/row_major_alpha_zero.json' ); + + +// VARIABLES // + +var cgemv = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( cgemv instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof cgemv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 15', opts, function test( t ) { + t.strictEqual( cgemv.length, 15, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rnt; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cgemv( value, data.M, data.N, new Complex64( data.alpha[0], data.alpha[1] ), new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64( data.beta[0], data.beta[1] ), new Complex64Array( data.y ), data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rnt; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cgemv( data.trans, value, data.N, new Complex64( data.alpha[0], data.alpha[1] ), new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64( data.beta[0], data.beta[1] ), new Complex64Array( data.y ), data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rnt; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cgemv( data.trans, data.M, value, new Complex64( data.alpha[0], data.alpha[1] ), new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64( data.beta[0], data.beta[1] ), new Complex64Array( data.y ), data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid tenth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rnt; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cgemv( data.trans, data.M, data.N, new Complex64( data.alpha[0], data.alpha[1] ), new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), value, data.offsetX, new Complex64( data.beta[0], data.beta[1] ), new Complex64Array( data.y ), data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourteenth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rnt; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + cgemv( data.trans, data.M, data.N, new Complex64( data.alpha[0], data.alpha[1] ), new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64( data.beta[0], data.beta[1] ), new Complex64Array( data.y ), value, data.offsetY ); + }; + } +}); + +tape( 'the function performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` (row-major, no-transpose)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rnt; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` (column-major, no-transpose)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cnt; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` (row-major, transpose)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rt; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` (column-major, transpose)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ct; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` (row-major, conjugate-transpose)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rct; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` (column-major, conjugate-transpose)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cct; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (row-major)', opts, function test( t ) { + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rt; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (column-major)', opts, function test( t ) { + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ct; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + + t.end(); +}); + +tape( 'if either `M` or `N` is `0`, the function returns the second input vector unchanged (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rt; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = cgemv( data.trans, 0, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + out = cgemv( data.trans, data.M, 0, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if either `M` or `N` is `0`, the function returns the second input vector unchanged (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ct; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = cgemv( data.trans, 0, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + out = cgemv( data.trans, data.M, 0, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rt; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ct; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxb; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxb; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ra; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ca; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `0`, the function zeros the second input vector (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ra; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 0.0, 0.0 ); + + expected = new Complex64Array( y.length ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `0`, the function zeros the second input vector (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ca; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 0.0, 0.0 ); + + expected = new Complex64Array( y.length ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rx; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cx; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rsa1sa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = csa1sa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rsa1nsa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = csa1nsa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rsa1sa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = csa1sa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports negative strides for `A` (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rsa1nsa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports negative strides for `A` (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = csa1nsa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset parameter for `A` (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = roa; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset parameter for `A` (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = coa; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxpyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxpyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxnyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxnyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxpyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxpyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying negative strides for `x` and `y` (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxnyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying negative strides for `x` and `y` (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxnyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (row-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rap; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (column-major)', opts, function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cap; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); From a134ce58f2e418374791ea49f7bbb623d7ec4a2f Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 12:45:36 +0000 Subject: [PATCH 17/51] chore: update copyright yeras --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/cgemv/lib/cgemv.native.js | 2 +- lib/node_modules/@stdlib/blas/base/cgemv/lib/ndarray.native.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/lib/cgemv.native.js b/lib/node_modules/@stdlib/blas/base/cgemv/lib/cgemv.native.js index 6349f0eddbd9..7be24a55ebe0 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/lib/cgemv.native.js +++ b/lib/node_modules/@stdlib/blas/base/cgemv/lib/cgemv.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/cgemv/lib/ndarray.native.js index c943cfe4aee6..ede195452cc5 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/cgemv/lib/ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 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. From 78d0a608c99a51f409e524ed081b2dbc878b8bae Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 13:30:16 +0000 Subject: [PATCH 18/51] bench: add js benchmark for c --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../base/cgemv/benchmark/benchmark.native.js | 129 ++++++++++++++++++ .../benchmark/benchmark.ndarray.native.js | 129 ++++++++++++++++++ 2 files changed, 258 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.ndarray.native.js diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.native.js new file mode 100644 index 000000000000..27af8d270636 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.native.js @@ -0,0 +1,129 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var format = require( '@stdlib/string/format' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var cgemv = tryRequire( resolve( __dirname, './../lib/cgemv.native.js' ) ); +var opts = { + 'skip': ( cgemv instanceof Error ) +}; +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var xbuf; + var ybuf; + var Abuf; + var x; + var y; + var A; + + xbuf = uniform( N*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + ybuf = uniform( N*2, -100.0, 100.0, options ); + y = new Complex64Array( ybuf.buffer ); + Abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex64Array( Abuf.buffer ); + + alpha = new Complex64( 0.5, 0.5 ); + beta = new Complex64( 0.5, -0.5 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + var z; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = cgemv( 'row-major', 'no-transpose', N, N, alpha, A, N, x, 1, beta, y, 1 ); + if ( isnanf( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( format( '%s::native:size=%d', pkg, N*N ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.ndarray.native.js new file mode 100644 index 000000000000..de29b1fde350 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.ndarray.native.js @@ -0,0 +1,129 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var format = require( '@stdlib/string/format' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var cgemv = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( cgemv instanceof Error ) +}; +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var xbuf; + var ybuf; + var Abuf; + var x; + var y; + var A; + + xbuf = uniform( N*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + ybuf = uniform( N*2, -100.0, 100.0, options ); + y = new Complex64Array( ybuf.buffer ); + Abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex64Array( Abuf.buffer ); + + alpha = new Complex64( 0.5, 0.5 ); + beta = new Complex64( 0.5, -0.5 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + var z; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = cgemv( 'no-transpose', N, N, alpha, A, 1, N, 0, x, 1, 0, beta, y, 1, 0 ); + if ( isnanf( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( format( '%s::native:ndarray:size=%d', pkg, N*N ), opts, f ); + } +} + +main(); From 227276a3758122355743d219c55d4ea7395958ad Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 13:33:57 +0000 Subject: [PATCH 19/51] bench: update isnan --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/benchmark/benchmark.native.js | 4 ++-- .../blas/base/cgemv/benchmark/benchmark.ndarray.native.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.native.js index 27af8d270636..5afb380a03b0 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.native.js @@ -88,12 +88,12 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { z = cgemv( 'row-major', 'no-transpose', N, N, alpha, A, N, x, 1, beta, y, 1 ); - if ( isnanf( z ) ) { + if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnanf( z ) ) { + if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.ndarray.native.js index de29b1fde350..b78128fd67b6 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/benchmark.ndarray.native.js @@ -88,12 +88,12 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { z = cgemv( 'no-transpose', N, N, alpha, A, 1, N, 0, x, 1, 0, beta, y, 1, 0 ); - if ( isnanf( z ) ) { + if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnanf( z ) ) { + if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); From 6e1998018575321205ad97ce35acc6ffce29c1cb Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 17:43:38 +0000 Subject: [PATCH 20/51] docs: update readme for c 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: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/README.md | 115 ++++++++++++++++-- 1 file changed, 108 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/README.md b/lib/node_modules/@stdlib/blas/base/cgemv/README.md index f4baba5c0d7c..6663f3507297 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/README.md +++ b/lib/node_modules/@stdlib/blas/base/cgemv/README.md @@ -242,21 +242,82 @@ logEach( '%s', x ); ### Usage ```c -TODO +#include "stdlib/blas/base/cgemv.h" ``` -#### TODO +#### c_cgemv( layout, trans, M, N, alpha, \*A, LDA, \*X, strideX, beta, \*Y, strideY ) -TODO. +Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. ```c -TODO +#include "stdlib/blas/base/shared.h" +#include "stdlib/complex/float32/ctor.h" + +const float A[] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, 4.0f, 4.0f, 5.0f, 5.0f, 6.0f, 6.0f, 7.0f, 7.0f, 8.0f, 8.0f }; +const float x[] = { 1.0f, 1.0f, 2.0f, 2.0f }; +float y[] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, 4.0f, 4.0f }; +const stdlib_complex64_t alpha = stdlib_complex64( 0.5f, 0.5f ); +const stdlib_complex64_t beta = stdlib_complex64( 0.5f, -0.5f ); + +c_cgemv( CblasColMajor, CblasNoTrans, 4, 2, alpha, (void *)A, 4, (void *)x, 1, beta, (void *)y, 1 ); ``` -TODO +The function accepts the following arguments: + +- **layout**: `[in] CBLAS_LAYOUT` storage layout. +- **trans**: `[in] CBLAS_TRANSPOSE` specifies whether `A` should be transposed, conjugate-transposed, or not transposed. +- **M**: `[in] CBLAS_INT` number of rows in the matrix `A`. +- **N**: `[in] CBLAS_INT` number of columns in the matrix `A`. +- **alpha**: `[in] stdlib_complex64_t` scalar constant. +- **A**: `[in] void*` input matrix. +- **LDA**: `[in] CBLAS_INT` stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **X**: `[in] void*` first input vector. +- **strideX**: `[in] CBLAS_INT` stride length for `X`. +- **beta**: `[in] stdlib_complex64_t` scalar constant. +- **Y**: `[inout] void*` second input vector. +- **strideY**: `[in] CBLAS_INT` stride length for `Y`. ```c -TODO +void c_cgemv( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t alpha, const void *A, const CBLAS_INT LDA, const void *X, const CBLAS_INT strideX, const stdlib_complex64_t beta, void *Y, const CBLAS_INT strideY ) +``` + +#### c_cgemv_ndarray( trans, M, N, alpha, \*A, sa1, sa2, oa, \*X, sx, ox, beta, \*Y, sy, oy ) + +Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y`, using indexing alternative semantics and where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. + +```c +#include "stdlib/blas/base/shared.h" +#include "stdlib/complex/float32/ctor.h" + +const float A[] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, 4.0f, 4.0f, 5.0f, 5.0f, 6.0f, 6.0f, 7.0f, 7.0f, 8.0f, 8.0f }; +const float x[] = { 1.0f, 1.0f, 2.0f, 2.0f }; +float y[] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, 4.0f, 4.0f }; +const stdlib_complex64_t alpha = stdlib_complex64( 0.5f, 0.5f ); +const stdlib_complex64_t beta = stdlib_complex64( 0.5f, -0.5f ); + +c_cgemv( CblasNoTrans, 4, 2, alpha, (void *)A, 4, (void *)x, 1, 0, beta, (void *)y, 1, 0 ); +``` + +The function accepts the following arguments: + +- **trans**: `[in] CBLAS_TRANSPOSE` specifies whether `A` should be transposed, conjugate-transposed, or not transposed. +- **M**: `[in] CBLAS_INT` number of rows in the matrix `A`. +- **N**: `[in] CBLAS_INT` number of columns in the matrix `A`. +- **alpha**: `[in] stdlib_complex64_t` scalar constant. +- **A**: `[in] void*` input matrix. +- **sa1**: `[in] CBLAS_INT` stride of the first dimension of `A`. +- **sa2**: `[in] CBLAS_INT` stride of the second dimension of `A`. +- **oa**: `[in] CBLAS_INT` starting index for `A`. +- **X**: `[in] void*` first input vector. +- **sx**: `[in] CBLAS_INT` stride length for `X`. +- **ox**: `[in] CBLAS_INT` starting index for `X`. +- **beta**: `[in] stdlib_complex64_t` scalar constant. +- **Y**: `[inout] void*` second input vector. +- **sy**: `[in] CBLAS_INT` stride length for `Y`. +- **oy**: `[in] CBLAS_INT` starting index for `Y`. + +```c +void c_cgemv_ndarray( const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t alpha, const void *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const stdlib_complex64_t beta, void *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) ``` @@ -278,7 +339,47 @@ TODO ### Examples ```c -TODO +#include "stdlib/blas/base/cgemv.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/complex/float32/ctor.h" +#include + +int main( void ) { + // Define a 3x3 matrix stored in row-major order: + const float A[ 3*3*2 ] = { + 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, + 4.0f, 4.0f, 5.0f, 5.0f, 6.0f, 6.0f, + 7.0f, 7.0f, 8.0f, 8.0f, 9.0f, 9.0f + }; + + // Define `x` and `y` vectors: + const float x[ 3*2 ] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f }; + float y[ 3*2 ] = { 3.0f, 3.0f, 2.0f, 2.0f, 1.0f, 1.0f }; + + // Create complex scalars: + const stdlib_complex64_t alpha = stdlib_complex64( 0.5f, 0.5f ); + const stdlib_complex64_t beta = stdlib_complex64( 0.5f, -0.5f ); + + // Specify the number of elements along each dimension of `A`: + const int M = 3; + const int N = 3; + + // Perform the matrix-vector operation `y = α*A*x + β*y`: + c_cgemv( CblasRowMajor, CblasNoTrans, M, N, alpha, (void *)A, M, (void *)x, 1, beta, (void *)y, 1 ); + + // Print the result: + for ( int i = 0; i < N; i++ ) { + printf( "y[ %i ] = %f + %fj\n", i, y[ i*2 ], y[ (i*2)+1 ] ); + } + + // Perform the matrix-vector operation `y = α*A*x + β*y` using alternative indexing semantics: + c_cgemv_ndarray( CblasNoTrans, M, N, alpha, (void *)A, N, 1, 0, (void *)x, 1, 0, beta, (void *)y, 1, 0 ); + + // Print the result: + for ( int i = 0; i < N; i++ ) { + printf( "y[ %i ] = %f + %fj\n", i, y[ i*2 ], y[ (i*2)+1 ] ); + } +} ``` From e6d91d0236d47d296703a53badcb48187714aca1 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 17:53:29 +0000 Subject: [PATCH 21/51] chore: fix exmaple --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/cgemv/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/README.md b/lib/node_modules/@stdlib/blas/base/cgemv/README.md index 6663f3507297..51f94fd826f9 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/README.md +++ b/lib/node_modules/@stdlib/blas/base/cgemv/README.md @@ -295,7 +295,7 @@ float y[] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, 4.0f, 4.0f }; const stdlib_complex64_t alpha = stdlib_complex64( 0.5f, 0.5f ); const stdlib_complex64_t beta = stdlib_complex64( 0.5f, -0.5f ); -c_cgemv( CblasNoTrans, 4, 2, alpha, (void *)A, 4, (void *)x, 1, 0, beta, (void *)y, 1, 0 ); +c_cgemv( CblasNoTrans, 4, 2, alpha, (void *)A, 1, 4, (void *)x, 1, 0, beta, (void *)y, 1, 0 ); ``` The function accepts the following arguments: From d492160a58605419b4d5e8a5058cc1e664d67b3c Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 17:54:55 +0000 Subject: [PATCH 22/51] chore: fix exmaple --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/cgemv/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/README.md b/lib/node_modules/@stdlib/blas/base/cgemv/README.md index 51f94fd826f9..993374102270 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/README.md +++ b/lib/node_modules/@stdlib/blas/base/cgemv/README.md @@ -245,6 +245,8 @@ logEach( '%s', x ); #include "stdlib/blas/base/cgemv.h" ``` + + #### c_cgemv( layout, trans, M, N, alpha, \*A, LDA, \*X, strideX, beta, \*Y, strideY ) Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. @@ -281,6 +283,8 @@ The function accepts the following arguments: void c_cgemv( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t alpha, const void *A, const CBLAS_INT LDA, const void *X, const CBLAS_INT strideX, const stdlib_complex64_t beta, void *Y, const CBLAS_INT strideY ) ``` + + #### c_cgemv_ndarray( trans, M, N, alpha, \*A, sa1, sa2, oa, \*X, sx, ox, beta, \*Y, sy, oy ) Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y`, using indexing alternative semantics and where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. From 127b979cde584649c340d822f76fec5d1293bfe9 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 17:57:27 +0000 Subject: [PATCH 23/51] chore: fix exmaple --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/cgemv/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/README.md b/lib/node_modules/@stdlib/blas/base/cgemv/README.md index 993374102270..1b16180a6434 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/README.md +++ b/lib/node_modules/@stdlib/blas/base/cgemv/README.md @@ -261,7 +261,7 @@ float y[] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, 4.0f, 4.0f }; const stdlib_complex64_t alpha = stdlib_complex64( 0.5f, 0.5f ); const stdlib_complex64_t beta = stdlib_complex64( 0.5f, -0.5f ); -c_cgemv( CblasColMajor, CblasNoTrans, 4, 2, alpha, (void *)A, 4, (void *)x, 1, beta, (void *)y, 1 ); +c_cgemv( CblasRowMajor, CblasNoTrans, 4, 2, alpha, (void *)A, 4, (void *)x, 1, beta, (void *)y, 1 ); ``` The function accepts the following arguments: From 45e1877fc96444478234acef75051bd9d8e1d3b3 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 18:06:53 +0000 Subject: [PATCH 24/51] chore: fix exmaple --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/cgemv/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/README.md b/lib/node_modules/@stdlib/blas/base/cgemv/README.md index 1b16180a6434..69d35a651b11 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/README.md +++ b/lib/node_modules/@stdlib/blas/base/cgemv/README.md @@ -204,12 +204,12 @@ var y = filledarrayBy( M, 'complex64', rand ); var alpha = new Complex64( 0.5, 0.5 ); var beta = new Complex64( 0.5, -0.5 ); -cgemv( 'column-major', 'no-transpose', M, N, alpha, A, 4, x, 1, beta, y, 1 ); +cgemv( 'column-major', 'no-transpose', M, N, alpha, A, M, x, 1, beta, y, 1 ); // Print the results: logEach( '%s', x ); -cgemv.ndarray( 'no-transpose', M, N, alpha, A, 1, 4, 0, x, 1, 0, beta, y, 1, 0 ); +cgemv.ndarray( 'no-transpose', M, N, alpha, A, 1, M, 0, x, 1, 0, beta, y, 1, 0 ); // Print the results: logEach( '%s', x ); @@ -261,7 +261,7 @@ float y[] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, 4.0f, 4.0f }; const stdlib_complex64_t alpha = stdlib_complex64( 0.5f, 0.5f ); const stdlib_complex64_t beta = stdlib_complex64( 0.5f, -0.5f ); -c_cgemv( CblasRowMajor, CblasNoTrans, 4, 2, alpha, (void *)A, 4, (void *)x, 1, beta, (void *)y, 1 ); +c_cgemv( CblasColMajor, CblasNoTrans, 4, 2, alpha, (void *)A, 4, (void *)x, 1, beta, (void *)y, 1 ); ``` The function accepts the following arguments: From 166bc11add15e17115cc8705520549c86f797ff3 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 18:25:56 +0000 Subject: [PATCH 25/51] refactor: remove conditionals from hot loops --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/cgemv/src/cgemv_ndarray.c | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c index c000d67c8518..585adc54848b 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -139,15 +139,20 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M ia += da0 * ylen; } else { iy = offsetY; - for ( i0 = 0; i0 < ylen; i0++ ) { - if ( trans == CblasConjTrans ) { + if ( trans == CblasConjTrans ) { + for ( i0 = 0; i0 < ylen; i0++ ) { aval = stdlib_complex64_conj( ap[ ia ] ); - } else { + yp[ iy ] = stdlib_base_complex64_muladd( aval, tmp, yp[ iy ] ); + iy += strideY; + ia += da0; + } + } else { + for ( i0 = 0; i0 < ylen; i0++ ) { aval = ap[ ia ]; + yp[ iy ] = stdlib_base_complex64_muladd( aval, tmp, yp[ iy ] ); + iy += strideY; + ia += da0; } - yp[ iy ] = stdlib_base_complex64_muladd( aval, tmp, yp[ iy ] ); - iy += strideY; - ia += da0; } } ix += strideX; @@ -172,15 +177,20 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M for ( i1 = 0; i1 < ylen; i1++ ) { tmp = zero; ix = offsetX; - for ( i0 = 0; i0 < xlen; i0++ ) { - if ( trans == CblasConjTrans ) { + if ( trans == CblasConjTrans ) { + for ( i0 = 0; i0 < xlen; i0++ ) { aval = stdlib_complex64_conj( ap[ ia ] ); - } else { + tmp = stdlib_base_complex64_muladd( aval, xp[ ix ], tmp ); + ix += strideX; + ia += da0; + } + } else { + for ( i0 = 0; i0 < xlen; i0++ ) { aval = ap[ ia ]; + tmp = stdlib_base_complex64_muladd( aval, xp[ ix ], tmp ); + ix += strideX; + ia += da0; } - tmp = stdlib_base_complex64_muladd( aval, xp[ ix ], tmp ); - ix += strideX; - ia += da0; } yp[ iy ] = stdlib_base_complex64_muladd( alpha, tmp, yp[ iy ] ); iy += strideY; From 8419b2f321e6133342f0676fad247ee1fc0d286a Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 19:06:54 +0000 Subject: [PATCH 26/51] refactor: variable initialized --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/src/cgemv_ndarray.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c index 585adc54848b..bca37a232734 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -49,9 +49,9 @@ * @return output value */ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t alpha, const void *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const stdlib_complex64_t beta, void *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) { - const stdlib_complex64_t *ap = (stdlib_complex64_t *)A; - const stdlib_complex64_t *xp = (stdlib_complex64_t *)X; - stdlib_complex64_t *yp = (stdlib_complex64_t *)Y; + const stdlib_complex64_t *ap; + const stdlib_complex64_t *xp; + stdlib_complex64_t *yp; stdlib_complex64_t aval; stdlib_complex64_t zero; stdlib_complex64_t one; @@ -91,6 +91,9 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M c_xerbla( 14, "c_cgemv_ndarray", "Error: invalid argument. Fourteenth argument must be a nonzero. Value: `%d`.", strideY ); return; } + ap = (stdlib_complex64_t *)A; + xp = (stdlib_complex64_t *)X; + yp = (stdlib_complex64_t *)Y; zero = stdlib_complex64( 0.0, 0.0 ); one = stdlib_complex64( 1.0, 0.0 ); // Check whether we can avoid computation altogether... From 45fed280aeec0746867dc6971267dca215bb3e8b Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 23 Apr 2026 19:13:16 +0000 Subject: [PATCH 27/51] chore: add header --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c index 55447e808f87..fccaecf0f5c7 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c @@ -17,6 +17,7 @@ */ #include "stdlib/blas/base/cgemv.h" +#include "stdlib/blas/base/shared.h" #include #include #include From 9d692997eb09aae357f13f3bfd0c6f3c30390f85 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 24 Apr 2026 03:50:33 +0000 Subject: [PATCH 28/51] chore: add header --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/manifest.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json b/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json index 4955858512bd..089c75d5e860 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json +++ b/lib/node_modules/@stdlib/blas/base/cgemv/manifest.json @@ -51,6 +51,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", @@ -85,6 +86,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -112,6 +114,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -143,6 +146,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", @@ -180,6 +184,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -210,6 +215,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -238,6 +244,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", @@ -272,6 +279,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -299,6 +307,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -329,6 +338,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", @@ -365,6 +375,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -394,6 +405,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -425,6 +437,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", @@ -462,6 +475,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -492,6 +506,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -520,6 +535,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", @@ -554,6 +570,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -581,6 +598,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -609,6 +627,7 @@ "@stdlib/complex/float32/conj", "@stdlib/complex/float32/base/mul", "@stdlib/complex/float32/base/mul-add", + "@stdlib/complex/float32/ctor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] From ea667136c2b732c21dec2865ac63c50a15d00d1e Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 24 Apr 2026 04:03:41 +0000 Subject: [PATCH 29/51] chore: cahde headers --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c index fccaecf0f5c7..89d6b8cba38c 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c @@ -16,8 +16,8 @@ * limitations under the License. */ -#include "stdlib/blas/base/cgemv.h" #include "stdlib/blas/base/shared.h" +#include "stdlib/blas/base/cgemv.h" #include #include #include From 1f33d04bf7573d2a86017f6778e2cef845b53ab9 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 24 Apr 2026 05:21:04 +0000 Subject: [PATCH 30/51] bench: use dynamic memory reallocation --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/cgemv/benchmark/c/benchmark.c | 229 ++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.c diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.c new file mode 100644 index 000000000000..69d212bb7b64 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.c @@ -0,0 +1,229 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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/shared.h" +#include "stdlib/blas/base/cgemv.h" +#include +#include +#include +#include +#include +#include "stdlib/complex/float32/ctor.h" + +#define NAME "cgemv" +#define ITERATIONS 10000000 +#define REPEATS 3 +#define MIN 1 +#define MAX 6 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param iterations number of iterations +* @param elapsed elapsed time in seconds +*/ +static void print_results( int iterations, double elapsed ) { + double rate = (double)iterations / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", iterations ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [0,1). +* +* @return random number +*/ +static float rand_float( void ) { + int r = rand(); + return (float)r / ( (float)RAND_MAX + 1.0f ); +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param N array dimension size +* @return elapsed time in seconds +*/ +static double benchmark1( int iterations, int N ) { + stdlib_complex64_t alpha; + stdlib_complex64_t beta; + double elapsed; + float *A; + float *x; + float *y; + double t; + int i; + int j; + + A = (float *)malloc( N * N * 2 * sizeof( float ) ); + x = (float *)malloc( N * 2 * sizeof( float ) ); + y = (float *)malloc( N * 2 * sizeof( float ) ); + alpha = stdlib_complex64( 0.5f, 0.5f ); + beta = stdlib_complex64( 0.5f, -0.5f ); + + for ( i = 0, j = 0; i < N; i++, j += 2 ) { + 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; + A[ j ] = ( rand_float()*2.0f ) - 1.0f; + A[ j+1 ] = ( rand_float()*2.0f ) - 1.0f; + } + t = tic(); + for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar + c_cgemv( CblasRowMajor, CblasNoTrans, N, N, alpha, (void *)A, N, (void *)x, 1, beta, (void *)y, 1 ); + if ( y[ i%N ] != y[ i%N ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( y[ i%N ] != y[ i%N ] ) { + printf( "should not return NaN\n" ); + } + free( A ); + free( x ); + free( y ); + return elapsed; +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param N array dimension size +* @return elapsed time in seconds +*/ +static double benchmark2( int iterations, int N ) { + stdlib_complex64_t alpha; + stdlib_complex64_t beta; + double elapsed; + float *A; + float *x; + float *y; + double t; + int i; + int j; + + A = (float *)malloc( N * N * 2 * sizeof( float ) ); + x = (float *)malloc( N * 2 * sizeof( float ) ); + y = (float *)malloc( N * 2 * sizeof( float ) ); + alpha = stdlib_complex64( 0.5f, 0.5f ); + beta = stdlib_complex64( 0.5f, -0.5f ); + + for ( i = 0, j = 0; i < N; i++, j += 2 ) { + 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; + A[ j ] = ( rand_float()*2.0f ) - 1.0f; + A[ j+1 ] = ( rand_float()*2.0f ) - 1.0f; + } + t = tic(); + for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar + c_cgemv_ndarray( CblasNoTrans, N, N, alpha, (void *)A, N, 1, 0, (void *)x, 1, 0, beta, (void *)y, 1, 0 ); + if ( y[ i%N ] != y[ i%N ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( y[ i%N ] != y[ i%N ] ){ + printf( "should not return NaN\n" ); + } + free( A ); + free( x ); + free( y ); + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int count; + int iter; + int N; + int i; + int j; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + count = 0; + for ( i = MIN; i <= MAX; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + iter = ITERATIONS / pow( 10, i-1 ); + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:size=%d\n", NAME, N*N ); + elapsed = benchmark1( iter, N ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:ndarray:size=%d\n", NAME, N*N ); + elapsed = benchmark2( iter, N ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + } + print_summary( count, count ); +} From abaf09b1e545530c906cc47bf91886a99fe805e2 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 24 Apr 2026 05:22:11 +0000 Subject: [PATCH 31/51] bench: use dynamic memory reallocation --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/cgemv/benchmark/c/benchmark.c | 229 ------------------ 1 file changed, 229 deletions(-) delete mode 100644 lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.c diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.c deleted file mode 100644 index 69d212bb7b64..000000000000 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.c +++ /dev/null @@ -1,229 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2026 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/shared.h" -#include "stdlib/blas/base/cgemv.h" -#include -#include -#include -#include -#include -#include "stdlib/complex/float32/ctor.h" - -#define NAME "cgemv" -#define ITERATIONS 10000000 -#define REPEATS 3 -#define MIN 1 -#define MAX 6 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param iterations number of iterations -* @param elapsed elapsed time in seconds -*/ -static void print_results( int iterations, double elapsed ) { - double rate = (double)iterations / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", iterations ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @param iterations number of iterations -* @param N array dimension size -* @return elapsed time in seconds -*/ -static double benchmark1( int iterations, int N ) { - stdlib_complex64_t alpha; - stdlib_complex64_t beta; - double elapsed; - float *A; - float *x; - float *y; - double t; - int i; - int j; - - A = (float *)malloc( N * N * 2 * sizeof( float ) ); - x = (float *)malloc( N * 2 * sizeof( float ) ); - y = (float *)malloc( N * 2 * sizeof( float ) ); - alpha = stdlib_complex64( 0.5f, 0.5f ); - beta = stdlib_complex64( 0.5f, -0.5f ); - - for ( i = 0, j = 0; i < N; i++, j += 2 ) { - 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; - A[ j ] = ( rand_float()*2.0f ) - 1.0f; - A[ j+1 ] = ( rand_float()*2.0f ) - 1.0f; - } - t = tic(); - for ( i = 0; i < iterations; i++ ) { - // cppcheck-suppress uninitvar - c_cgemv( CblasRowMajor, CblasNoTrans, N, N, alpha, (void *)A, N, (void *)x, 1, beta, (void *)y, 1 ); - if ( y[ i%N ] != y[ i%N ] ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( y[ i%N ] != y[ i%N ] ) { - printf( "should not return NaN\n" ); - } - free( A ); - free( x ); - free( y ); - return elapsed; -} - -/** -* Runs a benchmark. -* -* @param iterations number of iterations -* @param N array dimension size -* @return elapsed time in seconds -*/ -static double benchmark2( int iterations, int N ) { - stdlib_complex64_t alpha; - stdlib_complex64_t beta; - double elapsed; - float *A; - float *x; - float *y; - double t; - int i; - int j; - - A = (float *)malloc( N * N * 2 * sizeof( float ) ); - x = (float *)malloc( N * 2 * sizeof( float ) ); - y = (float *)malloc( N * 2 * sizeof( float ) ); - alpha = stdlib_complex64( 0.5f, 0.5f ); - beta = stdlib_complex64( 0.5f, -0.5f ); - - for ( i = 0, j = 0; i < N; i++, j += 2 ) { - 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; - A[ j ] = ( rand_float()*2.0f ) - 1.0f; - A[ j+1 ] = ( rand_float()*2.0f ) - 1.0f; - } - t = tic(); - for ( i = 0; i < iterations; i++ ) { - // cppcheck-suppress uninitvar - c_cgemv_ndarray( CblasNoTrans, N, N, alpha, (void *)A, N, 1, 0, (void *)x, 1, 0, beta, (void *)y, 1, 0 ); - if ( y[ i%N ] != y[ i%N ] ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( y[ i%N ] != y[ i%N ] ){ - printf( "should not return NaN\n" ); - } - free( A ); - free( x ); - free( y ); - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int count; - int iter; - int N; - int i; - int j; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - count = 0; - for ( i = MIN; i <= MAX; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); - iter = ITERATIONS / pow( 10, i-1 ); - for ( j = 0; j < REPEATS; j++ ) { - count += 1; - printf( "# c::%s:size=%d\n", NAME, N*N ); - elapsed = benchmark1( iter, N ); - print_results( iter, elapsed ); - printf( "ok %d benchmark finished\n", count ); - } - for ( j = 0; j < REPEATS; j++ ) { - count += 1; - printf( "# c::%s:ndarray:size=%d\n", NAME, N*N ); - elapsed = benchmark2( iter, N ); - print_results( iter, elapsed ); - printf( "ok %d benchmark finished\n", count ); - } - } - print_summary( count, count ); -} From d78f0bf9cdac783982db05a941b362ac10562eca Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 24 Apr 2026 05:26:09 +0000 Subject: [PATCH 32/51] bench: use dynamic memory reallocation --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../base/cgemv/benchmark/c/benchmark.length.c | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c index 89d6b8cba38c..69d212bb7b64 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c @@ -100,13 +100,16 @@ static double benchmark1( int iterations, int N ) { stdlib_complex64_t alpha; stdlib_complex64_t beta; double elapsed; - float A[ N*N*2 ]; - float x[ N*2 ]; - float y[ N*2 ]; + float *A; + float *x; + float *y; double t; int i; int j; + A = (float *)malloc( N * N * 2 * sizeof( float ) ); + x = (float *)malloc( N * 2 * sizeof( float ) ); + y = (float *)malloc( N * 2 * sizeof( float ) ); alpha = stdlib_complex64( 0.5f, 0.5f ); beta = stdlib_complex64( 0.5f, -0.5f ); @@ -131,6 +134,9 @@ static double benchmark1( int iterations, int N ) { if ( y[ i%N ] != y[ i%N ] ) { printf( "should not return NaN\n" ); } + free( A ); + free( x ); + free( y ); return elapsed; } @@ -145,13 +151,16 @@ static double benchmark2( int iterations, int N ) { stdlib_complex64_t alpha; stdlib_complex64_t beta; double elapsed; - float A[ N*N*2 ]; - float x[ N*2 ]; - float y[ N*2 ]; + float *A; + float *x; + float *y; double t; int i; int j; + A = (float *)malloc( N * N * 2 * sizeof( float ) ); + x = (float *)malloc( N * 2 * sizeof( float ) ); + y = (float *)malloc( N * 2 * sizeof( float ) ); alpha = stdlib_complex64( 0.5f, 0.5f ); beta = stdlib_complex64( 0.5f, -0.5f ); @@ -176,6 +185,9 @@ static double benchmark2( int iterations, int N ) { if ( y[ i%N ] != y[ i%N ] ){ printf( "should not return NaN\n" ); } + free( A ); + free( x ); + free( y ); return elapsed; } From d3d560a44bc456a7519cafbdaea2af685aa7eb34 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 24 Apr 2026 06:19:07 +0000 Subject: [PATCH 33/51] bench: use cfill --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../base/cgemv/benchmark/c/benchmark.length.c | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c index 69d212bb7b64..7d3b18a9f589 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c @@ -18,12 +18,13 @@ #include "stdlib/blas/base/shared.h" #include "stdlib/blas/base/cgemv.h" +#include "stdlib/blas/ext/base/cfill.h" +#include "stdlib/complex/float32/ctor.h" #include #include #include #include #include -#include "stdlib/complex/float32/ctor.h" #define NAME "cgemv" #define ITERATIONS 10000000 @@ -99,6 +100,7 @@ static float rand_float( void ) { static double benchmark1( int iterations, int N ) { stdlib_complex64_t alpha; stdlib_complex64_t beta; + stdlib_complex64_t one; double elapsed; float *A; float *x; @@ -112,15 +114,10 @@ static double benchmark1( int iterations, int N ) { y = (float *)malloc( N * 2 * sizeof( float ) ); alpha = stdlib_complex64( 0.5f, 0.5f ); beta = stdlib_complex64( 0.5f, -0.5f ); - - for ( i = 0, j = 0; i < N; i++, j += 2 ) { - 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; - A[ j ] = ( rand_float()*2.0f ) - 1.0f; - A[ j+1 ] = ( rand_float()*2.0f ) - 1.0f; - } + one = stdlib_complex64( 1.0f, 1.0f ); + stdlib_strided_cfill( N * N, one, (stdlib_complex64_t *)A, 1 ); + stdlib_strided_cfill( N, one, (stdlib_complex64_t *)x, 1 ); + stdlib_strided_cfill( N, one, (stdlib_complex64_t *)y, 1 ); t = tic(); for ( i = 0; i < iterations; i++ ) { // cppcheck-suppress uninitvar @@ -150,6 +147,7 @@ static double benchmark1( int iterations, int N ) { static double benchmark2( int iterations, int N ) { stdlib_complex64_t alpha; stdlib_complex64_t beta; + stdlib_complex64_t one; double elapsed; float *A; float *x; @@ -163,15 +161,10 @@ static double benchmark2( int iterations, int N ) { y = (float *)malloc( N * 2 * sizeof( float ) ); alpha = stdlib_complex64( 0.5f, 0.5f ); beta = stdlib_complex64( 0.5f, -0.5f ); - - for ( i = 0, j = 0; i < N; i++, j += 2 ) { - 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; - A[ j ] = ( rand_float()*2.0f ) - 1.0f; - A[ j+1 ] = ( rand_float()*2.0f ) - 1.0f; - } + one = stdlib_complex64( 1.0f, 1.0f ); + stdlib_strided_cfill( N * N, one, (stdlib_complex64_t *)A, 1 ); + stdlib_strided_cfill( N, one, (stdlib_complex64_t *)x, 1 ); + stdlib_strided_cfill( N, one, (stdlib_complex64_t *)y, 1 ); t = tic(); for ( i = 0; i < iterations; i++ ) { // cppcheck-suppress uninitvar From e61c9d6a06a7bcbf588d21e9ddbb7a6cb261d8b9 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 24 Apr 2026 06:20:01 +0000 Subject: [PATCH 34/51] bench: use cfill --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/cgemv/benchmark/c/benchmark.length.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c index 7d3b18a9f589..be0430b64ef0 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c @@ -80,16 +80,6 @@ static double tic( void ) { return (double)now.tv_sec + (double)now.tv_usec/1.0e6; } -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - /** * Runs a benchmark. * From d9462c18082a255957564090af2c5581e9604876 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 24 Apr 2026 06:21:27 +0000 Subject: [PATCH 35/51] bench: use cfill --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c index be0430b64ef0..718bcad4e535 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/benchmark/c/benchmark.length.c @@ -97,7 +97,6 @@ static double benchmark1( int iterations, int N ) { float *y; double t; int i; - int j; A = (float *)malloc( N * N * 2 * sizeof( float ) ); x = (float *)malloc( N * 2 * sizeof( float ) ); @@ -144,7 +143,6 @@ static double benchmark2( int iterations, int N ) { float *y; double t; int i; - int j; A = (float *)malloc( N * N * 2 * sizeof( float ) ); x = (float *)malloc( N * 2 * sizeof( float ) ); From 1ef8eeee4b4111a3528d5655ebec767461def747 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 18 May 2026 08:09:12 +0000 Subject: [PATCH 36/51] fix: adds float symbol --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c | 4 ++-- lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c index 313b43d53606..0c723fe0791e 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c @@ -92,8 +92,8 @@ void API_SUFFIX(c_cgemv)( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE trans c_xerbla( 7, "c_cgemv", "Error: invalid argument. Seventh argument must be greater than or equal to max(1,%d). Value: `%d`.", vala, LDA ); return; } - zero = stdlib_complex64( 0.0, 0.0 ); - one = stdlib_complex64( 1.0, 0.0 ); + zero = stdlib_complex64( 0.0f, 0.0f ); + one = stdlib_complex64( 1.0f, 0.0f ); // Check whether we can avoid computation altogether... if ( M == 0 || N == 0 || ( stdlib_base_complex64_is_equal( alpha, zero ) && stdlib_base_complex64_is_equal( beta, one ) ) ) { return; diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c index bca37a232734..f62804a5cebd 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -94,8 +94,8 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M ap = (stdlib_complex64_t *)A; xp = (stdlib_complex64_t *)X; yp = (stdlib_complex64_t *)Y; - zero = stdlib_complex64( 0.0, 0.0 ); - one = stdlib_complex64( 1.0, 0.0 ); + zero = stdlib_complex64( 0.0f, 0.0f ); + one = stdlib_complex64( 1.0f, 0.0f ); // Check whether we can avoid computation altogether... if ( M == 0 || N == 0 || ( stdlib_base_complex64_is_equal( alpha, zero ) && stdlib_base_complex64_is_equal( beta, one ) ) ) { return; From f0f0788bc6c93dc9f47e4e5c6fe4b8e93e357454 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 18 May 2026 08:24:29 +0000 Subject: [PATCH 37/51] refactor: duplicates the outer loops --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/cgemv/src/cgemv_ndarray.c | 67 ++++++++++++------- 1 file changed, 42 insertions(+), 25 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c index f62804a5cebd..a21bbc0cd094 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -128,38 +128,48 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M if ( isrm ) { // For row-major matrices, the last dimension has the fastest changing index... da0 = strideA2; // offset increment for innermost loop - da1 = strideA1 - ( ylen*strideA2 ); // offset increment for outermost loop + da1 = strideA1 - (ylen*strideA2); // offset increment for outermost loop } else { // isColMajor // For column-major matrices, the first dimension has the fastest changing index... da0 = strideA1; // offset increment for innermost loop - da1 = strideA2 - ( ylen*strideA1 ); // offset increment for outermost loop + da1 = strideA2 - (ylen*strideA1); // offset increment for outermost loop } ia = offsetA; ix = offsetX; - for ( i1 = 0; i1 < xlen; i1++ ) { - tmp = stdlib_base_complex64_mul( alpha, xp[ ix ] ); - if ( stdlib_base_complex64_is_equal( tmp, zero )) { - ia += da0 * ylen; - } else { - iy = offsetY; - if ( trans == CblasConjTrans ) { + if ( trans != CblasConjTrans ) { + for ( i1 = 0; i1 < xlen; i1++ ) { + tmp = stdlib_base_complex64_mul( alpha, xp[ ix ] ); + if ( stdlib_base_complex64_is_equal( tmp, zero )) { + ia += da0 * ylen; + } else { + iy = offsetY; for ( i0 = 0; i0 < ylen; i0++ ) { - aval = stdlib_complex64_conj( ap[ ia ] ); + aval = ap[ ia ]; yp[ iy ] = stdlib_base_complex64_muladd( aval, tmp, yp[ iy ] ); iy += strideY; ia += da0; } + } + ix += strideX; + ia += da1; + } + } else { + for ( i1 = 0; i1 < xlen; i1++ ) { + tmp = stdlib_base_complex64_mul( alpha, xp[ ix ] ); + if ( stdlib_base_complex64_is_equal( tmp, zero )) { + ia += da0 * ylen; } else { + iy = offsetY; for ( i0 = 0; i0 < ylen; i0++ ) { - aval = ap[ ia ]; + aval = stdlib_complex64_conj( ap[ ia ] ); yp[ iy ] = stdlib_base_complex64_muladd( aval, tmp, yp[ iy ] ); iy += strideY; ia += da0; } } + ix += strideX; + ia += da1; } - ix += strideX; - ia += da1; } return; } @@ -169,35 +179,42 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M if ( isrm ) { // For row-major matrices, the last dimension has the fastest changing index... da0 = strideA2; // offset increment for innermost loop - da1 = strideA1 - ( xlen*strideA2 ); // offset increment for outermost loop + da1 = strideA1 - (xlen*strideA2); // offset increment for outermost loop } else { // isColMajor // For column-major matrices, the first dimension has the fastest changing index... da0 = strideA1; // offset increment for innermost loop - da1 = strideA2 - ( xlen*strideA1 ); // offset increment for outermost loop + da1 = strideA2 - (xlen*strideA1); // offset increment for outermost loop } ia = offsetA; iy = offsetY; - for ( i1 = 0; i1 < ylen; i1++ ) { - tmp = zero; - ix = offsetX; - if ( trans == CblasConjTrans ) { + if ( trans != CblasConjTrans ) { + for ( i1 = 0; i1 < ylen; i1++ ) { + tmp = zero; + ix = offsetX; for ( i0 = 0; i0 < xlen; i0++ ) { - aval = stdlib_complex64_conj( ap[ ia ] ); + aval = ap[ ia ]; tmp = stdlib_base_complex64_muladd( aval, xp[ ix ], tmp ); ix += strideX; ia += da0; } - } else { + yp[ iy ] = stdlib_base_complex64_muladd( alpha, tmp, yp[ iy ] ); + iy += strideY; + ia += da1; + } + } else { + for ( i1 = 0; i1 < ylen; i1++ ) { + tmp = zero; + ix = offsetX; for ( i0 = 0; i0 < xlen; i0++ ) { - aval = ap[ ia ]; + aval = stdlib_complex64_conj( ap[ ia ] ); tmp = stdlib_base_complex64_muladd( aval, xp[ ix ], tmp ); ix += strideX; ia += da0; } + yp[ iy ] = stdlib_base_complex64_muladd( alpha, tmp, yp[ iy ] ); + iy += strideY; + ia += da1; } - yp[ iy ] = stdlib_base_complex64_muladd( alpha, tmp, yp[ iy ] ); - iy += strideY; - ia += da1; } return; } From 79549076d577e5140b13522a39ec5ac63ce47bc2 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 18 May 2026 08:26:49 +0000 Subject: [PATCH 38/51] fix: dfixs comments --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c index a21bbc0cd094..33b19a0f6b1f 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -175,7 +175,7 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M } // Form: Y = α*A^T*X + Y - // ( !isrm && trans !== CblasNoTrans ) || ( isrm && trans === CblasNoTrans ) + // ( !isrm && trans != CblasNoTrans ) || ( isrm && trans == CblasNoTrans ) if ( isrm ) { // For row-major matrices, the last dimension has the fastest changing index... da0 = strideA2; // offset increment for innermost loop From 6fd46a2c8dcb3766bff98372e3b25dc8553a0b0e Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 18 May 2026 02:19:22 -0700 Subject: [PATCH 39/51] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h index 6ae711a482e6..30ed6022bc4d 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h +++ b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h @@ -17,7 +17,7 @@ */ /** -* Header file containing function declarations for the C interface to the BLAS Level 2 routine `sgemv`. +* Header file containing function declarations for the C interface to the BLAS Level 2 routine `cgemv`. */ #ifndef CGEMV_H #define CGEMV_H From addf6eac9d5cb9c1c6c5a6d42f66d0bef5bd40e6 Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 18 May 2026 02:22:28 -0700 Subject: [PATCH 40/51] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../blas/base/cgemv/include/stdlib/blas/base/cgemv.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h index 30ed6022bc4d..c443a9c7793c 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h +++ b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h @@ -19,8 +19,8 @@ /** * Header file containing function declarations for the C interface to the BLAS Level 2 routine `cgemv`. */ -#ifndef CGEMV_H -#define CGEMV_H +#ifndef STDLIB_BLAS_BASE_CGEMV_H +#define STDLIB_BLAS_BASE_CGEMV_H #include "stdlib/blas/base/shared.h" #include "stdlib/complex/float32/ctor.h" @@ -46,4 +46,4 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M } #endif -#endif // !CGEMV_H +#endif // !STDLIB_BLAS_BASE_CGEMV_H From 2270b94bc232a6e5c5a4dfa15e58aaa10050db3b Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 18 May 2026 02:23:42 -0700 Subject: [PATCH 41/51] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h index 151b7a0ed05a..1bd8def5ab35 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h @@ -19,8 +19,8 @@ /** * Header file containing function declarations for the C interface to the BLAS Level 2 routine `sgemv`. */ -#ifndef CGEMV_CBLAS_H -#define CGEMV_CBLAS_H +#ifndef STDLIB_BLAS_BASE_CGEMV_CBLAS_H +#define STDLIB_BLAS_BASE_CGEMV_CBLAS_H #include "stdlib/blas/base/shared.h" #include "stdlib/complex/float32/ctor.h" @@ -46,4 +46,4 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M } #endif -#endif // !CGEMV_CBLAS_H +#endif // !STDLIB_BLAS_BASE_CGEMV_CBLAS_H From 38fb4955625e609ea547d3d9714d64653aa9ad97 Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 18 May 2026 02:24:07 -0700 Subject: [PATCH 42/51] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h index 1bd8def5ab35..13708292ae62 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h @@ -17,7 +17,7 @@ */ /** -* Header file containing function declarations for the C interface to the BLAS Level 2 routine `sgemv`. +* Header file containing function declarations for the C interface to the BLAS Level 2 routine `cgemv`. */ #ifndef STDLIB_BLAS_BASE_CGEMV_CBLAS_H #define STDLIB_BLAS_BASE_CGEMV_CBLAS_H From 96a5cad642afd82c512064dc8beeee949d6bb1a1 Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 18 May 2026 02:36:51 -0700 Subject: [PATCH 43/51] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../@stdlib/blas/base/cgemv/src/cgemv_ndarray.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c index 33b19a0f6b1f..9e611cd1059b 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -127,12 +127,12 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M ) { if ( isrm ) { // For row-major matrices, the last dimension has the fastest changing index... - da0 = strideA2; // offset increment for innermost loop - da1 = strideA1 - (ylen*strideA2); // offset increment for outermost loop + da0 = strideA2; // offset increment for innermost loop + da1 = strideA1 - ( ylen*strideA2 ); // offset increment for outermost loop } else { // isColMajor // For column-major matrices, the first dimension has the fastest changing index... - da0 = strideA1; // offset increment for innermost loop - da1 = strideA2 - (ylen*strideA1); // offset increment for outermost loop + da0 = strideA1; // offset increment for innermost loop + da1 = strideA2 - ( ylen*strideA1 ); // offset increment for outermost loop } ia = offsetA; ix = offsetX; From 08c5ae427a16f5e160905e0072e0e417369add53 Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 18 May 2026 02:37:18 -0700 Subject: [PATCH 44/51] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c index 9e611cd1059b..547e19c87910 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -127,11 +127,11 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M ) { if ( isrm ) { // For row-major matrices, the last dimension has the fastest changing index... - da0 = strideA2; // offset increment for innermost loop + da0 = strideA2; // offset increment for innermost loop da1 = strideA1 - ( ylen*strideA2 ); // offset increment for outermost loop } else { // isColMajor // For column-major matrices, the first dimension has the fastest changing index... - da0 = strideA1; // offset increment for innermost loop + da0 = strideA1; // offset increment for innermost loop da1 = strideA2 - ( ylen*strideA1 ); // offset increment for outermost loop } ia = offsetA; From b9cddab63c078f604306b435a27f5b7d934accd8 Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 18 May 2026 02:38:54 -0700 Subject: [PATCH 45/51] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../blas/base/cgemv/src/cgemv_ndarray.c | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c index 547e19c87910..90ffc415a0f8 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -153,23 +153,23 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M ix += strideX; ia += da1; } - } else { - for ( i1 = 0; i1 < xlen; i1++ ) { - tmp = stdlib_base_complex64_mul( alpha, xp[ ix ] ); - if ( stdlib_base_complex64_is_equal( tmp, zero )) { - ia += da0 * ylen; - } else { - iy = offsetY; - for ( i0 = 0; i0 < ylen; i0++ ) { - aval = stdlib_complex64_conj( ap[ ia ] ); - yp[ iy ] = stdlib_base_complex64_muladd( aval, tmp, yp[ iy ] ); - iy += strideY; - ia += da0; - } + return; + } + for ( i1 = 0; i1 < xlen; i1++ ) { + tmp = stdlib_base_complex64_mul( alpha, xp[ ix ] ); + if ( stdlib_base_complex64_is_equal( tmp, zero )) { + ia += da0 * ylen; + } else { + iy = offsetY; + for ( i0 = 0; i0 < ylen; i0++ ) { + aval = stdlib_complex64_conj( ap[ ia ] ); + yp[ iy ] = stdlib_base_complex64_muladd( aval, tmp, yp[ iy ] ); + iy += strideY; + ia += da0; } - ix += strideX; - ia += da1; } + ix += strideX; + ia += da1; } return; } From a24ee50561a92fcbd53eda02e23f4221a5e18468 Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 18 May 2026 02:40:50 -0700 Subject: [PATCH 46/51] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../blas/base/cgemv/src/cgemv_ndarray.c | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c index 90ffc415a0f8..b688c3db6de5 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -179,7 +179,7 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M if ( isrm ) { // For row-major matrices, the last dimension has the fastest changing index... da0 = strideA2; // offset increment for innermost loop - da1 = strideA1 - (xlen*strideA2); // offset increment for outermost loop + da1 = strideA1 - ( xlen*strideA2 ); // offset increment for outermost loop } else { // isColMajor // For column-major matrices, the first dimension has the fastest changing index... da0 = strideA1; // offset increment for innermost loop @@ -201,20 +201,20 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M iy += strideY; ia += da1; } - } else { - for ( i1 = 0; i1 < ylen; i1++ ) { - tmp = zero; - ix = offsetX; - for ( i0 = 0; i0 < xlen; i0++ ) { - aval = stdlib_complex64_conj( ap[ ia ] ); - tmp = stdlib_base_complex64_muladd( aval, xp[ ix ], tmp ); - ix += strideX; - ia += da0; - } - yp[ iy ] = stdlib_base_complex64_muladd( alpha, tmp, yp[ iy ] ); - iy += strideY; - ia += da1; + return; + } + for ( i1 = 0; i1 < ylen; i1++ ) { + tmp = zero; + ix = offsetX; + for ( i0 = 0; i0 < xlen; i0++ ) { + aval = stdlib_complex64_conj( ap[ ia ] ); + tmp = stdlib_base_complex64_muladd( aval, xp[ ix ], tmp ); + ix += strideX; + ia += da0; } + yp[ iy ] = stdlib_base_complex64_muladd( alpha, tmp, yp[ iy ] ); + iy += strideY; + ia += da1; } return; } From 8224ef7564626957244d8450e5f9c4f081b14246 Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 18 May 2026 02:41:04 -0700 Subject: [PATCH 47/51] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c index b688c3db6de5..15597f589bec 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -183,7 +183,7 @@ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M } else { // isColMajor // For column-major matrices, the first dimension has the fastest changing index... da0 = strideA1; // offset increment for innermost loop - da1 = strideA2 - (xlen*strideA1); // offset increment for outermost loop + da1 = strideA2 - ( xlen*strideA1 ); // offset increment for outermost loop } ia = offsetA; iy = offsetY; From 24a282efaac86cbdf0db2d2c10f65ebc4d912ec6 Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 18 May 2026 02:49:09 -0700 Subject: [PATCH 48/51] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../blas/base/cgemv/include/stdlib/blas/base/cgemv.h | 4 ++-- .../base/cgemv/include/stdlib/blas/base/cgemv_cblas.h | 4 ++-- lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c | 2 +- .../@stdlib/blas/base/cgemv/src/cgemv_cblas.c | 10 +++++----- .../@stdlib/blas/base/cgemv/src/cgemv_ndarray.c | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h index c443a9c7793c..9cc86094ecef 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h +++ b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv.h @@ -33,12 +33,12 @@ extern "C" { #endif /** -* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y`, where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. +* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y` or `Y = α*A^H*X + β*Y`, where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. */ void API_SUFFIX(c_cgemv)( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t alpha, const void *A, const CBLAS_INT LDA, const void *X, const CBLAS_INT strideX, const stdlib_complex64_t beta, void *Y, const CBLAS_INT strideY ); /** -* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y`, where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix using alternative indexing semantics. +* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y` or `Y = α*A^H*X + β*Y`, where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix using alternative indexing semantics. */ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t alpha, const void *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const stdlib_complex64_t beta, void *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ); diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h index 13708292ae62..9b9e0b051057 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/cgemv/include/stdlib/blas/base/cgemv_cblas.h @@ -33,12 +33,12 @@ extern "C" { #endif /** -* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y`, where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. +* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y` or `Y = α*A^H*X + β*Y`, where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. */ void API_SUFFIX(c_cgemv)( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t alpha, const void *A, const CBLAS_INT LDA, const void *X, const CBLAS_INT strideX, const stdlib_complex64_t beta, void *Y, const CBLAS_INT strideY ); /** -* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y`, where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix using alternative indexing semantics. +* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y` or `Y = α*A^H*X + β*Y`, where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix using alternative indexing semantics. */ void API_SUFFIX(c_cgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t alpha, const void *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const stdlib_complex64_t beta, void *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ); diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c index 0c723fe0791e..718295d2ad03 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv.c @@ -24,7 +24,7 @@ #include "stdlib/complex/float32/base/assert/is_equal.h" /** -* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y`, where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. +* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y` or `Y = α*A^H*X + β*Y`, where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. * * @param layout storage layout * @param trans specifies whether `A` should be transposed, conjugate-transposed, or not transposed diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_cblas.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_cblas.c index d25e98ce6d88..6eb10ea663be 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_cblas.c @@ -22,7 +22,7 @@ #include "stdlib/blas/base/shared.h" /** -* Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. +* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y` or `Y = α*A^H*X + β*Y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. * * @param layout storage layout * @param trans specifies whether `A` should be transposed, conjugate-transposed, or not transposed @@ -31,11 +31,11 @@ * @param alpha scalar constant * @param A input matrix * @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) -* @param x first input vector -* @param strideX `x` stride length +* @param X first input vector +* @param strideX `X` stride length * @param beta scalar constant -* @param y second input vector -* @param strideY `y` stride length +* @param Y second input vector +* @param strideY `Y` stride length * @return output value */ void API_SUFFIX(c_cgemv)( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const stdlib_complex64_t alpha, const void *A, const CBLAS_INT LDA, const void *X, const CBLAS_INT strideX, const stdlib_complex64_t beta, void *Y, const CBLAS_INT strideY ) { diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c index 15597f589bec..300534928ec8 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -29,7 +29,7 @@ #include "stdlib/complex/float32/base/assert/is_equal.h" /** -* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y`, using alternative indexing semantics and where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. +* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y` or `Y = α*A^H*X + β*Y`, using alternative indexing semantics and where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. * * @param trans specifies whether `A` should be transposed, conjugate-transposed, or not transposed * @param M number of rows in the matrix `A` From bbb94263b6db938fcdbd8177f643065fa7ad70f4 Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 18 May 2026 02:50:06 -0700 Subject: [PATCH 49/51] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_cblas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_cblas.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_cblas.c index 6eb10ea663be..82e20c5fe085 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_cblas.c @@ -22,7 +22,7 @@ #include "stdlib/blas/base/shared.h" /** -* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y` or `Y = α*A^H*X + β*Y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. +* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y` or `Y = α*A^H*X + β*Y`, where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. * * @param layout storage layout * @param trans specifies whether `A` should be transposed, conjugate-transposed, or not transposed From e674fd78666985f5a85353372dfad6ec167441b2 Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 18 May 2026 02:51:13 -0700 Subject: [PATCH 50/51] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c index 300534928ec8..36483901dc4b 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/cgemv/src/cgemv_ndarray.c @@ -29,7 +29,7 @@ #include "stdlib/complex/float32/base/assert/is_equal.h" /** -* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y` or `Y = α*A^H*X + β*Y`, using alternative indexing semantics and where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. +* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y` or `Y = α*A^H*X + β*Y` using alternative indexing semantics and where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. * * @param trans specifies whether `A` should be transposed, conjugate-transposed, or not transposed * @param M number of rows in the matrix `A` From f36e8f6ef103cf8bab2e1e6b03df6ea208a6c78b Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 18 May 2026 02:56:34 -0700 Subject: [PATCH 51/51] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../@stdlib/blas/base/cgemv/README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cgemv/README.md b/lib/node_modules/@stdlib/blas/base/cgemv/README.md index 69d35a651b11..04dd85e9bccd 100644 --- a/lib/node_modules/@stdlib/blas/base/cgemv/README.md +++ b/lib/node_modules/@stdlib/blas/base/cgemv/README.md @@ -249,13 +249,18 @@ logEach( '%s', x ); #### c_cgemv( layout, trans, M, N, alpha, \*A, LDA, \*X, strideX, beta, \*Y, strideY ) -Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y` where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. +Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y` or `Y = α*A^H*X + β*Y` where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. ```c #include "stdlib/blas/base/shared.h" #include "stdlib/complex/float32/ctor.h" -const float A[] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, 4.0f, 4.0f, 5.0f, 5.0f, 6.0f, 6.0f, 7.0f, 7.0f, 8.0f, 8.0f }; +const float A[] = { + 1.0f, 1.0f, 2.0f, 2.0f, + 3.0f, 3.0f, 4.0f, 4.0f, + 5.0f, 5.0f, 6.0f, 6.0f, + 7.0f, 7.0f, 8.0f, 8.0f +}; const float x[] = { 1.0f, 1.0f, 2.0f, 2.0f }; float y[] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, 4.0f, 4.0f }; const stdlib_complex64_t alpha = stdlib_complex64( 0.5f, 0.5f ); @@ -287,13 +292,18 @@ void c_cgemv( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE trans, const CBLA #### c_cgemv_ndarray( trans, M, N, alpha, \*A, sa1, sa2, oa, \*X, sx, ox, beta, \*Y, sy, oy ) -Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y`, using indexing alternative semantics and where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix. +Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y` or `Y = α*A^H*X + β*Y` using indexing alternative semantics and where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix. ```c #include "stdlib/blas/base/shared.h" #include "stdlib/complex/float32/ctor.h" -const float A[] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, 4.0f, 4.0f, 5.0f, 5.0f, 6.0f, 6.0f, 7.0f, 7.0f, 8.0f, 8.0f }; +const float A[] = { + 1.0f, 1.0f, 2.0f, 2.0f, + 3.0f, 3.0f, 4.0f, 4.0f, + 5.0f, 5.0f, 6.0f, 6.0f, + 7.0f, 7.0f, 8.0f, 8.0f +}; const float x[] = { 1.0f, 1.0f, 2.0f, 2.0f }; float y[] = { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f, 4.0f, 4.0f }; const stdlib_complex64_t alpha = stdlib_complex64( 0.5f, 0.5f );