Skip to content
Open
Changes from 1 commit
Commits
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
Prev Previous commit
docs: add readme
---
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: passed
  - 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: na
  - 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: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
  • Loading branch information
DivitJain26 committed May 6, 2026
commit 84ab65b46d48f25fcac10ba6c76758696de14cbd
279 changes: 279 additions & 0 deletions lib/node_modules/@stdlib/blas/base/ztpmv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
<!--

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

-->

# ztpmv

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

#### ztpmv( order, uplo, trans, diag, N, AP, 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 matrix, supplied in packed form.


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

```javascript
var Complex128Array = require( '@stdlib/array/complex128' );

var AP = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 4.0, 4.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] );
var x = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );

ztpmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, x, 1 );
// x => <Complex128Array>[ 0.0, 2.0, 0.0, 20.0, 0.0, 62.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`.
- **AP**: input matrix in packed form stored in linear memory as a [`Complex128Array`][@stdlib/array/complex128].
- **x**: input vector [`Complex128Array`][@stdlib/array/complex128].
- **sx**: stride length for `x`.

The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order,

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

```javascript
var Complex128Array = require( '@stdlib/array/complex128' );

var AP = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 4.0, 4.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] );
var x = new Complex128Array( [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0 ] );

ztpmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, x, 2 );
// x => <Complex128Array>[ 0.0, 2.0, 0.0, 0.0, 0.0, 20.0, 0.0, 0.0, 0.0, 62.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 Complex128Array = require( '@stdlib/array/complex128' );
var Complex128 = require( '@stdlib/complex/float64/ctor' );

// Initial arrays...
var x0 = new Complex128Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
var AP = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 4.0, 4.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] );

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

ztpmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, x1, 1 );
// x1 => <Complex128Array>[ 0.0, 2.0, 0.0, 20.0, 0.0, 62.0 ]
```

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

#### ztpmv.ndarray( order, uplo, trans, diag, N, AP, sap, oap, 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 complex vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix, supplied in packed form.

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

```javascript
var Complex128Array = require( '@stdlib/array/complex128' );

var AP = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 4.0, 4.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] );
var x = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );

ztpmv.ndarray( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, 1, 0, x, 1, 0 );
// x => <Complex128Array>[ 0.0, 2.0, 0.0, 20.0, 0.0, 62.0 ]
```

The function has the following additional parameters:

- **sap**: `AP` stride length
- **oap**: starting index for `AP`.
- **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 Complex128Array = require( '@stdlib/array/complex128' );

var AP = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 4.0, 4.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] );
var x = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] );

ztpmv.ndarray( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, 1, 0, x, -1, 2 );
// x => <Complex128Array>[ 0.0, 62.0, 0.0, 20.0, 0.0, 2.0 ]
```

</section>

<!-- /.usage -->

<section class="notes">

## Notes

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

</section>

<!-- /.notes -->

<section class="examples">

## Examples

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

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

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

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

var N = 5;

var AP = filledarrayBy( N*(N+1)/2, 'complex128', rand );
var x = filledarrayBy( N, 'complex128', rand );

ztpmv( 'column-major', 'lower', 'no-transpose', 'non-unit', N, AP, x, 1 );

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

ztpmv.ndarray( 'row-major', 'upper', 'transpose', 'unit', N, AP, 1, 0, x, 1, 0 );

// 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

[ztpmv]: https://netlib.org/lapack/explore-html/db/d62/group__tpmv_gacbf0ca8bf0b638cc1df58818ae8a5614.html

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

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

</section>

<!-- /.links -->
Loading