Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7a0ef6c
add license
DivitJain26 Apr 13, 2026
6d1f80c
test: add branch 1 fixtures
DivitJain26 Apr 13, 2026
ace9abe
feat: add branch 1 logic
DivitJain26 Apr 13, 2026
d679e24
feat: add branch 2 logic
DivitJain26 Apr 13, 2026
1a64e4f
test: add branch 2 fixtures
DivitJain26 Apr 13, 2026
61b1768
test: add branch 3 fixtures
DivitJain26 Apr 13, 2026
2daf6e0
feat: add branch 3 logic
DivitJain26 Apr 13, 2026
40cd688
feat: add branch 4 logic
DivitJain26 Apr 13, 2026
ffa6fe4
test: add branch 4 fixtures
DivitJain26 Apr 13, 2026
ca3c70a
test: add conjugate transpose case fixtures
DivitJain26 Apr 17, 2026
0eb382c
test: add x offset fixtures
DivitJain26 Apr 17, 2026
c5f461f
test: add vctor stride combination fixtures
DivitJain26 Apr 25, 2026
ca7b85e
test: add A offset fixtures
DivitJain26 Apr 25, 2026
c6df74a
test: add A matix stride combination fixtures
DivitJain26 Apr 25, 2026
e63be68
test: add complex access patterns fixtures
DivitJain26 Apr 25, 2026
78864f1
feat: add wrappers and entry point
DivitJain26 Apr 27, 2026
f19e48a
test: add test suite
DivitJain26 Apr 27, 2026
f12aae0
docs: add types
DivitJain26 Apr 27, 2026
ae00aa2
docs: add types tests
DivitJain26 Apr 27, 2026
4fb42da
docs: add types tests
DivitJain26 Apr 27, 2026
b35329d
docs: add repl file
DivitJain26 Apr 27, 2026
72663af
chore: remove file
DivitJain26 Apr 27, 2026
c43a650
docs: add js example
DivitJain26 Apr 27, 2026
3c2d3fa
bench: add benchmarks
DivitJain26 Apr 27, 2026
fd1d916
docs: add readme
DivitJain26 Apr 27, 2026
5dcb3c8
refactor: improve float 32 precision
DivitJain26 Apr 27, 2026
8e34d55
refactor: update index recalculation to stride addition
DivitJain26 Apr 27, 2026
91fbeed
refactor: update temp subtrction
DivitJain26 Apr 28, 2026
6bbaff7
chore: update spaces to highlight salent operations
DivitJain26 Apr 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
282 changes: 282 additions & 0 deletions lib/node_modules/@stdlib/blas/base/ctbsv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,282 @@
<!--

@license Apache-2.0

Copyright (c) 2026 The Stdlib Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-->

# ctbsv

> Solve one of the systems of equations `x = A*x` or `x = A^T*x` or `x = A^H*x`.


<section class="usage">

## Usage

```javascript
var ctbsv = require( '@stdlib/blas/base/ctbsv' );
```

#### ctbsv( order, uplo, trans, diag, N, K, A, LDA, x, sx )

Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `x = A^H*x` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular band matrix, with ( `K` + 1 ) diagonals.

<!-- eslint-disable max-len -->

```javascript
var Complex64Array = require( '@stdlib/array/complex64' );

var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] );
var x = new Complex64Array( [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] );

ctbsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x, 1 );
// x => <Complex64Array>[ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ]
```

The function has the following parameters:

- **order**: storage layout.
- **uplo**: specifies whether `A` is an upper or lower triangular matrix.
- **trans**: specifies whether `A` should be transposed, conjugate-transposed, or not transposed.
- **diag**: specifies whether `A` has a unit diagonal.
- **N**: number of elements along each dimension of `A`.
- **K**: number of super-diagonals or sub-diagonals of the matrix `A`.
- **A**: input band matrix stored in linear memory as a [`Complex64Array`][@stdlib/array/complex64].
- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`).
- **x**: input [`Complex64Array`][@stdlib/array/complex64].
- **sx**: stride length for `x`.

The stride parameters determine how elements are accessed. For example, to iterate over every other element in `x`,

<!-- eslint-disable max-len -->

```javascript
var Complex64Array = require( '@stdlib/array/complex64' );

var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] );
var x = new Complex64Array( [ 0.0, 2.0, 0.0, 0.0, 0.0, 16.0, 0.0, 0.0, 0.0, 46.0 ] );

ctbsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x, 2 );
// x => <Complex64Array>[ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0 ]
```

Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.

<!-- eslint-disable stdlib/capitalized-comments -->

<!-- eslint-disable max-len -->

```javascript
var Complex64Array = require( '@stdlib/array/complex64' );

// Initial arrays...
var x0 = new Complex64Array( [ 0.0, 0.0, 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] );
var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] );

// Create offset views...
var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd complex element

ctbsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x1, 1 );
// x1 => <Complex64Array>[ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ]
```

<!-- lint disable maximum-heading-length -->

#### ctbsv.ndarray( uplo, trans, diag, N, K, A, sa1, sa2, oa, x, sx, ox )

Solves one of the systems of equations `x = A*x` or `x = A^T*x` or `x = A^H*x`, using alternative indexing semantics and where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular band matrix, with (`K` + 1) diagonals.

<!-- eslint-disable max-len -->

```javascript
var Complex64Array = require( '@stdlib/array/complex64' );

var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] );
var x = new Complex64Array( [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] );

ctbsv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, 1, 0, x, 1, 0 );
// x => <Complex64Array>[ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ]
```

The function has the following additional parameters:

- **sa1**: stride of the first dimension of `A`.
- **sa2**: stride of the second dimension of `A`.
- **oa**: starting index for `A`.
- **ox**: starting index for `x`.

While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example,

<!-- eslint-disable max-len -->

```javascript
var Complex64Array = require( '@stdlib/array/complex64' );

var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] );
var x = new Complex64Array( [ 0.0, 46.0, 0.0, 16.0, 0.0, 2.0 ] );

ctbsv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, 1, 0, x, -1, 2 );
// x => <Complex64Array>[ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ]
```

</section>

<!-- /.usage -->

<section class="notes">

## Notes

- `ctbsv()` corresponds to the [BLAS][blas] level 2 function [`ctbsv`][ctbsv].

</section>

<!-- /.notes -->

<section class="examples">

## Examples

<!-- eslint no-undef: "error" -->

<!-- eslint-disable max-len -->

```javascript
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
var Complex64 = require( '@stdlib/complex/float32/ctor' );
var filledarrayBy = require( '@stdlib/array/filled-by' );
var logEach = require( '@stdlib/console/log-each' );
var ctbsv = require( '@stdlib/blas/base/ctbsv' );

function rand() {
return new Complex64( discreteUniform( 0, 255 ), discreteUniform( -128, 127 ) );
}

var N = 3;
var K = 1;

var A = filledarrayBy( (K+1)*N, 'complex64', rand );
var x = filledarrayBy( N, 'complex64', rand );

ctbsv( 'row-major', 'lower', 'no-transpose', 'non-unit', N, 1, A, (K+1), x, 1 );

// Print the results:
logEach( '%s', x );

ctbsv.ndarray( 'lower', 'no-transpose', 'non-unit', N, 1, A, (K+1), 1, 0, x, 2, 1 );

// Print the results:
logEach( '%s', x );
```

</section>

<!-- /.examples -->

<!-- C interface documentation. -->

* * *

<section class="c">

## C APIs

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- C usage documentation. -->

<section class="usage">

### Usage

```c
TODO
```

#### TODO

TODO.

```c
TODO
```

TODO

```c
TODO
```

</section>

<!-- /.usage -->

<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="notes">

</section>

<!-- /.notes -->

<!-- C API usage examples. -->

<section class="examples">

### Examples

```c
TODO
```

</section>

<!-- /.examples -->

</section>

<!-- /.c -->

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">

</section>

<!-- /.related -->

<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="links">

[blas]: http://www.netlib.org/blas

[ctbsv]: https://www.netlib.org/lapack/explore-html/d4/dcd/group__tbsv_gaaac28899b66867490cef87edff06f081.html#gaaac28899b66867490cef87edff06f081

[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray

[@stdlib/array/complex64]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/complex64

</section>

<!-- /.links -->
Loading