Skip to content

Commit b9d086e

Browse files
committed
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 ---
1 parent 14e8744 commit b9d086e

File tree

4 files changed

+188
-0
lines changed

4 files changed

+188
-0
lines changed

lib/node_modules/@stdlib/blas/base/dgemv/test/test.dgemv.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
var tape = require( 'tape' );
2626
var Float64Array = require( '@stdlib/array/float64' );
27+
var zeros = require( '@stdlib/array/zeros' );
2728
var dgemv = require( './../lib/dgemv.js' );
2829

2930

@@ -462,6 +463,52 @@ tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vec
462463
t.end();
463464
});
464465

466+
tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) {
467+
var expected;
468+
var data;
469+
var out;
470+
var a;
471+
var x;
472+
var y;
473+
474+
data = rt;
475+
476+
a = new Float64Array( data.A );
477+
x = zeros( 3 );
478+
y = new Float64Array( data.y );
479+
480+
expected = new Float64Array( data.y );
481+
482+
out = dgemv( data.order, data.trans, data.M, data.N, data.alpha, a, data.lda, x, data.strideX, 1.0, y, data.strideY );
483+
t.strictEqual( out, y, 'returns expected value' );
484+
t.deepEqual( out, expected, 'returns expected value' );
485+
486+
t.end();
487+
});
488+
489+
tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (column-major)', function test( t ) {
490+
var expected;
491+
var data;
492+
var out;
493+
var a;
494+
var x;
495+
var y;
496+
497+
data = ct;
498+
499+
a = new Float64Array( data.A );
500+
x = zeros( 3 );
501+
y = new Float64Array( data.y );
502+
503+
expected = new Float64Array( data.y );
504+
505+
out = dgemv( data.order, data.trans, data.M, data.N, data.alpha, a, data.lda, x, data.strideX, 1.0, y, data.strideY );
506+
t.strictEqual( out, y, 'returns expected value' );
507+
t.deepEqual( out, expected, 'returns expected value' );
508+
509+
t.end();
510+
});
511+
465512
tape( 'if `α` is `0`, the function scales the second input vector by `β` (row-major)', function test( t ) {
466513
var expected;
467514
var data;

lib/node_modules/@stdlib/blas/base/dgemv/test/test.dgemv.native.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
var resolve = require( 'path' ).resolve;
2626
var tape = require( 'tape' );
27+
var zeros = require( '@stdlib/array/zeros' );
2728
var Float64Array = require( '@stdlib/array/float64' );
2829
var tryRequire = require( '@stdlib/utils/try-require' );
2930

@@ -444,6 +445,52 @@ tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vec
444445
t.end();
445446
});
446447

448+
tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (row-major)', opts, function test( t ) {
449+
var expected;
450+
var data;
451+
var out;
452+
var a;
453+
var x;
454+
var y;
455+
456+
data = rt;
457+
458+
a = new Float64Array( data.A );
459+
x = zeros( 3 );
460+
y = new Float64Array( data.y );
461+
462+
expected = new Float64Array( data.y );
463+
464+
out = dgemv( data.order, data.trans, data.M, data.N, data.alpha, a, data.lda, x, data.strideX, 1.0, y, data.strideY );
465+
t.strictEqual( out, y, 'returns expected value' );
466+
t.deepEqual( out, expected, 'returns expected value' );
467+
468+
t.end();
469+
});
470+
471+
tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (column-major)', opts, function test( t ) {
472+
var expected;
473+
var data;
474+
var out;
475+
var a;
476+
var x;
477+
var y;
478+
479+
data = ct;
480+
481+
a = new Float64Array( data.A );
482+
x = zeros( 3 );
483+
y = new Float64Array( data.y );
484+
485+
expected = new Float64Array( data.y );
486+
487+
out = dgemv( data.order, data.trans, data.M, data.N, data.alpha, a, data.lda, x, data.strideX, 1.0, y, data.strideY );
488+
t.strictEqual( out, y, 'returns expected value' );
489+
t.deepEqual( out, expected, 'returns expected value' );
490+
491+
t.end();
492+
});
493+
447494
tape( 'if `α` is `0`, the function scales the second input vector by `β` (row-major)', opts, function test( t ) {
448495
var expected;
449496
var data;

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

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
// MODULES //
2424

2525
var tape = require( 'tape' );
26+
var zeros = require( '@stdlib/array/zeros' );
2627
var Float64Array = require( '@stdlib/array/float64' );
2728
var dgemv = require( './../lib/ndarray.js' );
2829

@@ -421,6 +422,52 @@ tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vec
421422
t.end();
422423
});
423424

425+
tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) {
426+
var expected;
427+
var data;
428+
var out;
429+
var a;
430+
var x;
431+
var y;
432+
433+
data = rt;
434+
435+
a = new Float64Array( data.A );
436+
x = zeros( 3 );
437+
y = new Float64Array( data.y );
438+
439+
expected = new Float64Array( data.y );
440+
441+
out = dgemv( data.trans, data.M, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, 1.0, y, data.strideY, data.offsetY );
442+
t.strictEqual( out, y, 'returns expected value' );
443+
t.deepEqual( out, expected, 'returns expected value' );
444+
445+
t.end();
446+
});
447+
448+
tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (column-major)', function test( t ) {
449+
var expected;
450+
var data;
451+
var out;
452+
var a;
453+
var x;
454+
var y;
455+
456+
data = ct;
457+
458+
a = new Float64Array( data.A );
459+
x = zeros( 3 );
460+
y = new Float64Array( data.y );
461+
462+
expected = new Float64Array( data.y );
463+
464+
out = dgemv( data.trans, data.M, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, 1.0, y, data.strideY, data.offsetY );
465+
t.strictEqual( out, y, 'returns expected value' );
466+
t.deepEqual( out, expected, 'returns expected value' );
467+
468+
t.end();
469+
});
470+
424471
tape( 'if `α` is `0`, the function scales the second input vector by `β` (row-major)', function test( t ) {
425472
var expected;
426473
var data;

lib/node_modules/@stdlib/blas/base/dgemv/test/test.ndarray.native.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
var resolve = require( 'path' ).resolve;
2626
var tape = require( 'tape' );
27+
var zeros = require( '@stdlib/array/zeros' );
2728
var Float64Array = require( '@stdlib/array/float64' );
2829
var tryRequire = require( '@stdlib/utils/try-require' );
2930

@@ -430,6 +431,52 @@ tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vec
430431
t.end();
431432
});
432433

434+
tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (row-major)', opts, function test( t ) {
435+
var expected;
436+
var data;
437+
var out;
438+
var a;
439+
var x;
440+
var y;
441+
442+
data = rt;
443+
444+
a = new Float64Array( data.A );
445+
x = zeros( 3 );
446+
y = new Float64Array( data.y );
447+
448+
expected = new Float64Array( data.y );
449+
450+
out = dgemv( data.trans, data.M, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, 1.0, y, data.strideY, data.offsetY );
451+
t.strictEqual( out, y, 'returns expected value' );
452+
t.deepEqual( out, expected, 'returns expected value' );
453+
454+
t.end();
455+
});
456+
457+
tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (column-major)', opts, function test( t ) {
458+
var expected;
459+
var data;
460+
var out;
461+
var a;
462+
var x;
463+
var y;
464+
465+
data = ct;
466+
467+
a = new Float64Array( data.A );
468+
x = zeros( 3 );
469+
y = new Float64Array( data.y );
470+
471+
expected = new Float64Array( data.y );
472+
473+
out = dgemv( data.trans, data.M, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, 1.0, y, data.strideY, data.offsetY );
474+
t.strictEqual( out, y, 'returns expected value' );
475+
t.deepEqual( out, expected, 'returns expected value' );
476+
477+
t.end();
478+
});
479+
433480
tape( 'if `α` is `0`, the function scales the second input vector by `β` (row-major)', opts, function test( t ) {
434481
var expected;
435482
var data;

0 commit comments

Comments
 (0)