Skip to content

Commit 9533e08

Browse files
committed
docs: add types and repl file
--- 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: na - task: lint_package_json status: na - task: lint_repl_help status: passed - 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: passed - task: lint_license_headers status: passed ---
1 parent e96d8d8 commit 9533e08

3 files changed

Lines changed: 691 additions & 0 deletions

File tree

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
2+
{{alias}}( order, uplo, trans, diag, N, K, A, lda, x, sx )
3+
Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x` or
4+
`x = A^H*x` where `x` is an `N` element complex vector and `A` is an `N` by
5+
`N` unit, or non-unit, upper or lower triangular band matrix, with (`K` + 1)
6+
diagonals.
7+
8+
Indexing is relative to the first index. To introduce an offset, use typed
9+
array views.
10+
11+
If `N` is equal to `0`, the function returns `x` unchanged.
12+
13+
Parameters
14+
----------
15+
order: string
16+
Row-major (C-style) or column-major (Fortran-style) order. Must be
17+
either 'row-major' or 'column-major'.
18+
19+
uplo: string
20+
Specifies whether `A` is an upper or lower triangular banded matrix.
21+
22+
trans: string
23+
Specifies whether `A` should be transposed, conjugate-transposed, or not
24+
transposed. Accepted values typically include: 'no-transpose',
25+
'transpose', 'conjugate-transpose'.
26+
27+
diag: string
28+
Specifies whether `A` has a unit diagonal.
29+
30+
N: integer
31+
Number of elements along each dimension of `A`.
32+
33+
K: integer
34+
Number of super-diagonals or sub-diagonals of the matrix `A`.
35+
36+
A: Complex64Array
37+
Input matrix.
38+
39+
lda: integer
40+
Stride of the first dimension of `A` (a.k.a., leading dimension of the
41+
matrix `A`).
42+
43+
x: Complex64Array
44+
Input vector.
45+
46+
sx: integer
47+
Stride length for `x`.
48+
49+
Returns
50+
-------
51+
x: Complex64Array
52+
Input vector.
53+
54+
Examples
55+
--------
56+
// Standard usage:
57+
> var x = new {{alias:@stdlib/array/complex64}}([1.0,1.0,2.0,2.0,3.0,3.0]);
58+
> var buf = [0.0,0.0,1.0,1.0,2.0,2.0,3.0,3.0,4.0,4.0,5.0,5.0];
59+
> var A = new {{alias:@stdlib/array/complex64}}( buf );
60+
> var ord = 'row-major';
61+
> var uplo = 'lower';
62+
> var trans = 'no-transpose';
63+
> var diag = 'non-unit';
64+
> {{alias}}( ord, uplo, trans, diag, 3, 1, A, 2, x, 1 )
65+
<Complex64Array>[ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ]
66+
67+
// Advanced indexing:
68+
> x = new {{alias:@stdlib/array/complex64}}([3.0,3.0,2.0,2.0,1.0,1.0]);
69+
> buf = [0.0,0.0,1.0,1.0,2.0,2.0,3.0,3.0,4.0,4.0,5.0,5.0];
70+
> A = new {{alias:@stdlib/array/complex64}}( buf );
71+
> ord = 'row-major';
72+
> uplo = 'lower';
73+
> trans = 'no-transpose';
74+
> diag = 'non-unit';
75+
> {{alias}}( ord, uplo, trans, diag, 3, 1, A, 2, x, -1 )
76+
<Complex64Array>[ 0.0, 46.0, 0.0, 16.0, 0.0, 2.0 ]
77+
78+
// Using typed array views:
79+
> var x0buf = [0.0,0.0,1.0,1.0,2.0,2.0,3.0,3.0];
80+
> var x0 = new {{alias:@stdlib/array/complex64}}( x0buf );
81+
> var x0bytes = x0.BYTES_PER_ELEMENT*1;
82+
> var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, x0bytes );
83+
> buf = [0.0,0.0,1.0,1.0,2.0,2.0,3.0,3.0,4.0,4.0,5.0,5.0];
84+
> A = new {{alias:@stdlib/array/complex64}}( buf );
85+
> ord = 'row-major';
86+
> uplo = 'lower';
87+
> trans = 'no-transpose';
88+
> diag = 'non-unit';
89+
> {{alias}}( ord, uplo, trans, diag, 3, 1, A, 2, x1, 1 )
90+
<Complex64Array>[ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ]
91+
92+
93+
{{alias}}.ndarray( uplo, trans, diag, N, K, A, sa1, sa2, oa, x, sx, ox )
94+
Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`,
95+
using alternative indexing semantics and where `x` is an `N` element
96+
complex vector and `A` is an `N` by `N` unit, or non-unit, upper or lower
97+
triangular band matrix, with ( `K` + 1 ) diagonals.
98+
99+
While typed array views mandate a view offset based on the underlying buffer
100+
, the offset parameters support indexing semantics based on starting
101+
indices.
102+
103+
Parameters
104+
----------
105+
uplo: string
106+
Specifies whether `A` is an upper or lower triangular banded matrix.
107+
108+
trans: string
109+
Specifies whether `A` should be transposed, conjugate-transposed, or not
110+
transposed. Accepted values typically include: 'no-transpose',
111+
'transpose', 'conjugate-transpose'.
112+
113+
diag: string
114+
Specifies whether `A` has a unit diagonal.
115+
116+
N: integer
117+
Number of elements along each dimension of `A`.
118+
119+
K: integer
120+
Number of super-diagonals or sub-diagonals of the matrix `A`.
121+
122+
A: Complex64Array
123+
Input matrix.
124+
125+
sa1: integer
126+
Stride of the first dimension of `A`.
127+
128+
sa2: integer
129+
Stride of the second dimension of `A`.
130+
131+
oa: integer
132+
Starting index (offset) for `A`.
133+
134+
x: Complex64Array
135+
Input vector.
136+
137+
sx: integer
138+
Index increment for `x`.
139+
140+
ox: integer
141+
Starting index (offset) for `x`.
142+
143+
Returns
144+
-------
145+
x: Complex64Array
146+
Input vector.
147+
148+
Examples
149+
--------
150+
> x = new {{alias:@stdlib/array/complex64}}([1.0,1.0,2.0,2.0,3.0,3.0]);
151+
> buf = [0.0,0.0,1.0,1.0,2.0,2.0,3.0,3.0,4.0,4.0,5.0,5.0];
152+
> A = new {{alias:@stdlib/array/complex64}}( buf );
153+
> ord = 'row-major';
154+
> uplo = 'lower';
155+
> trans = 'no-transpose';
156+
> diag = 'non-unit';
157+
> {{alias}}.ndarray( uplo, trans, diag, 3, 1, A, 2, 1, 0, x, 1, 0 )
158+
<Complex64Array>[ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ]
159+
160+
See Also
161+
--------
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2026 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// TypeScript Version: 4.1
20+
21+
/// <reference types="@stdlib/types"/>
22+
23+
import { Layout, MatrixTriangle, TransposeOperation, DiagonalType } from '@stdlib/types/blas';
24+
import { Complex64Array } from '@stdlib/types/array';
25+
26+
/**
27+
* Interface describing `ctbmv`.
28+
*/
29+
interface Routine {
30+
/**
31+
* 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 complex vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular band matrix, with (`K` + 1) diagonals.
32+
*
33+
* @param order - storage layout
34+
* @param uplo - specifies whether `A` is an upper or lower triangular matrix
35+
* @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed
36+
* @param diag - specifies whether `A` has a unit diagonal
37+
* @param N - number of elements along each dimension in the matrix `A`
38+
* @param K - number of super-diagonals or sub-diagonals of the matrix `A`
39+
* @param A - input matrix
40+
* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`)
41+
* @param x - input vector
42+
* @param strideX - stride length for `x`
43+
* @returns `x`
44+
*
45+
* @example
46+
* var Complex64Array = require( '@stdlib/array/complex64' );
47+
*
48+
* 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 ] );
49+
* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
50+
*
51+
* ctbmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x, 1 );
52+
* // x => <Complex64Array>[ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ]
53+
*/
54+
( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, K: number, A: Complex64Array, LDA: number, x: Complex64Array, strideX: number ): Complex64Array;
55+
56+
/**
57+
* Performs one of the matrix-vector operations `x = A*x` or `x = A^T*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 band matrix, with (`K` + 1) diagonals.
58+
*
59+
* @param uplo - specifies whether `A` is an upper or lower triangular matrix
60+
* @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed
61+
* @param diag - specifies whether `A` has a unit diagonal
62+
* @param N - number of elements along each dimension in the matrix `A`
63+
* @param K - number of super-diagonals or sub-diagonals of the matrix `A`
64+
* @param A - input matrix
65+
* @param strideA1 - stride of the first dimension of `A`
66+
* @param strideA2 - stride of the second dimension of `A`
67+
* @param offsetA - starting index for `A`
68+
* @param x - input vector
69+
* @param strideX - stride length for `x`
70+
* @param offsetX - starting index for `x`
71+
* @returns `x`
72+
*
73+
* @example
74+
* var Complex64Array = require( '@stdlib/array/complex64' );
75+
*
76+
* 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 ] );
77+
* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
78+
*
79+
* ctbmv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, 1, 0, x, 1, 0 );
80+
* // x => <Complex64Array>[ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ]
81+
*/
82+
ndarray( uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, K: number, A: Complex64Array, strideA1: number, strideA2: number, offsetA: number, x: Complex64Array, strideX: number, offsetX: number ): Complex64Array;
83+
}
84+
85+
/**
86+
* Performs one of the matrix-vector operations `x = A*x` or `x = A^T*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.
87+
*
88+
* @param order - storage layout
89+
* @param uplo - specifies whether `A` is an upper or lower triangular matrix
90+
* @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed
91+
* @param diag - specifies whether `A` has a unit diagonal
92+
* @param N - number of elements along each dimension in the matrix `A`
93+
* @param K - number of super-diagonals or sub-diagonals of the matrix `A`
94+
* @param A - input matrix
95+
* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`)
96+
* @param x - input vector
97+
* @param strideX - stride length for `x`
98+
* @returns `x`
99+
*
100+
* @example
101+
* var Complex64Array = require( '@stdlib/array/complex64' );
102+
*
103+
* 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 ] );
104+
* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
105+
*
106+
* ctbmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x, 1 );
107+
* // x => <Complex64Array>[ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ]
108+
*
109+
* @example
110+
* var Complex64Array = require( '@stdlib/array/complex64' );
111+
*
112+
* 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 ] );
113+
* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
114+
*
115+
* ctbmv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, 1, 0, x, 1, 0 );
116+
* // x => <Complex64Array>[ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ]
117+
*/
118+
declare var ctbmv: Routine;
119+
120+
121+
// EXPORTS //
122+
123+
export = ctbmv;

0 commit comments

Comments
 (0)