From 08a499ea73593a7eeb331c3c39db8e875ca3ba5b Mon Sep 17 00:00:00 2001 From: kaustubh Date: Fri, 10 Jul 2026 11:24:58 +0530 Subject: [PATCH 1/3] refactor: replace isMatrixTraingle with resolveStr in blas/base/ssyr --- 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/ssyr/lib/ndarray.js | 9 ++++++--- lib/node_modules/@stdlib/blas/base/ssyr/lib/ssyr.js | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ssyr/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/ssyr/lib/ndarray.js index 80b84bc65b05..9efd35ce8a85 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr/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' ); @@ -57,7 +57,10 @@ var base = require( './base.js' ); * // A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] */ function ssyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ) { // eslint-disable-line 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 ) { @@ -76,7 +79,7 @@ function ssyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offse if ( N === 0 || alpha === 0.0 ) { return A; } - return base( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ); // eslint-disable-line max-len + return base( u, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/base/ssyr/lib/ssyr.js b/lib/node_modules/@stdlib/blas/base/ssyr/lib/ssyr.js index f10d3974de3d..6772a14c0ccf 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr/lib/ssyr.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr/lib/ssyr.js @@ -22,7 +22,7 @@ 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 resolveStr = require( '@stdlib/blas/base/matrix-triangle-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' ); @@ -62,11 +62,13 @@ function ssyr( order, uplo, N, alpha, x, strideX, A, LDA ) { var sa1; var sa2; var ox; + 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 ) { @@ -90,7 +92,7 @@ function ssyr( order, uplo, N, alpha, x, strideX, A, LDA ) { sa2 = 1; } ox = stride2offset( N, strideX ); - return base( uplo, N, alpha, x, strideX, ox, A, sa1, sa2, 0 ); + return base( u, N, alpha, x, strideX, ox, A, sa1, sa2, 0 ); } From b005409c646d87cc80666eb5167d1c4ad184f129 Mon Sep 17 00:00:00 2001 From: Athan Date: Thu, 9 Jul 2026 23:00:13 -0700 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/ssyr/lib/ndarray.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ssyr/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/ssyr/lib/ndarray.js index 9efd35ce8a85..6f89f22199e6 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr/lib/ndarray.js @@ -57,9 +57,7 @@ var base = require( './base.js' ); * // A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] */ function ssyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ) { // eslint-disable-line max-len - var u; - - u = resolveStr( uplo ); + var 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 ) ); } From 8b63c0229f13737ff843e23056beaae24990b218 Mon Sep 17 00:00:00 2001 From: Athan Date: Thu, 9 Jul 2026 23:02:48 -0700 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/ssyr/lib/ndarray.js | 2 +- lib/node_modules/@stdlib/blas/base/ssyr/lib/ssyr.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ssyr/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/ssyr/lib/ndarray.js index 6f89f22199e6..ececa216170f 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr/lib/ndarray.js @@ -30,7 +30,7 @@ var base = require( './base.js' ); /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, 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} x - input vector diff --git a/lib/node_modules/@stdlib/blas/base/ssyr/lib/ssyr.js b/lib/node_modules/@stdlib/blas/base/ssyr/lib/ssyr.js index 6772a14c0ccf..07c0921ba811 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr/lib/ssyr.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr/lib/ssyr.js @@ -35,7 +35,7 @@ var base = require( './base.js' ); * Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, 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} x - input vector