Skip to content

Commit 4b9486d

Browse files
committed
feat: add blas/base/ctrsv
1 parent 5950cdf commit 4b9486d

7 files changed

Lines changed: 78 additions & 70 deletions

File tree

lib/node_modules/@stdlib/blas/base/ctrsv/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,12 @@ var opts = {
151151

152152
var N = 5;
153153

154-
var A = new Complex64Array( discreteUniform( N * N * 2, -10.0, 10.0, opts ).buffer );
155-
var x = new Complex64Array( discreteUniform( N * 2, -10.0, 10.0, opts ).buffer );
154+
var A = new Complex64Array(
155+
discreteUniform( N * N * 2, -10.0, 10.0, opts ).buffer
156+
);
157+
var x = new Complex64Array(
158+
discreteUniform( N * 2, -10.0, 10.0, opts ).buffer
159+
);
156160

157161
ctrsv( 'column-major', 'upper', 'no-transpose', 'unit', N, A, N, x, 1 );
158162
console.log( x );

lib/node_modules/@stdlib/blas/base/ctrsv/docs/repl.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
{{alias}}( ord, uplo, trans, diag, N, A, lda, x, sx )
3-
Solves one of the systems of equations `A*x = b`, `A^T*x = b`, or `A^H*x = b`
3+
Solves one of the systems of equations `A*x = b`, `A^T*x = b`, or
4+
`A^H*x = b`
45
where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or
56
non-unit, upper or lower triangular matrix.
67

@@ -49,13 +50,16 @@
4950
Examples
5051
--------
5152
> var x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 1.0, 1.0, 1.0 ] );
52-
> var A = new {{alias:@stdlib/array/complex64}}( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 1.0, 0.0 ] );
53+
> var A = new {{alias:@stdlib/array/complex64}}(
54+
... [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 1.0, 0.0 ]
55+
... );
5356
> {{alias}}( 'row-major', 'upper', 'no-transpose', 'unit', 2, A, 2, x, 1 )
5457
<Complex64Array>[ -1.0, -1.0, 1.0, 1.0 ]
5558

5659

5760
{{alias}}.ndarray( uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox )
58-
Solves one of the systems of equations `A*x = b`, `A^T*x = b`, or `A^H*x = b`, using
61+
Solves one of the systems of equations `A*x = b`, `A^T*x = b`, or
62+
`A^H*x = b`, using
5963
alternative indexing semantics and where `b` and `x` are `N` element vectors
6064
and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular
6165
matrix.
@@ -108,7 +112,9 @@
108112
Examples
109113
--------
110114
> var x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 1.0, 1.0, 1.0 ] );
111-
> var A = new {{alias:@stdlib/array/complex64}}( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 1.0, 0.0 ] );
115+
> var A = new {{alias:@stdlib/array/complex64}}(
116+
... [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 1.0, 0.0 ]
117+
... );
112118
> var uplo = 'upper';
113119
> var trans = 'no-transpose';
114120
> {{alias}}.ndarray( uplo, trans, 'unit', 2, A, 2, 1, 0, x, 1, 0 )

lib/node_modules/@stdlib/blas/base/ctrsv/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2026 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

lib/node_modules/@stdlib/blas/base/ctrsv/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2026 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

lib/node_modules/@stdlib/blas/base/ctrsv/lib/ndarray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2026 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

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

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2026 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -42,7 +42,6 @@ var rutnu = require( './fixtures/row_major_u_t_nu.json' );
4242
var rutu = require( './fixtures/row_major_u_t_u.json' );
4343
var rxp = require( './fixtures/row_major_xp.json' );
4444
var rxn = require( './fixtures/row_major_xn.json' );
45-
4645
var clntnu = require( './fixtures/column_major_l_nt_nu.json' );
4746
var cltnu = require( './fixtures/column_major_l_t_nu.json' );
4847
var clntu = require( './fixtures/column_major_l_nt_u.json' );
@@ -294,7 +293,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
294293

295294
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
296295
t.strictEqual( out, x, 'returns expected value' );
297-
296+
298297
viewOut = new Float32Array( out.buffer );
299298
isApprox( t, viewOut, expected, 100.0 );
300299

@@ -318,7 +317,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
318317

319318
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
320319
t.strictEqual( out, x, 'returns expected value' );
321-
320+
322321
viewOut = new Float32Array( out.buffer );
323322
isApprox( t, viewOut, expected, 100.0 );
324323

@@ -342,7 +341,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
342341

343342
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
344343
t.strictEqual( out, x, 'returns expected value' );
345-
344+
346345
viewOut = new Float32Array( out.buffer );
347346
isApprox( t, viewOut, expected, 100.0 );
348347

@@ -366,7 +365,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
366365

367366
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
368367
t.strictEqual( out, x, 'returns expected value' );
369-
368+
370369
viewOut = new Float32Array( out.buffer );
371370
isApprox( t, viewOut, expected, 100.0 );
372371

@@ -390,7 +389,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
390389

391390
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
392391
t.strictEqual( out, x, 'returns expected value' );
393-
392+
394393
viewOut = new Float32Array( out.buffer );
395394
isApprox( t, viewOut, expected, 100.0 );
396395

@@ -414,7 +413,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
414413

415414
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
416415
t.strictEqual( out, x, 'returns expected value' );
417-
416+
418417
viewOut = new Float32Array( out.buffer );
419418
isApprox( t, viewOut, expected, 100.0 );
420419

@@ -438,7 +437,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
438437

439438
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
440439
t.strictEqual( out, x, 'returns expected value' );
441-
440+
442441
viewOut = new Float32Array( out.buffer );
443442
isApprox( t, viewOut, expected, 100.0 );
444443

@@ -462,7 +461,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
462461

463462
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
464463
t.strictEqual( out, x, 'returns expected value' );
465-
464+
466465
viewOut = new Float32Array( out.buffer );
467466
isApprox( t, viewOut, expected, 100.0 );
468467

@@ -486,7 +485,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
486485

487486
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
488487
t.strictEqual( out, x, 'returns expected value' );
489-
488+
490489
viewOut = new Float32Array( out.buffer );
491490
isApprox( t, viewOut, expected, 100.0 );
492491

@@ -510,7 +509,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
510509

511510
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
512511
t.strictEqual( out, x, 'returns expected value' );
513-
512+
514513
viewOut = new Float32Array( out.buffer );
515514
isApprox( t, viewOut, expected, 100.0 );
516515

@@ -534,7 +533,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
534533

535534
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
536535
t.strictEqual( out, x, 'returns expected value' );
537-
536+
538537
viewOut = new Float32Array( out.buffer );
539538
isApprox( t, viewOut, expected, 100.0 );
540539

@@ -558,7 +557,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
558557

559558
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
560559
t.strictEqual( out, x, 'returns expected value' );
561-
560+
562561
viewOut = new Float32Array( out.buffer );
563562
isApprox( t, viewOut, expected, 100.0 );
564563

@@ -582,7 +581,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
582581

583582
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
584583
t.strictEqual( out, x, 'returns expected value' );
585-
584+
586585
viewOut = new Float32Array( out.buffer );
587586
isApprox( t, viewOut, expected, 100.0 );
588587

@@ -606,7 +605,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
606605

607606
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
608607
t.strictEqual( out, x, 'returns expected value' );
609-
608+
610609
viewOut = new Float32Array( out.buffer );
611610
isApprox( t, viewOut, expected, 100.0 );
612611

@@ -630,7 +629,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
630629

631630
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
632631
t.strictEqual( out, x, 'returns expected value' );
633-
632+
634633
viewOut = new Float32Array( out.buffer );
635634
isApprox( t, viewOut, expected, 100.0 );
636635

@@ -654,7 +653,7 @@ tape( 'the function solves one of the systems of equations `A*x = b`, `A^T*x = b
654653

655654
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
656655
t.strictEqual( out, x, 'returns expected value' );
657-
656+
658657
viewOut = new Float32Array( out.buffer );
659658
isApprox( t, viewOut, expected, 100.0 );
660659

@@ -678,7 +677,7 @@ tape( 'the function supports specifying an `x` stride (row-major)', function tes
678677

679678
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
680679
t.strictEqual( out, x, 'returns expected value' );
681-
680+
682681
viewOut = new Float32Array( out.buffer );
683682
isApprox( t, viewOut, expected, 100.0 );
684683

@@ -702,7 +701,7 @@ tape( 'the function supports specifying an `x` stride (column-major)', function
702701

703702
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
704703
t.strictEqual( out, x, 'returns expected value' );
705-
704+
706705
viewOut = new Float32Array( out.buffer );
707706
isApprox( t, viewOut, expected, 100.0 );
708707

@@ -743,7 +742,7 @@ tape( 'if `N` is zero, the function returns the input vector unchanged (row-majo
743742

744743
out = ctrsv( data.order, data.uplo, data.trans, data.diag, 0, a, data.LDA, x, data.strideX );
745744
t.strictEqual( out, x, 'returns expected value' );
746-
745+
747746
viewOut = new Float32Array( out.buffer );
748747
t.deepEqual( viewOut, expected, 'returns expected value' );
749748

@@ -767,7 +766,7 @@ tape( 'if `N` is zero, the function returns the input vector unchanged (column-m
767766

768767
out = ctrsv( data.order, data.uplo, data.trans, data.diag, 0, a, data.LDA, x, data.strideX );
769768
t.strictEqual( out, x, 'returns expected value' );
770-
769+
771770
viewOut = new Float32Array( out.buffer );
772771
t.deepEqual( viewOut, expected, 'returns expected value' );
773772

@@ -791,7 +790,7 @@ tape( 'the function supports a negative `x` stride (row-major)', function test(
791790

792791
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
793792
t.strictEqual( out, x, 'returns expected value' );
794-
793+
795794
viewOut = new Float32Array( out.buffer );
796795
isApprox( t, viewOut, expected, 100.0 );
797796

@@ -815,7 +814,7 @@ tape( 'the function supports a negative `x` stride (column-major)', function tes
815814

816815
out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX );
817816
t.strictEqual( out, x, 'returns expected value' );
818-
817+
819818
viewOut = new Float32Array( out.buffer );
820819
isApprox( t, viewOut, expected, 100.0 );
821820

0 commit comments

Comments
 (0)