Skip to content

Commit 7fe33f1

Browse files
committed
test: cover zero-beta branch in ndarray
--- 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 1454451 commit 7fe33f1

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

lib/node_modules/@stdlib/blas/base/cgemv/test/test.ndarray.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,60 @@ tape( 'if `α` is `0`, the function scales the second input vector by `β` (colu
694694
t.end();
695695
});
696696

697+
tape( 'if `α` is `0` and `β` is `0`, the function zeros the second input vector (row-major)', function test( t ) {
698+
var expected;
699+
var alpha;
700+
var data;
701+
var beta;
702+
var out;
703+
var a;
704+
var x;
705+
var y;
706+
707+
data = ra;
708+
709+
a = new Complex64Array( data.A );
710+
x = new Complex64Array( data.x );
711+
y = new Complex64Array( data.y );
712+
713+
alpha = new Complex64( 0.0, 0.0 );
714+
beta = new Complex64( 0.0, 0.0 );
715+
716+
expected = new Complex64Array( data.y.length );
717+
718+
out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY );
719+
t.deepEqual( out, expected, true, 'returns expected value' );
720+
721+
t.end();
722+
});
723+
724+
tape( 'if `α` is `0` and `β` is `0`, the function zeros the second input vector (column-major)', function test( t ) {
725+
var expected;
726+
var alpha;
727+
var data;
728+
var beta;
729+
var out;
730+
var a;
731+
var x;
732+
var y;
733+
734+
data = ca;
735+
736+
a = new Complex64Array( data.A );
737+
x = new Complex64Array( data.x );
738+
y = new Complex64Array( data.y );
739+
740+
alpha = new Complex64( 0.0, 0.0 );
741+
beta = new Complex64( 0.0, 0.0 );
742+
743+
expected = new Complex64Array( data.y.length );
744+
745+
out = cgemv( data.trans, data.M, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY );
746+
t.deepEqual( out, expected, true, 'returns expected value' );
747+
748+
t.end();
749+
});
750+
697751
tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (row-major)', function test( t ) {
698752
var expected;
699753
var alpha;

0 commit comments

Comments
 (0)