From 384ee61676f30fc817479c362e52e91535a796c2 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 4 Apr 2025 18:12:56 +0530 Subject: [PATCH 1/5] test: completes code coverage in blas/base/dsyr2 --- 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js index 76002766416b..c5bc413fcb2a 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js @@ -138,7 +138,7 @@ tape( 'the function throws an error if provided an invalid fifth argument', func function badValue( value ) { return function badValue() { - dsyr2( data.uplo, data.N, data.alpha, new Float64Array( data.x ), value, data.offsetX, new Float64Array( data.y ), data.strideY, data.offsetY, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + dsyr2( data.uplo, data.N, data.alpha, new Float64Array( data.x ), data.strideX, data.offsetX, new Float64Array( data.y ), value, data.offsetY, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); }; } }); From f4f90797f79df1c25ddee911f959ef495fe64aaa Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 4 Apr 2025 18:46:47 +0530 Subject: [PATCH 2/5] chore: add test cases --- 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../dsyr2/test/fixtures/column_major_x0.json | 18 +++++++ .../dsyr2/test/fixtures/row_major_x0.json | 18 +++++++ .../blas/base/dsyr2/test/test.dsyr2.js | 48 +++++++++++++++++++ .../blas/base/dsyr2/test/test.ndarray.js | 48 +++++++++++++++++++ 4 files changed, 132 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr2/test/fixtures/column_major_x0.json create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr2/test/fixtures/row_major_x0.json diff --git a/lib/node_modules/@stdlib/blas/base/dsyr2/test/fixtures/column_major_x0.json b/lib/node_modules/@stdlib/blas/base/dsyr2/test/fixtures/column_major_x0.json new file mode 100644 index 000000000000..feecd4f67108 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr2/test/fixtures/column_major_x0.json @@ -0,0 +1,18 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 0.0, 0.0, 0.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0 ], + "strideY": 1, + "offsetY": 0, + "A": [ 1.0, 1.0, 1.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0 ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A_out": [ 1.0, 1.0, 1.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsyr2/test/fixtures/row_major_x0.json b/lib/node_modules/@stdlib/blas/base/dsyr2/test/fixtures/row_major_x0.json new file mode 100644 index 000000000000..73f6c166cb49 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr2/test/fixtures/row_major_x0.json @@ -0,0 +1,18 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 0.0, 0.0, 0.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0 ], + "strideY": 1, + "offsetY": 0, + "A": [ 1.0, 0.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 3.0 ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "A_out": [ 1.0, 0.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.dsyr2.js b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.dsyr2.js index 6a155a5889dc..35c8b37f1dad 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.dsyr2.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.dsyr2.js @@ -31,6 +31,7 @@ var dsyr2 = require( './../lib/dsyr2.js' ); var ru = require( './fixtures/row_major_u.json' ); var rl = require( './fixtures/row_major_l.json' ); +var rx0 = require( './fixtures/row_major_x0.json' ); var rxpyp = require( './fixtures/row_major_xpyp.json' ); var rxnyp = require( './fixtures/row_major_xnyp.json' ); var rxpyn = require( './fixtures/row_major_xpyn.json' ); @@ -38,6 +39,7 @@ var rxnyn = require( './fixtures/row_major_xnyn.json' ); var cu = require( './fixtures/column_major_u.json' ); var cl = require( './fixtures/column_major_l.json' ); +var cx0 = require( './fixtures/column_major_x0.json' ); var cxpyp = require( './fixtures/column_major_xpyp.json' ); var cxnyp = require( './fixtures/column_major_xnyp.json' ); var cxpyn = require( './fixtures/column_major_xpyn.json' ); @@ -373,6 +375,52 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i t.end(); }); +tape( 'the function supports providing zeros in `x` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = rx0; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.A_out ); + + out = dsyr2( data.order, data.uplo, data.N, data.alpha, x, data.strideX, y, data.strideY, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports providing zeros in `x` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cx0; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.A_out ); + + out = dsyr2( data.order, data.uplo, data.N, data.alpha, x, data.strideX, y, data.strideY, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + tape( 'the function supports specifying strides (row-major)', function test( t ) { var expected; var data; diff --git a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js index c5bc413fcb2a..e5b0cbdeddb7 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js @@ -31,6 +31,7 @@ var dsyr2 = require( './../lib/ndarray.js' ); var ru = require( './fixtures/row_major_u.json' ); var rl = require( './fixtures/row_major_l.json' ); +var rx0 = require( './fixtures/row_major_x0.json' ); var rxpyp = require( './fixtures/row_major_xpyp.json' ); var rxnyp = require( './fixtures/row_major_xnyp.json' ); var rxpyn = require( './fixtures/row_major_xpyn.json' ); @@ -44,6 +45,7 @@ var rcap = require( './fixtures/row_major_complex_access_pattern.json' ); var cu = require( './fixtures/column_major_u.json' ); var cl = require( './fixtures/column_major_l.json' ); +var cx0 = require( './fixtures/column_major_x0.json' ); var cxpyp = require( './fixtures/column_major_xpyp.json' ); var cxnyp = require( './fixtures/column_major_xnyp.json' ); var cxpyn = require( './fixtures/column_major_xpyn.json' ); @@ -331,6 +333,52 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i t.end(); }); +tape( 'the function supports providing zeros in `x` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = rx0; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.A_out ); + + out = dsyr2( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports providing zeros in `x` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cx0; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.A_out ); + + out = dsyr2( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + tape( 'the function supports specifying the strides for the first and the second dimensions of `A` (row-major)', function test( t ) { var expected; var data; From d86f9027d46c1159dabf260244aa1ea40d4e0c8e Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sat, 5 Apr 2025 13:48:25 +0530 Subject: [PATCH 3/5] test: move tests --- 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/dsyr2/test/test.dsyr2.js | 64 +++++++++---------- .../blas/base/dsyr2/test/test.ndarray.js | 64 +++++++++---------- 2 files changed, 64 insertions(+), 64 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.dsyr2.js b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.dsyr2.js index 35c8b37f1dad..23ab41fce88b 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.dsyr2.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.dsyr2.js @@ -302,26 +302,30 @@ tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y t.end(); }); -tape( 'the function returns a reference to the input matrix `A`', function test( t ) { +tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` (row-major, zero-vector)', function test( t ) { + var expected; var data; var out; var a; var x; var y; - data = ru; + data = rx0; a = new Float64Array( data.A ); x = new Float64Array( data.x ); y = new Float64Array( data.y ); + expected = new Float64Array( data.A_out ); + out = dsyr2( data.order, data.uplo, data.N, data.alpha, x, data.strideX, y, data.strideY, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (row-major)', function test( t ) { +tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` (column-major, zero-vector)', function test( t ) { var expected; var data; var out; @@ -329,53 +333,41 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i var x; var y; - data = rl; + data = cx0; a = new Float64Array( data.A ); x = new Float64Array( data.x ); y = new Float64Array( data.y ); - expected = new Float64Array( data.A ); - - out = dsyr2( data.order, data.uplo, 0, data.alpha, x, data.strideX, y, data.strideY, a, data.lda ); - t.strictEqual( out, a, 'returns expected value' ); - t.deepEqual( a, expected, 'returns expected value' ); + expected = new Float64Array( data.A_out ); - out = dsyr2( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, data.strideY, a, data.lda ); + out = dsyr2( data.order, data.uplo, data.N, data.alpha, x, data.strideX, y, data.strideY, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); - t.deepEqual( a, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (column-major)', function test( t ) { - var expected; +tape( 'the function returns a reference to the input matrix `A`', function test( t ) { var data; var out; var a; var x; var y; - data = cl; + data = ru; a = new Float64Array( data.A ); x = new Float64Array( data.x ); y = new Float64Array( data.y ); - expected = new Float64Array( data.A ); - - out = dsyr2( data.order, data.uplo, 0, data.alpha, x, data.strideX, y, data.strideY, a, data.lda ); - t.strictEqual( out, a, 'returns expected value' ); - t.deepEqual( a, expected, 'returns expected value' ); - - out = dsyr2( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, data.strideY, a, data.lda ); + out = dsyr2( data.order, data.uplo, data.N, data.alpha, x, data.strideX, y, data.strideY, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); - t.deepEqual( a, expected, 'returns expected value' ); t.end(); }); -tape( 'the function supports providing zeros in `x` (row-major)', function test( t ) { +tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (row-major)', function test( t ) { var expected; var data; var out; @@ -383,22 +375,26 @@ tape( 'the function supports providing zeros in `x` (row-major)', function test( var x; var y; - data = rx0; + data = rl; a = new Float64Array( data.A ); x = new Float64Array( data.x ); y = new Float64Array( data.y ); - expected = new Float64Array( data.A_out ); + expected = new Float64Array( data.A ); - out = dsyr2( data.order, data.uplo, data.N, data.alpha, x, data.strideX, y, data.strideY, a, data.lda ); + out = dsyr2( data.order, data.uplo, 0, data.alpha, x, data.strideX, y, data.strideY, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + out = dsyr2( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, data.strideY, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); t.end(); }); -tape( 'the function supports providing zeros in `x` (column-major)', function test( t ) { +tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (column-major)', function test( t ) { var expected; var data; var out; @@ -406,17 +402,21 @@ tape( 'the function supports providing zeros in `x` (column-major)', function te var x; var y; - data = cx0; + data = cl; a = new Float64Array( data.A ); x = new Float64Array( data.x ); y = new Float64Array( data.y ); - expected = new Float64Array( data.A_out ); + expected = new Float64Array( data.A ); - out = dsyr2( data.order, data.uplo, data.N, data.alpha, x, data.strideX, y, data.strideY, a, data.lda ); + out = dsyr2( data.order, data.uplo, 0, data.alpha, x, data.strideX, y, data.strideY, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + out = dsyr2( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, data.strideY, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js index e5b0cbdeddb7..2dc43700be3c 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js @@ -260,26 +260,30 @@ tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y t.end(); }); -tape( 'the function returns a reference to the input matrix `A`', function test( t ) { +tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` (row-major, zero-vector)', function test( t ) { + var expected; var data; var out; var a; var x; var y; - data = ru; + data = rx0; a = new Float64Array( data.A ); x = new Float64Array( data.x ); y = new Float64Array( data.y ); + expected = new Float64Array( data.A_out ); + out = dsyr2( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (row-major)', function test( t ) { +tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` (column-major, zero-vector)', function test( t ) { var expected; var data; var out; @@ -287,53 +291,41 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i var x; var y; - data = rl; + data = cx0; a = new Float64Array( data.A ); x = new Float64Array( data.x ); y = new Float64Array( data.y ); - expected = new Float64Array( data.A ); - - out = dsyr2( data.uplo, 0, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); - t.strictEqual( out, a, 'returns expected value' ); - t.deepEqual( a, expected, 'returns expected value' ); + expected = new Float64Array( data.A_out ); - out = dsyr2( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr2( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); - t.deepEqual( a, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (column-major)', function test( t ) { - var expected; +tape( 'the function returns a reference to the input matrix `A`', function test( t ) { var data; var out; var a; var x; var y; - data = cl; + data = ru; a = new Float64Array( data.A ); x = new Float64Array( data.x ); y = new Float64Array( data.y ); - expected = new Float64Array( data.A ); - - out = dsyr2( data.uplo, 0, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); - t.strictEqual( out, a, 'returns expected value' ); - t.deepEqual( a, expected, 'returns expected value' ); - - out = dsyr2( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr2( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); - t.deepEqual( a, expected, 'returns expected value' ); t.end(); }); -tape( 'the function supports providing zeros in `x` (row-major)', function test( t ) { +tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (row-major)', function test( t ) { var expected; var data; var out; @@ -341,22 +333,26 @@ tape( 'the function supports providing zeros in `x` (row-major)', function test( var x; var y; - data = rx0; + data = rl; a = new Float64Array( data.A ); x = new Float64Array( data.x ); y = new Float64Array( data.y ); - expected = new Float64Array( data.A_out ); + expected = new Float64Array( data.A ); - out = dsyr2( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr2( data.uplo, 0, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + out = dsyr2( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); t.end(); }); -tape( 'the function supports providing zeros in `x` (column-major)', function test( t ) { +tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (column-major)', function test( t ) { var expected; var data; var out; @@ -364,17 +360,21 @@ tape( 'the function supports providing zeros in `x` (column-major)', function te var x; var y; - data = cx0; + data = cl; a = new Float64Array( data.A ); x = new Float64Array( data.x ); y = new Float64Array( data.y ); - expected = new Float64Array( data.A_out ); + expected = new Float64Array( data.A ); - out = dsyr2( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr2( data.uplo, 0, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + out = dsyr2( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); t.end(); }); From e9594be8d7e8f6f48d42adc84649bd644b0ab723 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sun, 6 Apr 2025 14:05:32 +0530 Subject: [PATCH 4/5] fix: value inputs Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js index 2dc43700be3c..0da52b924b10 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js @@ -140,7 +140,7 @@ tape( 'the function throws an error if provided an invalid fifth argument', func function badValue( value ) { return function badValue() { - dsyr2( data.uplo, data.N, data.alpha, new Float64Array( data.x ), data.strideX, data.offsetX, new Float64Array( data.y ), value, data.offsetY, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + dsyr2( data.uplo, data.N, data.alpha, new Float64Array( data.x ), value, data.offsetX, new Float64Array( data.y ), data.strideX, data.offsetY, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); }; } }); @@ -163,7 +163,7 @@ tape( 'the function throws an error if provided an invalid eighth argument', fun function badValue( value ) { return function badValue() { - dsyr2( data.uplo, data.N, data.alpha, new Float64Array( data.x ), value, data.offsetX, new Float64Array( data.y ), data.strideY, data.offsetY, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + dsyr2( data.uplo, data.N, data.alpha, new Float64Array( data.x ), data.strideX, data.offsetX, new Float64Array( data.y ), value, data.offsetY, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); }; } }); From dbc1a17a2596ae7a7128770159c27f6136fa59b2 Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 9 Apr 2025 02:33:09 -0700 Subject: [PATCH 5/5] chore: fix variable name Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js index 0da52b924b10..1c76969eec8e 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr2/test/test.ndarray.js @@ -140,7 +140,7 @@ tape( 'the function throws an error if provided an invalid fifth argument', func function badValue( value ) { return function badValue() { - dsyr2( data.uplo, data.N, data.alpha, new Float64Array( data.x ), value, data.offsetX, new Float64Array( data.y ), data.strideX, data.offsetY, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + dsyr2( data.uplo, data.N, data.alpha, new Float64Array( data.x ), value, data.offsetX, new Float64Array( data.y ), data.strideY, data.offsetY, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); }; } });