From 665f4c47639558b5976ccf4ef0519ff76f65e56b Mon Sep 17 00:00:00 2001 From: kaustubh Date: Fri, 17 Jul 2026 02:34:38 +0530 Subject: [PATCH 1/2] refactor: add support for enums in blas/base/strmv --- 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/strmv/lib/ndarray.js | 27 ++++++++++++------- .../@stdlib/blas/base/strmv/lib/strmv.js | 26 +++++++++++------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js index 8feb20cb6ee3..ac44f00bcc88 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js @@ -20,9 +20,9 @@ // MODULES // -var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); -var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); -var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); +var resolveTriangle = require( '@stdlib/blas/base/matrix-triangle-resolve-str' ); +var resolveTranspose = require( '@stdlib/blas/base/transpose-operation-resolve-str' ); +var resolveDiagonal = require( '@stdlib/blas/base/diagonal-type-resolve-str' ); var format = require( '@stdlib/string/format' ); var base = require( './base.js' ); @@ -32,9 +32,9 @@ var base = require( './base.js' ); /** * Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * -* @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix -* @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed -* @param {string} diag - specifies whether `A` has a unit diagonal +* @param {(integer|string)} uplo - specifies whether `A` is an upper or lower triangular matrix +* @param {(integer|string)} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {(integer|string)} diag - specifies whether `A` has a unit diagonal * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {Float32Array} A - input matrix * @param {integer} strideA1 - stride of the first dimension of `A` @@ -62,13 +62,20 @@ var base = require( './base.js' ); * // x => [ 14.0, 8.0, 3.0 ] */ function strmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len - if ( !isMatrixTriangle( uplo ) ) { + var u; + var t; + var d; + + u = resolveTriangle( uplo ); + if ( u === null ) { throw new TypeError( format( 'invalid argument. First argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); } - if ( !isTransposeOperation( trans ) ) { + t = resolveTranspose( trans ); + if ( t === null ) { throw new TypeError( format( 'invalid argument. Second argument must be a valid transpose operation. Value: `%s`.', trans ) ); } - if ( !isDiagonal( diag ) ) { + d = resolveDiagonal( diag ); + if ( d === null ) { throw new TypeError( format( 'invalid argument. Third argument must be a valid diagonal type. Value: `%s`.', diag ) ); } if ( N < 0 ) { @@ -86,7 +93,7 @@ function strmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX if ( N === 0 ) { return x; } - return base( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ); // eslint-disable-line max-len + return base( u, t, d, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js index d321a893d281..38ac83cccedd 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js @@ -22,9 +22,9 @@ var max = require( '@stdlib/math/base/special/fast/max' ); var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); -var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); -var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); -var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); +var resolveTriangle = require( '@stdlib/blas/base/matrix-triangle-resolve-str' ); +var resolveTranspose = require( '@stdlib/blas/base/transpose-operation-resolve-str' ); +var resolveDiagonal = require( '@stdlib/blas/base/diagonal-type-resolve-str' ); var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); var stride2offset = require( '@stdlib/strided/base/stride2offset' ); var format = require( '@stdlib/string/format' ); @@ -37,9 +37,9 @@ var base = require( './base.js' ); * Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param {string} order - storage layout -* @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix -* @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed -* @param {string} diag - specifies whether `A` has a unit diagonal +* @param {(integer|string)} uplo - specifies whether `A` is an upper or lower triangular matrix +* @param {(integer|string)} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {(integer|string)} diag - specifies whether `A` has a unit diagonal * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {Float32Array} A - input matrix * @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) @@ -67,17 +67,23 @@ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { var sa1; var sa2; var ox; + var u; + var t; + var d; if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } - if ( !isMatrixTriangle( uplo ) ) { + u = resolveTriangle( uplo ); + if ( u === null ) { throw new TypeError( format( 'invalid argument. Second argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); } - if ( !isTransposeOperation( trans ) ) { + t = resolveTranspose( trans ); + if ( t === null ) { throw new TypeError( format( 'invalid argument. Third argument must be a valid transpose operation. Value: `%s`.', trans ) ); } - if ( !isDiagonal( diag ) ) { + d = resolveDiagonal( diag ); + if ( d === null ) { throw new TypeError( format( 'invalid argument. Fourth argument must be a valid diagonal type. Value: `%s`.', diag ) ); } if ( N < 0 ) { @@ -100,7 +106,7 @@ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { sa2 = 1; } ox = stride2offset( N, strideX ); - return base( uplo, trans, diag, N, A, sa1, sa2, 0, x, strideX, ox ); + return base( u, t, d, N, A, sa1, sa2, 0, x, strideX, ox ); } From 5c1d225c4b7257e227afa2dbb8d3b9805aeca3b6 Mon Sep 17 00:00:00 2001 From: kaustubh Date: Fri, 17 Jul 2026 02:48:24 +0530 Subject: [PATCH 2/2] feat: resolve order parameter --- 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 --- --- lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js index 38ac83cccedd..6d5d5bd33ef1 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js @@ -21,7 +21,7 @@ // MODULES // var max = require( '@stdlib/math/base/special/fast/max' ); -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var resolveLayout = require( '@stdlib/blas/base/layout-resolve-str' ); var resolveTriangle = require( '@stdlib/blas/base/matrix-triangle-resolve-str' ); var resolveTranspose = require( '@stdlib/blas/base/transpose-operation-resolve-str' ); var resolveDiagonal = require( '@stdlib/blas/base/diagonal-type-resolve-str' ); @@ -36,7 +36,7 @@ var base = require( './base.js' ); /** * Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * -* @param {string} order - storage layout +* @param {(integer|string)} order - storage layout * @param {(integer|string)} uplo - specifies whether `A` is an upper or lower triangular matrix * @param {(integer|string)} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed * @param {(integer|string)} diag - specifies whether `A` has a unit diagonal @@ -67,11 +67,13 @@ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { var sa1; var sa2; var ox; + var l; var u; var t; var d; - if ( !isLayout( order ) ) { + l = resolveLayout( order ); + if ( l === null ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } u = resolveTriangle( uplo ); @@ -98,7 +100,7 @@ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { if ( N === 0 ) { return x; } - if ( isColumnMajor( order ) ) { + if ( isColumnMajor( l ) ) { sa1 = 1; sa2 = LDA; } else { // order === 'row-major'