From 1da16ab28b8362cfeea0c2aa5f78f61e674c6e58 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sat, 19 Apr 2025 18:00:11 +0530 Subject: [PATCH 1/2] test: add test cases for blas/base/dtrmv --- 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: 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/dtrmv/lib/ndarray.js | 6 +++ .../blas/base/dtrmv/test/test.ndarray.js | 46 +++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js index 9036d43cb702..c3568cf81cb6 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js @@ -72,6 +72,12 @@ function dtrmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX if ( N < 0 ) { throw new RangeError( format( 'invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.', N ) ); } + if ( strideA1 === 0 ) { + throw new RangeError( format( 'invalid argument. Sixth argument must be non-zero. Value: `%d`.', strideA1 ) ); + } + if ( strideA2 === 0 ) { + throw new RangeError( format( 'invalid argument. Seventh argument must be non-zero. Value: `%d`.', strideA2 ) ); + } if ( strideX === 0 ) { throw new RangeError( format( 'invalid argument. Tenth argument must be non-zero. Value: `%d`.', strideX ) ); } diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js index 2e1f922b0cea..c149073ce62c 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js @@ -180,6 +180,52 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun } }); +tape( 'the function throws an error if provided an invalid sixth argument', function test( t ) { + var values; + var data; + var i; + + data = rutu; + + 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() { + dtrmv( data.uplo, data.trans, data.diag, data.N, new Float64Array( data.A ), value, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid seventh argument', function test( t ) { + var values; + var data; + var i; + + data = rutu; + + 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() { + dtrmv( data.uplo, data.trans, data.diag, data.N, new Float64Array( data.A ), data.strideA1, value, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); + }; + } +}); + tape( 'the function throws an error if provided an invalid tenth argument', function test( t ) { var values; var data; From 6c09aaa3ddde79a4c67139345fdfefd6fa49f417 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 20 Apr 2025 11:56:56 +0530 Subject: [PATCH 2/2] chore: add jsdoc --- 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js index c3568cf81cb6..8cb04d6a4d7d 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js @@ -47,6 +47,8 @@ var base = require( './base.js' ); * @throws {TypeError} second argument must be a valid transpose operation * @throws {TypeError} third argument must be a valid diagonal type * @throws {RangeError} fourth argument must be a nonnegative integer +* @throws {RangeError} sixth argument must be non-zero +* @throws {RangeError} seventh argument must be non-zero * @throws {RangeError} tenth argument must be non-zero * @returns {Float64Array} `x` *