Skip to content

Commit d719d74

Browse files
committed
docs: add docs
--- 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: passed - 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 94fc7c5 commit d719d74

3 files changed

Lines changed: 1017 additions & 0 deletions

File tree

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
2+
{{alias}}( order, trans, M, N, KL, KU, α, A, lda, x, sx, β, y, sy )
3+
Performs one of the matrix-vector operations `y = α*A*x + β*y` or
4+
`y = α*A^T*x + β*y` or `y = α*A^H*x + β*y`, where `α` and `β` are scalars,
5+
`x` and `y` are vectors, and `A` is an `M` by `N` band matrix with `KL`
6+
sub-diagonals and `KU` super-diagonals.
7+
8+
Indexing is relative to the first index. To introduce an offset, use typed
9+
array views.
10+
11+
If `M` or `N` is equal to `0`, the function returns `y` unchanged.
12+
13+
If `α` equals `0 + 0i` and `β` equals `1 + 0i`, the function returns `y`
14+
unchanged.
15+
16+
Parameters
17+
----------
18+
order: string
19+
Row-major (C-style) or column-major (Fortran-style) order.
20+
21+
trans: string
22+
Specifies whether `A` should be transposed, conjugate-transposed, or not
23+
transposed.
24+
25+
M: integer
26+
Number of rows in `A`.
27+
28+
N: integer
29+
Number of columns in `A`.
30+
31+
KL: integer
32+
Number of sub-diagonals of matrix `A`.
33+
34+
KU: integer
35+
Number of super-diagonals of matrix `A`.
36+
37+
α: Complex128
38+
Scalar constant.
39+
40+
A: Complex128Array
41+
Input matrix.
42+
43+
lda: integer
44+
Stride of the first dimension of `A` (a.k.a., leading dimension of the
45+
matrix `A`).
46+
47+
x: Complex128Array
48+
First input vector.
49+
50+
sx: integer
51+
Index increment for `x`.
52+
53+
β: Complex128
54+
Scalar constant.
55+
56+
y: Complex128Array
57+
Second input vector.
58+
59+
sy: integer
60+
Index increment for `y`.
61+
62+
Returns
63+
-------
64+
y: Complex128Array
65+
Second input vector.
66+
67+
Examples
68+
--------
69+
// Standard usage:
70+
> var x = new {{alias:@stdlib/array/complex128}}([1.0,1.0,2.0,2.0,3.0,3.0]);
71+
> var y = new {{alias:@stdlib/array/complex128}}([3.0,3.0,2.0,2.0,1.0,1.0]);
72+
> var buf1 = [ 0.0,0.0,1.0,1.0,3.0,3.0 ];
73+
> var buf2 = [ 2.0,2.0,4.0,4.0,6.0,6.0 ];
74+
> var buf3 = [ 5.0,5.0,7.0,7.0,0.0,0.0 ];
75+
> var buf = buf1.concat( buf2, buf3 );
76+
> var A = new {{alias:@stdlib/array/complex128}}( buf );
77+
> var alpha = new {{alias:@stdlib/complex/float64/ctor}}( 0.5, 0.5 );
78+
> var beta = new {{alias:@stdlib/complex/float64/ctor}}( 0.5, -0.5 );
79+
> var ord = 'row-major';
80+
> var trans = 'no-transpose';
81+
> {{alias}}( ord, trans, 3, 3, 1, 1, alpha, A, 3, x, 1, beta, y, 1 )
82+
<Complex128Array>[ -4.0, 7.0, -26.0, 28.0, -30.0, 31.0 ]
83+
84+
// Advanced indexing:
85+
> x = new {{alias:@stdlib/array/complex128}}([3.0,3.0,2.0,2.0,1.0,1.0]);
86+
> y = new {{alias:@stdlib/array/complex128}}([1.0,1.0,2.0,2.0,3.0,3.0]);
87+
> buf1 = [ 0.0,0.0,1.0,1.0,3.0,3.0 ];
88+
> buf2 = [ 2.0,2.0,4.0,4.0,6.0,6.0 ];
89+
> buf3 = [ 5.0,5.0,7.0,7.0,0.0,0.0 ];
90+
> buf = buf1.concat( buf2, buf3 );
91+
> A = new {{alias:@stdlib/array/complex128}}( buf );
92+
> alpha = new {{alias:@stdlib/complex/float64/ctor}}( 0.5, 0.5 );
93+
> beta = new {{alias:@stdlib/complex/float64/ctor}}( 0.5, -0.5 );
94+
> ord = 'row-major';
95+
> trans = 'no-transpose';
96+
> {{alias}}( ord, trans, 3, 3, 1, 1, alpha, A, 3, x, -1, beta, y, -1 )
97+
<Complex128Array>[ -30.0, 31.0, -26.0, 28.0, -4.0, 7.0 ]
98+
99+
// Using typed array views:
100+
> var x0buf = [0.0,0.0,1.0,1.0,2.0,2.0,3.0,3.0];
101+
> var x0 = new {{alias:@stdlib/array/complex128}}( x0buf );
102+
> var y0buf = [0.0,0.0,3.0,3.0,2.0,2.0,1.0,1.0];
103+
> var y0 = new {{alias:@stdlib/array/complex128}}( y0buf );
104+
> var x0bytes = x0.BYTES_PER_ELEMENT*1;
105+
> var x1 = new {{alias:@stdlib/array/complex128}}( x0.buffer, x0bytes );
106+
> var y0bytes = y0.BYTES_PER_ELEMENT*1;
107+
> var y1 = new {{alias:@stdlib/array/complex128}}( y0.buffer, y0bytes );
108+
> buf1 = [ 0.0,0.0,1.0,1.0,3.0,3.0 ];
109+
> buf2 = [ 2.0,2.0,4.0,4.0,6.0,6.0 ];
110+
> buf3 = [ 5.0,5.0,7.0,7.0,0.0,0.0 ];
111+
> buf = buf1.concat( buf2, buf3 );
112+
> A = new {{alias:@stdlib/array/complex128}}( buf );
113+
> alpha = new {{alias:@stdlib/complex/float64/ctor}}( 0.5, 0.5 );
114+
> beta = new {{alias:@stdlib/complex/float64/ctor}}( 0.5, -0.5 );
115+
> ord = 'row-major';
116+
> trans = 'no-transpose';
117+
> {{alias}}( ord, trans, 3, 3, 1, 1, alpha, A, 3, x1, 1, beta, y1, 1 )
118+
<Complex128Array>[ -4.0, 7.0, -26.0, 28.0, -30.0, 31.0 ]
119+
120+
121+
{{alias}}.ndarray(trans,M,N,KL,KU,α,A,sa1,sa2,oa,x,sx,ox,β,y,sy,oy)
122+
Performs one of the matrix-vector operations `y = α*A*x + β*y` or
123+
`y = α*A^T*x + β*y` or `y = α*A^H*x + β*y`, where `α` and `β` are scalars,
124+
`x` and `y` are vectors, and `A` is an `M` by `N` band matrix with `KL`
125+
sub-diagonals and `KU` super-diagonals.
126+
127+
While typed array views mandate a view offset based on the underlying
128+
buffer, the offset parameters support indexing semantics based on starting
129+
indices.
130+
131+
Parameters
132+
----------
133+
trans: string
134+
Specifies whether `A` should be transposed, conjugate-transposed, or not
135+
transposed.
136+
137+
M: integer
138+
Number of rows in `A`.
139+
140+
N: integer
141+
Number of columns in `A`.
142+
143+
KL: integer
144+
Number of sub-diagonals of matrix `A`.
145+
146+
KU: integer
147+
Number of super-diagonals of matrix `A`.
148+
149+
α: Complex128
150+
Scalar constant.
151+
152+
A: Complex128Array
153+
Input matrix.
154+
155+
sa1: integer
156+
Stride of the first dimension of `A`.
157+
158+
sa2: integer
159+
Stride of the second dimension of `A`.
160+
161+
oa: integer
162+
Starting index (offset) for `A`.
163+
164+
x: Complex128Array
165+
First input vector.
166+
167+
sx: integer
168+
Index increment for `x`.
169+
170+
ox: integer
171+
Starting index (offset) for `x`.
172+
173+
β: Complex128
174+
Scalar constant.
175+
176+
y: Complex128Array
177+
Second input vector.
178+
179+
sy: integer
180+
Index increment for `y`.
181+
182+
oy: integer
183+
Starting index (offset) for `y`.
184+
185+
Returns
186+
-------
187+
y: Complex128Array
188+
Second input vector.
189+
190+
Examples
191+
--------
192+
> x = new {{alias:@stdlib/array/complex128}}([1.0,1.0,2.0,2.0,3.0,3.0]);
193+
> y = new {{alias:@stdlib/array/complex128}}([3.0,3.0,2.0,2.0,1.0,1.0]);
194+
> buf1 = [ 0.0,0.0,1.0,1.0,3.0,3.0 ];
195+
> buf2 = [ 2.0,2.0,4.0,4.0,6.0,6.0 ];
196+
> buf3 = [ 5.0,5.0,7.0,7.0,0.0,0.0 ];
197+
> buf = buf1.concat( buf2, buf3 );
198+
> A = new {{alias:@stdlib/array/complex128}}( buf );
199+
> alpha = new {{alias:@stdlib/complex/float64/ctor}}( 0.5, 0.5 );
200+
> beta = new {{alias:@stdlib/complex/float64/ctor}}( 0.5, -0.5 );
201+
> ord = 'row-major';
202+
> trans = 'no-transpose';
203+
> {{alias}}.ndarray(trans,3,3,1,1,alpha,A,3,1,0,x,1,0,beta,y,1,0)
204+
<Complex128Array>[ -4.0, 7.0, -26.0, 28.0, -30.0, 31.0 ]
205+
206+
See Also
207+
--------
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
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 { Complex128Array } from '@stdlib/types/array';
24+
import { Layout, TransposeOperation } from '@stdlib/types/blas';
25+
import { Complex128 } from '@stdlib/types/complex';
26+
27+
/**
28+
* Interface describing `zgbmv`.
29+
*/
30+
interface Routine {
31+
/**
32+
* Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` band matrix with `KL` sub-diagonals and `KU` super-diagonals.
33+
*
34+
* @param order - storage layout
35+
* @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed
36+
* @param M - number of rows in the matrix `A`
37+
* @param N - number of columns in the matrix `A`
38+
* @param KL - number of sub-diagonals of matrix `A`
39+
* @param KU - number of super-diagonals of matrix `A`
40+
* @param alpha - scalar constant
41+
* @param A - input matrix (compact band storage)
42+
* @param LDA - stride of the first dimension of `A`
43+
* @param x - first input vector
44+
* @param strideX - `x` stride length
45+
* @param beta - scalar constant
46+
* @param y - second input vector
47+
* @param strideY - `y` stride length
48+
* @returns `y`
49+
*
50+
* @example
51+
* var Complex128Array = require( '@stdlib/array/complex128' );
52+
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
53+
*
54+
* var A = new Complex128Array( [ 0.0, 0.0, 1.0, 1.0, 3.0, 3.0, 2.0, 2.0, 4.0, 4.0, 6.0, 6.0, 5.0, 5.0, 7.0, 7.0, 0.0, 0.0 ] );
55+
* var x = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
56+
* var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] );
57+
* var alpha = new Complex128( 0.5, 0.5 );
58+
* var beta = new Complex128( 0.5, -0.5 );
59+
*
60+
* zgbmv( 'row-major', 'no-transpose', 3, 3, 1, 1, alpha, A, 3, x, 1, beta, y, 1 );
61+
* // y => <Complex128Array>[ -4.0, 7.0, -26.0, 28.0, -30.0, 31.0 ]
62+
*/
63+
( order: Layout, trans: TransposeOperation, M: number, N: number, KL: number, KU: number, alpha: Complex128, A: Complex128Array, LDA: number, x: Complex128Array, strideX: number, beta: Complex128, y: Complex128Array, strideY: number ): Complex128Array;
64+
65+
/**
66+
* Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y`, using alternative indexing semantics and where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` band matrix with `KL` sub-diagonals and `KU` super-diagonals.
67+
*
68+
* @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed
69+
* @param M - number of rows in the matrix `A`
70+
* @param N - number of columns in the matrix `A`
71+
* @param KL - number of sub-diagonals of matrix `A`
72+
* @param KU - number of super-diagonals of matrix `A`
73+
* @param alpha - scalar constant
74+
* @param A - input band matrix (compact band storage)
75+
* @param strideA1 - stride of the first dimension of `A`
76+
* @param strideA2 - stride of the second dimension of `A`
77+
* @param offsetA - starting index for `A`
78+
* @param x - first input vector
79+
* @param strideX - `x` stride length
80+
* @param offsetX - starting index for `x`
81+
* @param beta - scalar constant
82+
* @param y - second input vector
83+
* @param strideY - `y` stride length
84+
* @param offsetY - starting index for `y`
85+
* @returns `y`
86+
*
87+
* @example
88+
* var Complex128Array = require( '@stdlib/array/complex128' );
89+
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
90+
*
91+
* var A = new Complex128Array( [ 0.0, 0.0, 1.0, 1.0, 3.0, 3.0, 2.0, 2.0, 4.0, 4.0, 6.0, 6.0, 5.0, 5.0, 7.0, 7.0, 0.0, 0.0 ] );
92+
* var x = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
93+
* var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] );
94+
* var alpha = new Complex128( 0.5, 0.5 );
95+
* var beta = new Complex128( 0.5, -0.5 );
96+
*
97+
* zgbmv.ndarray( 'no-transpose', 3, 3, 1, 1, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 );
98+
* // y => <Complex128Array>[ -4.0, 7.0, -26.0, 28.0, -30.0, 31.0 ]
99+
*/
100+
ndarray( trans: TransposeOperation, M: number, N: number, KL: number, KU: number, alpha: Complex128, A: Complex128Array, strideA1: number, strideA2: number, offsetA: number, x: Complex128Array, strideX: number, offsetX: number, beta: Complex128, y: Complex128Array, strideY: number, offsetY: number ): Complex128Array;
101+
}
102+
103+
/**
104+
* Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y` or `y = α*A^H*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` band matrix with `KL` sub-diagonals and `KU` super-diagonals.
105+
*
106+
* @param order - storage layout
107+
* @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed
108+
* @param M - number of rows in the matrix `A`
109+
* @param N - number of columns in the matrix `A`
110+
* @param KL - number of sub-diagonals of matrix `A`
111+
* @param KU - number of super-diagonals of matrix `A`
112+
* @param alpha - complex scalar constant
113+
* @param A - input complex matrix (compact band storage)
114+
* @param LDA - stride of the first dimension of `A`
115+
* @param x - first input complex vector
116+
* @param strideX - `x` stride length
117+
* @param beta - complex scalar constant
118+
* @param y - second input complex vector
119+
* @param strideY - `y` stride length
120+
* @returns `y`
121+
*
122+
* @example
123+
* var Complex128Array = require( '@stdlib/array/complex128' );
124+
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
125+
*
126+
* var A = new Complex128Array( [ 0.0, 0.0, 1.0, 1.0, 3.0, 3.0, 2.0, 2.0, 4.0, 4.0, 6.0, 6.0, 5.0, 5.0, 7.0, 7.0, 0.0, 0.0 ] );
127+
* var x = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
128+
* var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] );
129+
* var alpha = new Complex128( 0.5, 0.5 );
130+
* var beta = new Complex128( 0.5, -0.5 );
131+
*
132+
* zgbmv( 'row-major', 'no-transpose', 3, 3, 1, 1, alpha, A, 3, x, 1, beta, y, 1 );
133+
* // y => <Complex128Array>[ -4.0, 7.0, -26.0, 28.0, -30.0, 31.0 ]
134+
*
135+
* @example
136+
* var Complex128Array = require( '@stdlib/array/complex128' );
137+
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
138+
*
139+
* var A = new Complex128Array( [ 0.0, 0.0, 1.0, 1.0, 3.0, 3.0, 2.0, 2.0, 4.0, 4.0, 6.0, 6.0, 5.0, 5.0, 7.0, 7.0, 0.0, 0.0 ] );
140+
* var x = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
141+
* var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] );
142+
* var alpha = new Complex128( 0.5, 0.5 );
143+
* var beta = new Complex128( 0.5, -0.5 );
144+
*
145+
* zgbmv.ndarray( 'no-transpose', 3, 3, 1, 1, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 );
146+
* // y => <Complex128Array>[ -4.0, 7.0, -26.0, 28.0, -30.0, 31.0 ]
147+
*/
148+
declare var zgbmv: Routine;
149+
150+
151+
// EXPORTS //
152+
153+
export = zgbmv;

0 commit comments

Comments
 (0)