Skip to content

Commit e21095c

Browse files
committed
test: add types, types test 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 70f66f1 commit e21095c

3 files changed

Lines changed: 624 additions & 0 deletions

File tree

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
2+
{{alias}}( order, uplo, trans, diag, N, AP, 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 vector and `A` is an `N` by `N`
5+
unit, or non-unit, upper or lower triangular matrix, supplied in packed
6+
form.
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 matrix.
21+
22+
trans: string
23+
Specifies whether `A` should be transposed, conjugate-transposed, or
24+
not transposed.
25+
26+
diag: string
27+
Specifies whether `A` has a unit diagonal.
28+
29+
N: integer
30+
Number of elements along each dimension of `A`.
31+
32+
AP: Complex128Array
33+
Matrix in packed form.
34+
35+
x: Complex128Array
36+
Input vector.
37+
38+
sx: integer
39+
Index increment for `x`.
40+
41+
Returns
42+
-------
43+
x: Complex128Array
44+
Input vector.
45+
46+
Examples
47+
--------
48+
> var x = new {{alias:@stdlib/array/complex128}}([1.0,1.0,2.0,2.0,3.0,3.0]);
49+
> var buf = [1.0,1.0,2.0,2.0,4.0,4.0,3.0,3.0,5.0,5.0,6.0,6.0];
50+
> var AP = new {{alias:@stdlib/array/complex128}}(buf);
51+
> var ord = 'row-major';
52+
> var uplo = 'lower';
53+
> var trans = 'no-transpose';
54+
> var diag = 'non-unit';
55+
> {{alias}}( ord, uplo, trans, diag, 3, AP, x, 1 )
56+
<Complex128Array>[0.0,2.0,0.0,20.0,0.0,62.0]
57+
58+
// Advanced indexing:
59+
> x = new {{alias:@stdlib/array/complex128}}([3.0,3.0,2.0,2.0,1.0,1.0]);
60+
> buf = [1.0,1.0,2.0,2.0,4.0,4.0,3.0,3.0,5.0,5.0,6.0,6.0];
61+
> AP = new {{alias:@stdlib/array/complex128}}(buf);
62+
> ord = 'row-major';
63+
> uplo = 'lower';
64+
> trans = 'no-transpose';
65+
> diag = 'non-unit';
66+
> {{alias}}( ord, uplo, trans, diag, 3, AP, x, -1 )
67+
<Complex128Array>[0.0,62.0,0.0,20.0,0.0,2.0]
68+
69+
// Using typed array views:
70+
> var x0buf = [0.0,0.0,1.0,1.0,2.0,2.0,3.0,3.0];
71+
> var x0 = new {{alias:@stdlib/array/complex128}}( x0buf );
72+
> var x0bytes = x0.BYTES_PER_ELEMENT*1;
73+
> var x1 = new {{alias:@stdlib/array/complex128}}( x0.buffer, x0bytes );
74+
> buf = [1.0,1.0,2.0,2.0,4.0,4.0,3.0,3.0,5.0,5.0,6.0,6.0];
75+
> AP = new {{alias:@stdlib/array/complex128}}(buf);
76+
> ord = 'row-major';
77+
> uplo = 'lower';
78+
> trans = 'no-transpose';
79+
> diag = 'non-unit';
80+
> {{alias}}( ord, uplo, trans, diag, 3, AP, x1, 1 )
81+
<Complex128Array>[0.0,2.0,0.0,20.0,0.0,62.0]
82+
83+
84+
{{alias}}.ndarray( order, uplo, trans, diag, N, AP, sap, oap, x, sx, ox )
85+
Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` or
86+
`x = A**H*x`, using alternative indexing semantics and where `x` is an `N`
87+
element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower
88+
triangular matrix, supplied in packed form.
89+
90+
While typed array views mandate a view offset based on the underlying
91+
buffer, the offset parameters support indexing semantics based on starting
92+
indices.
93+
94+
Parameters
95+
----------
96+
order: string
97+
Row-major (C-style) or column-major (Fortran-style) order. Must be
98+
either 'row-major' or 'column-major'.
99+
100+
uplo: string
101+
Specifies whether `A` is an upper or lower triangular matrix.
102+
103+
trans: string
104+
Specifies whether `A` should be transposed, conjugate-transposed, or
105+
not transposed.
106+
107+
diag: string
108+
Specifies whether `A` has a unit diagonal.
109+
110+
N: integer
111+
Number of elements along each dimension of `A`.
112+
113+
AP: Complex128Array
114+
Matrix in packed form.
115+
116+
sap: integer
117+
Index increment for `AP`.
118+
119+
oap: integer
120+
Starting index for `AP`.
121+
122+
x: Complex128Array
123+
Input vector.
124+
125+
sx: integer
126+
Index increment for `x`.
127+
128+
ox: integer
129+
Starting index for `x`.
130+
131+
Returns
132+
-------
133+
x: Complex128Array
134+
Input vector.
135+
136+
Examples
137+
--------
138+
> x = new {{alias:@stdlib/array/complex128}}([1.0,1.0,2.0,2.0,3.0,3.0]);
139+
> buf = [1.0,1.0,2.0,2.0,4.0,4.0,3.0,3.0,5.0,5.0,6.0,6.0];
140+
> AP = new {{alias:@stdlib/array/complex128}}(buf);
141+
> ord = 'row-major';
142+
> uplo = 'lower';
143+
> trans = 'no-transpose';
144+
> diag = 'non-unit';
145+
> {{alias}}.ndarray( ord, uplo, trans, diag, 3, AP, 1, 0, x, 1, 0 )
146+
<Complex128Array>[0.0,2.0,0.0,20.0,0.0,62.0]
147+
148+
See Also
149+
--------
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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 { Complex128Array } from '@stdlib/types/array';
25+
26+
/**
27+
* Interface describing `ztpmv`.
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 vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix, supplied in packed form.
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 AP - packed form of a symmetric matrix `A`
39+
* @param x - input vector
40+
* @param strideX - `x` stride length
41+
* @returns `x`
42+
*
43+
* @example
44+
* var Complex128Array = require( '@stdlib/array/complex128' );
45+
*
46+
* 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 ] );
47+
* var x = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
48+
*
49+
* ztpmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, x, 1 );
50+
* // x => <Complex128Array>[ 0.0, 2.0, 0.0, 20.0, 0.0, 62.0 ]
51+
*/
52+
( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, AP: Complex128Array, x: Complex128Array, strideX: number ): Complex128Array;
53+
54+
/**
55+
* 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 matrix, supplied in packed form.
56+
*
57+
* @param uplo - specifies whether `A` is an upper or lower triangular matrix
58+
* @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed
59+
* @param diag - specifies whether `A` has a unit diagonal
60+
* @param N - number of elements along each dimension in the matrix `A`
61+
* @param AP - packed form of a symmetric matrix `A`
62+
* @param strideAP - `AP` stride length
63+
* @param offsetAP - starting index for `AP`
64+
* @param x - input vector
65+
* @param strideX - `x` stride length
66+
* @param offsetX - starting index for `x`
67+
* @returns `x`
68+
*
69+
* @example
70+
* var Complex128Array = require( '@stdlib/array/complex128' );
71+
*
72+
* 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 ] );
73+
* var x = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
74+
*
75+
* ztpmv.ndarray( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, 1, 0, x, 1, 0 );
76+
* // x => <Complex128Array>[ 0.0, 2.0, 0.0, 20.0, 0.0, 62.0 ]
77+
*/
78+
ndarray( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, AP: Complex128Array, strideAP: number, offsetAP: number, x: Complex128Array, strideX: number, offsetX: number ): Complex128Array;
79+
}
80+
81+
/**
82+
* 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.
83+
*
84+
* @param order - storage layout
85+
* @param uplo - specifies whether `A` is an upper or lower triangular matrix
86+
* @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed
87+
* @param diag - specifies whether `A` has a unit diagonal
88+
* @param N - number of elements along each dimension in the matrix `A`
89+
* @param AP - packed form of a symmetric matrix `A`
90+
* @param x - input vector
91+
* @param strideX - `x` stride length
92+
* @returns `x`
93+
*
94+
* @example
95+
* var Complex128Array = require( '@stdlib/array/complex128' );
96+
*
97+
* 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 ] );
98+
* var x = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
99+
*
100+
* ztpmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, x, 1 );
101+
* // x => <Complex128Array>[ 0.0, 2.0, 0.0, 20.0, 0.0, 62.0 ]
102+
*
103+
* @example
104+
* var Complex128Array = require( '@stdlib/array/complex128' );
105+
*
106+
* 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 ] );
107+
* var x = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
108+
*
109+
* ztpmv.ndarray( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, 1, 0, x, 1, 0 );
110+
* // x => <Complex128Array>[ 0.0, 2.0, 0.0, 20.0, 0.0, 62.0 ]
111+
*/
112+
declare var ztpmv: Routine;
113+
114+
115+
// EXPORTS //
116+
117+
export = ztpmv;

0 commit comments

Comments
 (0)