From 685fd5be997ae351774b9e7ebf2fe9b7e7de312c Mon Sep 17 00:00:00 2001 From: kaustubh Date: Thu, 16 Jul 2026 23:49:52 +0530 Subject: [PATCH] refactor: add enum support for blas/base/ssymv --- 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_pkg_readmes status: na - task: lint_markdown_docs status: na - 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 --- --- .../@stdlib/blas/base/ssymv/lib/ndarray.js | 11 +++++++---- lib/node_modules/@stdlib/blas/base/ssymv/lib/ssymv.js | 10 ++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/ssymv/lib/ndarray.js index ff55bce5210a..905b41d6e3bf 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ssymv/lib/ndarray.js @@ -20,7 +20,7 @@ // MODULES // -var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var resolveStr = require( '@stdlib/blas/base/matrix-triangle-resolve-str' ); var format = require( '@stdlib/string/format' ); var base = require( './base.js' ); @@ -30,7 +30,7 @@ var base = require( './base.js' ); /** * Performs the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. * -* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param {(integer|string)} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {number} alpha - scalar constant * @param {Float32Array} A - input matrix @@ -63,7 +63,10 @@ var base = require( './base.js' ); * // y => [ 10.0, 12.0, 14.0 ] */ function ssymv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len - if ( !isMatrixTriangle( uplo ) ) { + var u; + + u = resolveStr( uplo ); + if ( u === null ) { throw new TypeError( format( 'invalid argument. First argument must specify whether to reference the lower or upper triangular matrix. Value: `%s`.', uplo ) ); } if ( N < 0 ) { @@ -84,7 +87,7 @@ function ssymv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs if ( N === 0 || ( alpha === 0.0 && beta === 1.0 ) ) { return y; } - return base( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ); // eslint-disable-line max-len + return base( u, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/lib/ssymv.js b/lib/node_modules/@stdlib/blas/base/ssymv/lib/ssymv.js index e1e3d39938c4..66eff3554196 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/lib/ssymv.js +++ b/lib/node_modules/@stdlib/blas/base/ssymv/lib/ssymv.js @@ -23,7 +23,7 @@ var max = require( '@stdlib/math/base/special/max' ); var stride2offset = require( '@stdlib/strided/base/stride2offset' ); var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); -var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var resolveStr = require( '@stdlib/blas/base/matrix-triangle-resolve-str' ); var format = require( '@stdlib/string/format' ); var base = require( './base.js' ); @@ -34,7 +34,7 @@ var base = require( './base.js' ); * Performs the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. * * @param {string} order - storage layout -* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param {(integer|string)} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {number} alpha - scalar constant * @param {Float32Array} A - input matrix @@ -67,11 +67,13 @@ function ssymv( order, uplo, N, alpha, A, LDA, x, strideX, beta, y, strideY ) { var sa2; var ox; var oy; + var u; if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } - if ( !isMatrixTriangle( uplo ) ) { + u = resolveStr( uplo ); + if ( u === null ) { throw new TypeError( format( 'invalid argument. Second argument must specify whether to reference the lower or upper triangular matrix. Value: `%s`.', uplo ) ); } if ( N < 0 ) { @@ -98,7 +100,7 @@ function ssymv( order, uplo, N, alpha, A, LDA, x, strideX, beta, y, strideY ) { sa1 = LDA; sa2 = 1; } - return base( uplo, N, alpha, A, sa1, sa2, 0, x, strideX, ox, beta, y, strideY, oy ); // eslint-disable-line max-len + return base( u, N, alpha, A, sa1, sa2, 0, x, strideX, ox, beta, y, strideY, oy ); // eslint-disable-line max-len }