Skip to content

Commit a57ea79

Browse files
committed
chore: add docs
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: failed ---
1 parent 477e9ce commit a57ea79

File tree

14 files changed

+2834
-72
lines changed

14 files changed

+2834
-72
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2018 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+
'use strict';
20+
21+
// MODULES //
22+
23+
var bench = require( '@stdlib/bench' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
25+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
26+
var pow = require( '@stdlib/math/base/special/pow' );
27+
var floor = require( '@stdlib/math/base/special/floor' );
28+
var pkg = require( './../package.json' ).name;
29+
var sgbmv = require( './../lib/sgbmv.js' );
30+
31+
32+
// VARIABLES //
33+
34+
var options = {
35+
'dtype': 'float32'
36+
};
37+
38+
39+
// FUNCTIONS //
40+
41+
/**
42+
* Creates a benchmark function.
43+
*
44+
* @private
45+
* @param {PositiveInteger} N - array dimension size
46+
* @returns {Function} benchmark function
47+
*/
48+
function createBenchmark( N ) {
49+
var x = uniform( N, -10.0, 10.0, options );
50+
var y = uniform( N, -10.0, 10.0, options );
51+
var A = [ 0, 9, 10,
52+
11, 12, 5,
53+
1, 2, 0 ];
54+
return benchmark;
55+
56+
/**
57+
* Benchmark function.
58+
*
59+
* @private
60+
* @param {Benchmark} b - benchmark instance
61+
*/
62+
function benchmark( b ) {
63+
var z;
64+
var i;
65+
66+
b.tic();
67+
for ( i = 0; i < b.iterations; i++ ) {
68+
z = sgbmv( 'row-major', 'no-transpose', N, N, 1, 1, 1.0, A, N, x, 1, 1.0, y, 1 );
69+
if ( isnanf( z[ i%z.length ] ) ) {
70+
b.fail( 'should not return NaN' );
71+
}
72+
}
73+
b.toc();
74+
if ( isnanf( z[ i%z.length ] ) ) {
75+
b.fail( 'should not return NaN' );
76+
}
77+
b.pass( 'benchmark finished' );
78+
b.end();
79+
}
80+
}
81+
82+
83+
// MAIN //
84+
85+
/**
86+
* Main execution sequence.
87+
*
88+
* @private
89+
*/
90+
function main() {
91+
var len;
92+
var f;
93+
94+
len = floor( pow( pow( 10, 1 ), 1.0/2.0 ) );
95+
f = createBenchmark( len );
96+
bench( pkg+':size='+(len*len), f );
97+
}
98+
99+
main();
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2018 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+
'use strict';
20+
21+
// MODULES //
22+
23+
var bench = require( '@stdlib/bench' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
25+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
26+
var pow = require( '@stdlib/math/base/special/pow' );
27+
var floor = require( '@stdlib/math/base/special/floor' );
28+
var pkg = require( './../package.json' ).name;
29+
var sgbmv = require( './../lib/ndarray.js' );
30+
31+
32+
// VARIABLES //
33+
34+
var options = {
35+
'dtype': 'float32'
36+
};
37+
38+
39+
// FUNCTIONS //
40+
41+
/**
42+
* Creates a benchmark function.
43+
*
44+
* @private
45+
* @param {PositiveInteger} N - array dimension size
46+
* @returns {Function} benchmark function
47+
*/
48+
function createBenchmark( N ) {
49+
var x = uniform( N, -10.0, 10.0, options );
50+
var y = uniform( N, -10.0, 10.0, options );
51+
var A = [ 0, 9, 10,
52+
11, 12, 5,
53+
1, 2, 0 ];
54+
return benchmark;
55+
56+
/**
57+
* Benchmark function.
58+
*
59+
* @private
60+
* @param {Benchmark} b - benchmark instance
61+
*/
62+
function benchmark( b ) {
63+
var z;
64+
var i;
65+
66+
b.tic();
67+
for ( i = 0; i < b.iterations; i++ ) {
68+
z = sgbmv( 'no-transpose', N, N, 1.0, 1, 1, A, N, 1, 0, x, 1, 0, 1.0, y, 1, 0 );
69+
if ( isnanf( z[ i%z.length ] ) ) {
70+
b.fail( 'should not return NaN' );
71+
}
72+
}
73+
b.toc();
74+
if ( isnanf( z[ i%z.length ] ) ) {
75+
b.fail( 'should not return NaN' );
76+
}
77+
b.pass( 'benchmark finished' );
78+
b.end();
79+
}
80+
}
81+
82+
83+
// MAIN //
84+
85+
/**
86+
* Main execution sequence.
87+
*
88+
* @private
89+
*/
90+
function main() {
91+
var len;
92+
var f;
93+
94+
len = floor( pow( pow( 10, 1 ), 1.0/2.0 ) );
95+
f = createBenchmark( len );
96+
bench( pkg+':size='+(len*len), f );
97+
}
98+
99+
main();

lib/node_modules/@stdlib/blas/base/sgbmv/docs/repl.txt

Whitespace-only changes.
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2024 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, TransposeOperation } from '@stdlib/types/blas';
24+
25+
/**
26+
* Interface describing `sgbmv`.
27+
*/
28+
interface Routine {
29+
/**
30+
* Performs one of the matrix-vector operations `y := α*A*x + β*y, or y := α*A**T*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.
31+
*
32+
* @param order - storage layout
33+
* @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed
34+
* @param M - number of rows in the matrix `A`
35+
* @param N - number of columns in the matrix `A`
36+
* @param KL - number of sub-diagonals of matrix `A`
37+
* @param KU - number of super-diagonals of matrix `A`
38+
* @param alpha - scalar constant
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 - first input vector
42+
* @param strideX - `x` stride length
43+
* @param beta - scalar constant
44+
* @param y - second input vector
45+
* @param strideY - `y` stride length
46+
* @returns `y`
47+
*
48+
* @example
49+
* var Float32Array = require( '@stdlib/array/float32' );
50+
*
51+
* var A = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 0.0 ] );
52+
* var x = new Float32Array( [ 1.0, 1.0, 1.0 ] );
53+
* var y = new Float32Array( [ 0.0, 0.0, 0.0 ] );
54+
*
55+
* sgbmv( 'row-major', 'no-transpose', 3, 3, 1, 1, 1.0, A, 3, x, 1, 1.0, y, 1 );
56+
* // y => <Float32Array>[ 7.0, 16.0 ]
57+
*/
58+
( order: Layout, trans: TransposeOperation, M: number, N: number, KL: number, KU: number, alpha: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number, beta: number, y: Float32Array, strideY: number ): Float32Array;
59+
60+
/**
61+
* Performs one of the matrix-vector operations `y := α*A*x + β*y, or y := α*A**T*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.
62+
*
63+
* @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed
64+
* @param M - number of rows in the matrix `A`
65+
* @param N - number of columns in the matrix `A`
66+
* @param KL - number of sub-diagonals of matrix `A`
67+
* @param KU - number of super-diagonals of matrix `A`
68+
* @param alpha - scalar constant
69+
* @param A - input matrix
70+
* @param strideA1 - stride of the first dimension of `A`
71+
* @param strideA2 - stride of the second dimension of `A`
72+
* @param offsetA - starting index for `A`
73+
* @param x - first input vector
74+
* @param strideX - `x` stride length
75+
* @param offsetX - starting index for `x`
76+
* @param beta - scalar constant
77+
* @param y - second input vector
78+
* @param strideY - `y` stride length
79+
* @param offsetY - starting index for `y`
80+
* @returns `y`
81+
*
82+
* @example
83+
* var Float32Array = require( '@stdlib/array/float32' );
84+
*
85+
* var A = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 0.0 ] );
86+
* var x = new Float32Array( [ 1.0, 1.0, 1.0 ] );
87+
* var y = new Float32Array( [ 0.0, 0.0, 0.0 ] );
88+
*
89+
* sgbmv( 'no-transpose', 3, 3, 1, 1, 1.0, A, 3, 1, 0, x, 1, 0, 1.0, y, 1, 0 );
90+
* // y => <Float32Array>[ 7.0, 16.0 ]
91+
*/
92+
ndarray( trans: TransposeOperation, M: number, N: number, KL: number, KU: number, alpha: number, A: Float32Array, strideA1: number, strideA2: number, offsetA: number, x: Float32Array, strideX: number, offsetX: number, beta: number, y: Float32Array, strideY: number, offsetY: number ): Float32Array;
93+
}
94+
95+
/**
96+
* Performs one of the matrix-vector operations `y := α*A*x + β*y, or y := α*A**T*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.
97+
*
98+
* @param order - storage layout
99+
* @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed
100+
* @param M - number of rows in the matrix `A`
101+
* @param N - number of columns in the matrix `A`
102+
* @param KL - number of sub-diagonals of matrix `A`
103+
* @param KU - number of super-diagonals of matrix `A`
104+
* @param alpha - scalar constant
105+
* @param A - input matrix
106+
* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`)
107+
* @param x - first input vector
108+
* @param strideX - `x` stride length
109+
* @param beta - scalar constant
110+
* @param y - second input vector
111+
* @param strideY - `y` stride length
112+
* @returns `y`
113+
*
114+
* @example
115+
* var Float32Array = require( '@stdlib/array/float32' );
116+
*
117+
* var A = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 0.0 ] );
118+
* var x = new Float32Array( [ 1.0, 1.0, 1.0 ] );
119+
* var y = new Float32Array( [ 0.0, 0.0, 0.0 ] );
120+
*
121+
* sgbmv( 'row-major', 'no-transpose', 3, 3, 1, 1, 1.0, A, 3, x, 1, 1.0, y, 1 );
122+
* // y => <Float32Array>[ 7.0, 16.0 ]
123+
*
124+
* @example
125+
* var Float32Array = require( '@stdlib/array/float32' );
126+
*
127+
* var A = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 0.0 ] );
128+
* var x = new Float32Array( [ 1.0, 1.0, 1.0 ] );
129+
* var y = new Float32Array( [ 0.0, 0.0, 0.0 ] );
130+
*
131+
* sgbmv.ndarray( 'no-transpose', 3, 3, 1, 1, 1.0, A, 3, 1, 0, x, 1, 0, 1.0, y, 1, 0 );
132+
* // y => <Float32Array>[ 7.0, 16.0 ]
133+
*/
134+
declare var sgbmv: Routine;
135+
136+
137+
// EXPORTS //
138+
139+
export = sgbmv;

0 commit comments

Comments
 (0)