Skip to content
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 10, 2026
commit 7f718c07827e49bce037894a72a6f3eceb0aaf30
279 changes: 279 additions & 0 deletions lib/node_modules/@stdlib/blas/base/ctpsv/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.

-->

# ctpsv

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

<section class="usage">

## Usage

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

#### ctpsv( order, uplo, trans, diag, N, AP, x, sx )

Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b`, where `b` and `x` are `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 Complex64Array = require( '@stdlib/array/complex64' );

var AP = new Complex64Array( [ 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 Complex64Array( [ 0.0, 2.0, 0.0, 20.0, 0.0, 62.0 ] );

ctpsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, 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`.
- **AP**: input matrix in packed form stored in linear memory as a [`Complex64Array`][@stdlib/array/complex64].
- **x**: input vector [`Complex64Array`][@stdlib/array/complex64].
- **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 Complex64Array = require( '@stdlib/array/complex64' );

var AP = new Complex64Array( [ 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 Complex64Array( [ 0.0, 2.0, 0.0, 0.0, 0.0, 20.0, 0.0, 0.0, 0.0, 62.0 ] );

ctpsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, 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' );
var Complex64 = require( '@stdlib/complex/float32/ctor' );

// Initial arrays...
var x0 = new Complex64Array( [ 0.0, 0.0, 0.0, 2.0, 0.0, 20.0, 0.0, 62.0 ] );
var AP = new Complex64Array( [ 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 Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd complex element

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

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

#### ctpsv.ndarray( order, uplo, trans, diag, N, AP, sap, oap, x, sx, ox )

Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b`, using alternative indexing semantics and where `b` and `x` are `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 Complex64Array = require( '@stdlib/array/complex64' );

var AP = new Complex64Array( [ 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 Complex64Array( [ 0.0, 2.0, 0.0, 20.0, 0.0, 62.0 ] );

ctpsv.ndarray( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, 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:

- **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 Complex64Array = require( '@stdlib/array/complex64' );

var AP = new Complex64Array( [ 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 Complex64Array( [ 0.0, 62.0, 0.0, 20.0, 0.0, 2.0 ] );

ctpsv.ndarray( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, 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

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

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

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

var N = 5;

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

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

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

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

[ctpsv]: https://www.netlib.org/lapack/explore-html/d7/d3b/group__tpsv_ga8233358bb440cc921dfa62f89f044386.html

[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