Skip to content

Commit cfbcdaf

Browse files
committed
test: add test cases for c and s
--- 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed ---
1 parent 70f4077 commit cfbcdaf

File tree

2 files changed

+181
-1
lines changed

2 files changed

+181
-1
lines changed

lib/node_modules/@stdlib/lapack/base/dlartv/test/test.dlartv.js

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,42 @@ tape( 'the function supports a `y` stride', function test( t ) {
317317
t.end();
318318
});
319319

320+
tape( 'the function supports a `cs` stride', function test( t ) {
321+
var xe;
322+
var ye;
323+
var c;
324+
var s;
325+
var x;
326+
var y;
327+
328+
x = new Float64Array([
329+
1.0, // 0
330+
2.0,
331+
3.0, // 1
332+
4.0,
333+
5.0
334+
]);
335+
y = new Float64Array([
336+
6.0, // 0
337+
7.0, // 1
338+
8.0,
339+
9.0,
340+
10.0
341+
]);
342+
c = new Float64Array( [ 0.8, 0.8 ] );
343+
s = new Float64Array( [ 0.6, 0.6 ] );
344+
345+
dlartv( 2, x, 2, y, 1, c, s, -1 );
346+
347+
xe = new Float64Array( [ 4.4, 2.0, 6.6, 4.0, 5.0 ] );
348+
ye = new Float64Array( [ 4.2, 3.8, 8.0, 9.0, 10.0 ] );
349+
350+
isApprox( t, x, xe, 2.0 );
351+
isApprox( t, y, ye, 2.0 );
352+
353+
t.end();
354+
});
355+
320356
tape( 'the function returns a reference to the second input array', function test( t ) {
321357
var out;
322358
var x;
@@ -360,7 +396,7 @@ tape( 'the function supports negative strides', function test( t ) {
360396
c = new Float64Array( [ 0.8, 0.8, 0.8, 0.8 ] );
361397
s = new Float64Array( [ 0.6, 0.6, 0.6, 0.6 ] );
362398

363-
dlartv( 4, x, -2, y, 1, c, s, 1 );
399+
dlartv( 4, x, -2, y, 1, c, s, -1 );
364400

365401
xe = new Float64Array( [ 0.9, 0.1, -0.22, 0.8, 0.18, -0.3, -0.02 ] );
366402
ye = new Float64Array( [ 0.64, -1.26, 0.54, 0.2, -0.6, 0.2, 0.8 ] );

lib/node_modules/@stdlib/lapack/base/dlartv/test/test.ndarray.js

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,150 @@ tape( 'the function supports a `y` offset', function test( t ) {
410410
t.end();
411411
});
412412

413+
tape( 'the function supports a `c` stride', function test( t ) {
414+
var xe;
415+
var ye;
416+
var c;
417+
var s;
418+
var x;
419+
var y;
420+
421+
x = new Float64Array([
422+
1.0, // 0
423+
3.0, // 1
424+
5.0,
425+
7.0,
426+
9.0
427+
]);
428+
y = new Float64Array([
429+
6.0, // 0
430+
7.0, // 1
431+
8.0,
432+
9.0,
433+
10.0
434+
]);
435+
c = new Float64Array( [ 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8 ] );
436+
s = new Float64Array( [ 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6 ] );
437+
438+
dlartv( 2, x, 1, 0, y, 1, 0, c, 2, 0, s, 1, 0 );
439+
440+
xe = new Float64Array( [ 4.4, 6.6, 5.0, 7.0, 9.0 ] );
441+
ye = new Float64Array( [ 4.2, 3.8, 8.0, 9.0, 10.0 ] );
442+
443+
isApprox( t, x, xe, 2.0 );
444+
isApprox( t, y, ye, 2.0 );
445+
446+
t.end();
447+
});
448+
449+
tape( 'the function supports a `c` offset', function test( t ) {
450+
var xe;
451+
var ye;
452+
var c;
453+
var s;
454+
var x;
455+
var y;
456+
457+
x = new Float64Array([
458+
1.0,
459+
2.0, // 0
460+
3.0, // 1
461+
4.0,
462+
5.0
463+
]);
464+
y = new Float64Array([
465+
6.0, // 0
466+
7.0, // 1
467+
8.0,
468+
9.0,
469+
10.0
470+
]);
471+
c = new Float64Array( [ 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8 ] );
472+
s = new Float64Array( [ 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6 ] );
473+
474+
dlartv( 2, x, 1, 1, y, 1, 0, c, 1, 1, s, 1, 0 );
475+
476+
xe = new Float64Array( [ 1.0, 5.2, 6.6, 4.0, 5.0 ] );
477+
ye = new Float64Array( [ 3.6, 3.8, 8.0, 9.0, 10.0 ] );
478+
479+
isApprox( t, x, xe, 2.0 );
480+
isApprox( t, y, ye, 2.0 );
481+
482+
t.end();
483+
});
484+
485+
tape( 'the function supports an `s` stride', function test( t ) {
486+
var xe;
487+
var ye;
488+
var c;
489+
var s;
490+
var x;
491+
var y;
492+
493+
x = new Float64Array([
494+
1.0, // 0
495+
3.0, // 1
496+
5.0,
497+
7.0,
498+
9.0
499+
]);
500+
y = new Float64Array([
501+
6.0, // 0
502+
7.0, // 1
503+
8.0,
504+
9.0,
505+
10.0
506+
]);
507+
c = new Float64Array( [ 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8 ] );
508+
s = new Float64Array( [ 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6 ] );
509+
510+
dlartv( 2, x, 1, 0, y, 1, 0, c, 1, 0, s, 2, 0 );
511+
512+
xe = new Float64Array( [ 4.4, 6.6, 5.0, 7.0, 9.0 ] );
513+
ye = new Float64Array( [ 4.2, 3.8, 8.0, 9.0, 10.0 ] );
514+
515+
isApprox( t, x, xe, 2.0 );
516+
isApprox( t, y, ye, 2.0 );
517+
518+
t.end();
519+
});
520+
521+
tape( 'the function supports an `s` offset', function test( t ) {
522+
var xe;
523+
var ye;
524+
var c;
525+
var s;
526+
var x;
527+
var y;
528+
529+
x = new Float64Array([
530+
1.0,
531+
2.0, // 0
532+
3.0, // 1
533+
4.0,
534+
5.0
535+
]);
536+
y = new Float64Array([
537+
6.0, // 0
538+
7.0, // 1
539+
8.0,
540+
9.0,
541+
10.0
542+
]);
543+
c = new Float64Array( [ 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8 ] );
544+
s = new Float64Array( [ 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6 ] );
545+
546+
dlartv( 2, x, 1, 1, y, 1, 0, c, 1, 0, s, 1, 1 );
547+
548+
xe = new Float64Array( [ 1.0, 5.2, 6.6, 4.0, 5.0 ] );
549+
ye = new Float64Array( [ 3.6, 3.8, 8.0, 9.0, 10.0 ] );
550+
551+
isApprox( t, x, xe, 2.0 );
552+
isApprox( t, y, ye, 2.0 );
553+
554+
t.end();
555+
});
556+
413557
tape( 'the function returns a reference to the second input array', function test( t ) {
414558
var out;
415559
var c;

0 commit comments

Comments
 (0)