Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ee217c8
docs: add lisence
DivitJain26 Apr 3, 2026
b322395
test: add branch 1 fixtures
DivitJain26 Apr 4, 2026
d7caba1
test: add branch 2 fixtures
DivitJain26 Apr 4, 2026
834ffe8
feat: add branch 2 logic in base
DivitJain26 Apr 4, 2026
e0c846d
test: add branch 3 fixtures
DivitJain26 Apr 4, 2026
b019f9b
feat: add branch 3 logic in base
DivitJain26 Apr 4, 2026
a77bf32
test: add branch 4 fixtures
DivitJain26 Apr 4, 2026
aca0e20
feat: add branch 4 logic in base
DivitJain26 Apr 4, 2026
1ed2415
feat: fix example
DivitJain26 Apr 4, 2026
8a2f945
refactor: updated m in 2nd branch
DivitJain26 Apr 4, 2026
b2610ff
test: add conjugate-transpose fixtures
DivitJain26 Apr 5, 2026
e127337
test: add input vector stride fixtures
DivitJain26 Apr 5, 2026
6c3bb27
test: add matix offset fixtures
DivitJain26 Apr 5, 2026
3fd1627
test: add matrix sride fixtures
DivitJain26 Apr 5, 2026
ee8d259
test: add complex access pattern fixtures
DivitJain26 Apr 5, 2026
1fcfc04
refactor: update branch 1 and 2 logic
DivitJain26 Apr 5, 2026
313171e
refactor: update oa2
DivitJain26 Apr 6, 2026
7faca74
feat: add wrapers and entry point
DivitJain26 Apr 6, 2026
6cde369
chore: update cc year
DivitJain26 Apr 6, 2026
ed986b0
test: add test suite
DivitJain26 Apr 7, 2026
e96d8d8
chore: remove unused import
DivitJain26 Apr 8, 2026
9533e08
docs: add types and repl file
DivitJain26 Apr 8, 2026
84c1054
docs: add example
DivitJain26 Apr 8, 2026
671c703
bench: add benchmark
DivitJain26 Apr 8, 2026
b1c43bc
docs: add readme file
DivitJain26 Apr 8, 2026
d75ac88
fix: fix readme file
DivitJain26 Apr 11, 2026
16b2fbc
test: update validation
DivitJain26 Apr 15, 2026
68fa429
refactor: improve float32 precision for addition assignment
DivitJain26 Apr 16, 2026
e5b8e48
refactor: update index recalculation to stride addition
DivitJain26 Apr 16, 2026
9bb4a13
chore: clean up
DivitJain26 Apr 16, 2026
645fca8
chore: clean up in benchmarks
DivitJain26 Apr 18, 2026
046181e
chore: clean up in docs
DivitJain26 Apr 18, 2026
3055c04
chore: clean up in example
DivitJain26 Apr 18, 2026
edd6930
chore: clean up in lib
DivitJain26 Apr 18, 2026
a3af626
chore: clean up in readme
DivitJain26 Apr 18, 2026
6b4ee64
chore: clean up in lib
DivitJain26 Apr 18, 2026
c136eec
chore: clean up
DivitJain26 Apr 21, 2026
456f8ad
chore: match example with text
DivitJain26 Apr 21, 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/ctbmv/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.

-->

# ctbmv

> Perform one of the matrix-vector operations `x = A*x` or `x = A^T*x` or `x = A^H*x`.


<section class="usage">

## Usage

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

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

Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x` or `x = A^H*x` 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( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );

ctbmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x, 1 );
// x => <Complex64Array>[ 0.0, 2.0, 0.0, 16.0, 0.0, 46.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]. The band matrix is first stored in compact band form, where only the diagonals within the bandwidth are kept, and is then laid out sequentially in linear memory.
- **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( [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0 ] );

ctbmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x, 2 );
// x => <Complex64Array>[ 0.0, 2.0, 0.0, 0.0, 0.0, 16.0, 0.0, 0.0, 0.0, 46.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, 1.0, 1.0, 2.0, 2.0, 3.0, 3.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

ctbmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x1, 1 );
// x1 => <Complex64Array>[ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ]
```

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

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

Performs one of the matrix-vector operations `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( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );

ctbmv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, 1, 0, x, 1, 0 );
// x => <Complex64Array>[ 0.0, 2.0, 0.0, 16.0, 0.0, 46.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( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] );

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

</section>

<!-- /.usage -->

<section class="notes">

## Notes

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

</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 ctbmv = require( '@stdlib/blas/base/ctbmv' );

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 );

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

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

ctbmv.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

[ctbmv]: https://www.netlib.org/lapack/explore-html/d6/d9f/group__tbmv_ga6f3fad3e45c4506a0ee0278d95edd6a3.html#ga6f3fad3e45c4506a0ee0278d95edd6a3

[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