From 07b88a6c25430ef4f7f3d55cda33bbd255c4e0dc Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 13 Apr 2025 12:39:04 +0530 Subject: [PATCH 1/8] feat: add blas/base/ssbmv --- 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: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - 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 --- --- .../@stdlib/blas/base/ssbmv/README.md | 266 ++++++ .../blas/base/ssbmv/benchmark/benchmark.js | 105 +++ .../base/ssbmv/benchmark/benchmark.ndarray.js | 105 +++ .../@stdlib/blas/base/ssbmv/docs/repl.txt | 168 ++++ .../blas/base/ssbmv/docs/types/index.d.ts | 133 +++ .../blas/base/ssbmv/docs/types/test.ts | 515 +++++++++++ .../@stdlib/blas/base/ssbmv/examples/index.js | 36 + .../@stdlib/blas/base/ssbmv/lib/base.js | 160 ++++ .../@stdlib/blas/base/ssbmv/lib/index.js | 72 ++ .../@stdlib/blas/base/ssbmv/lib/main.js | 35 + .../@stdlib/blas/base/ssbmv/lib/ndarray.js | 97 ++ .../@stdlib/blas/base/ssbmv/lib/ssbmv.js | 109 +++ .../@stdlib/blas/base/ssbmv/package.json | 68 ++ .../column_major_complex_access_pattern.json | 25 + .../ssbmv/test/fixtures/column_major_l.json | 25 + .../ssbmv/test/fixtures/column_major_oa.json | 25 + .../test/fixtures/column_major_sa1_sa2.json | 25 + .../test/fixtures/column_major_sa1_sa2n.json | 25 + .../test/fixtures/column_major_sa1n_sa2.json | 25 + .../test/fixtures/column_major_sa1n_sa2n.json | 25 + .../ssbmv/test/fixtures/column_major_u.json | 26 + .../test/fixtures/column_major_xnyn.json | 25 + .../test/fixtures/column_major_xnyp.json | 26 + .../test/fixtures/column_major_xpyn.json | 25 + .../test/fixtures/column_major_xpyp.json | 25 + .../row_major_complex_access_pattern.json | 25 + .../base/ssbmv/test/fixtures/row_major_l.json | 25 + .../ssbmv/test/fixtures/row_major_oa.json | 25 + .../test/fixtures/row_major_sa1_sa2.json | 25 + .../test/fixtures/row_major_sa1_sa2n.json | 25 + .../test/fixtures/row_major_sa1n_sa2.json | 25 + .../test/fixtures/row_major_sa1n_sa2n.json | 25 + .../base/ssbmv/test/fixtures/row_major_u.json | 25 + .../ssbmv/test/fixtures/row_major_xnyn.json | 25 + .../ssbmv/test/fixtures/row_major_xnyp.json | 25 + .../ssbmv/test/fixtures/row_major_xpyn.json | 25 + .../ssbmv/test/fixtures/row_major_xpyp.json | 25 + .../@stdlib/blas/base/ssbmv/test/test.js | 82 ++ .../blas/base/ssbmv/test/test.ndarray.js | 841 ++++++++++++++++++ .../blas/base/ssbmv/test/test.ssbmv.js | 592 ++++++++++++ 40 files changed, 3986 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/README.md create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/benchmark/benchmark.ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/examples/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/lib/base.js create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/lib/ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/lib/ssbmv.js create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/package.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_l.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_l.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/test.js create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/test.ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/ssbmv/test/test.ssbmv.js diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/README.md b/lib/node_modules/@stdlib/blas/base/ssbmv/README.md new file mode 100644 index 000000000000..cd9624a40fcf --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/README.md @@ -0,0 +1,266 @@ + + +# ssbmv + +> Perform the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals. + +
+ +## Usage + +```javascript +var ssbmv = require( '@stdlib/blas/base/ssbmv' ); +``` + +#### ssbmv( order, uplo, N, K, α, A, x, LDA, sx, β, y, sy ) + +Performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals. + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); + +var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); + +ssbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); +// y => [ 2.0, 17.0, 21.0 ] +``` + +The function has the following parameters: + +- **order**: storage layout. +- **uplo**: specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied. +- **N**: specifies the order of the matrix `A`. +- **K**: specifies the number of super-diagonals of the matrix `A` +- **α**: scalar constant. +- **A**: packed banded form of a symmetric matrix `A` stored in linear memory as a [`Float32Array`][mdn-float32array]. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +- **x**: input [`Float32Array`][mdn-float32array]. +- **sx**: index increment for `x`. +- **β**: scalar constant. +- **y**: output [`Float32Array`][mdn-float32array]. +- **sy**: index increment for `y`. + +The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `y` in reverse order, + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); + +var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); + +ssbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, -1 ); +// y => [ 21.0, 17.0, 2.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); + +// Initial arrays... +var x0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + +// Create offset views... +var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +ssbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x1, 1, 0.0, y1, 1 ); +// y0 => [ 0.0, 2.0, 17.0, 21.0 ] +``` + +#### ssbmv.ndarray( uplo, N, K, α, A, sa1, sa2, oa, x, sx, ox, β, y, sy, oy ) + +Performs the matrix-vector operation `y = alpha*A*x + beta*y` using alternative indexing semantics where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals. + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); + +var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); + +ssbmv.ndarray( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); +// y => [ 2.0, 17.0, 21.0 ] +``` + +The function has the following additional parameters: + +- **oa**: starting index for `A`. +- **sa1**: first dimension index increment for `A`. +- **sa2**: second dimension index increment for `A`. +- **ox**: starting index for `x`. +- **oy**: starting index for `y`. + +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, + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); + +var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +var x = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + +ssbmv.ndarray( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 1, 0.0, y, 1, 1 ); +// y => [ 0.0, 2.0, 17.0, 21.0 ] +``` + +
+ + + +
+ +## Notes + +- `ssbmv()` corresponds to the [BLAS][blas] level 2 function [`ssbmv`][ssbmv]. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var ssbmv = require( '@stdlib/blas/base/ssbmv' ); + +var opts = { + 'dtype': 'float32' +}; + +var N = 3; +var A = [ 1, 2, 0, 3, 4, 5 ]; + +var x = discreteUniform( N, -10, 10, opts ); +var y = discreteUniform( N, -10, 10, opts ); + +ssbmv.ndarray( 'upper', N, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); +console.log( y ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/ssbmv/benchmark/benchmark.js new file mode 100644 index 000000000000..63304432649d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/benchmark/benchmark.js @@ -0,0 +1,105 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var pkg = require( './../package.json' ).name; +var ssbmv = require( './../lib/ssbmv.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -10.0, 10.0, options ); + var y = uniform( len, -10.0, 10.0, options ); + var A = [ 0, + 9, + 10, + 11, + 12, + 5, + 1, + 2, + 0 ]; + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = ssbmv( 'row-major', 'upper', len, 1.0, 1, A, 2, x, 1, 1.0, y, 1 ); + if ( isnanf( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var f; + + len = floor( pow( pow( 10, 1 ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( pkg+':size='+(len*len), f ); +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/ssbmv/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..8f85baa522f4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/benchmark/benchmark.ndarray.js @@ -0,0 +1,105 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var pkg = require( './../package.json' ).name; +var ssbmv = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -10.0, 10.0, options ); + var y = uniform( len, -10.0, 10.0, options ); + var A = [ 0, + 9, + 10, + 11, + 12, + 5, + 1, + 2, + 0 ]; + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = ssbmv( 'upper', len, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); + if ( isnanf( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var f; + + len = floor( pow( pow( 10, 1 ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( pkg+':size='+(len*len), f ); +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/ssbmv/docs/repl.txt new file mode 100644 index 000000000000..66085de53068 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/docs/repl.txt @@ -0,0 +1,168 @@ + +{{alias}}( ord, uplo, N, K, α, A, LDA, x, sx, β, y, sy ) + Performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` + and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an + `N` by `N` symmetric band matrix, with `K` super-diagonals. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `N` is equal to `0`, the function returns `y` unchanged. + + If `α` equals `0` and `β` equals `1`, the function returns `y` unchanged. + + Parameters + ---------- + ord: string + Row-major (C-style) or column-major (Fortran-style) order. Must be + either 'row-major' or 'column-major'. + + uplo: string + Specifies whether the upper or lower triangular matrix of `A` is + supplied. Must be either 'upper' or 'lower'. + + N: integer + Number of elements along each dimension of `A`. + + K: integer + Number of super-diagonals of the matrix `A`. + + α: number + Scalar constant. + + A: Float32Array + Matrix in packed form. + + LDA: integer + Leading dimension of the matrix `A`. + + x: Float32Array + Input vector `x`. + + sx: integer + Index increment for `x`. + + β: number + Scalar constant. + + y: Float32Array + Input/output vector `y`. + + sy: integer + Index increment for `y`. + + Returns + ------- + y: Float32Array + Output array. + + Examples + -------- + // Standard usage: + > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 3.0 ] ); + > var y = new {{alias:@stdlib/array/float32}}( [ 0.0, 0.0, 0.0 ] ); + > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + > {{alias}}( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ) + [ 2.0, 17.0, 21.0 ] + + // Advanced indexing: + > x = new {{alias:@stdlib/array/float32}}( [ 3.0, 2.0, 1.0 ] ); + > y = new {{alias:@stdlib/array/float32}}( [ 0.0, 0.0, 0.0 ] ); + > A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + > {{alias}}( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, -1, 0.0, y, -1 ) + [ 21.0, 17.0, 2.0 ] + + // Using typed array views: + > var x0 = new {{alias:@stdlib/array/float32}}( [ 0.0, 1.0, 2.0, 3.0 ] ); + > var y0 = new {{alias:@stdlib/array/float32}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + > var x1 = new {{alias:@stdlib/array/float32}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > var y1 = new {{alias:@stdlib/array/float32}}( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); + > {{alias}}( 'row-major', 'lower', 3, 1, 1.0, A, 2, x1, 1, 0.0, y1, 1 ); + > y0 + [ 0.0, 2.0, 17.0, 21.0 ] + + +{{alias}}.ndarray( uplo, N, K, α, A, sa1, sa2, oa, x, sx, ox, β, y, sy, oy ) + Performs the matrix-vector operation `y = alpha*A*x + beta*y` using + alternative indexing semantics where `alpha` and `beta` are scalars, + `x` and `y` are `N` element vectors, and `A` is an `N` by `N` + symmetric band matrix, with `K` super-diagonals. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameters support indexing semantics based on starting + indices. + + Parameters + ---------- + uplo: string + Specifies whether the upper or lower triangular matrix of `A` is + supplied. Must be either 'upper' or 'lower'. + + N: integer + Number of elements along each dimension of `A`. + + K: integer + Number of super-diagonals of the matrix `A`. + + α: number + Scalar. + + A: Float32Array + Matrix in packed form. + + sa1: integer + Stride of the first dimension of `A`. + + sa2: integer + Stride of the second dimension of `A`. + + oa: integer + Starting index for `A`. + + x: Float32Array + Input vector `x`. + + sx: integer + Index increment for `x`. + + ox: integer + Starting index for `x`. + + β: number + Scalar. + + y: Float32Array + Input/output vector `y`. + + sy: integer + Index increment for `y`. + + oy: integer + Starting index for `y`. + + Returns + ------- + y: Float32Array + Output array. + + Examples + -------- + // Standard usage: + > var x = new {{alias:@stdlib/array/float32}}( [ 0.0, 1.0, 2.0, 3.0 ] ); + > var y = new {{alias:@stdlib/array/float32}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + > var uplo = 'lower'; + > {{alias}}.ndarray( uplo, 3, 1, 1.0, A, 2, 1, 0, x, 1, 1, 0.0, y, 1, 1 ) + [ 0.0, 2.0, 17.0, 21.0 ] + + // Advanced indexing: + > var x = new {{alias:@stdlib/array/float32}}( [ 3.0, 2.0, 1.0 ] ); + > var y = new {{alias:@stdlib/array/float32}}( [ 0.0, 0.0, 0.0 ] ); + > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + > var uplo = 'lower'; + > {{alias}}.ndarray( uplo, 3, 1, 1.0, A, 2, 1, 0, x, -1, 2, 0.0, y, -1, 2 ) + [ 21.0, 17.0, 2.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/ssbmv/docs/types/index.d.ts new file mode 100644 index 000000000000..172b97242b99 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/docs/types/index.d.ts @@ -0,0 +1,133 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Layout, MatrixTriangle } from '@stdlib/types/blas'; + +/** +* Interface describing `ssbmv`. +*/ +interface Routine { + /** + * Performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals. + * + * @param order - storage layout + * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is being supplied + * @param N - number of columns in the matrix `A` + * @param K - number of super-diagonals of the matrix `A` + * @param alpha - scalar constant + * @param A - matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param x - first input array + * @param strideX - `x` stride length + * @param beta - scalar constant + * @param y - second input array + * @param strideY - `y` stride length + * @returns `y` + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); + * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); + * + * ssbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); + * // y => [ 2.0, 17.0, 21.0 ] + */ + ( order: Layout, uplo: MatrixTriangle, N: number, K: number, alpha: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number, beta: number, y: Float32Array, strideY: number ): Float32Array; + + /** + * Performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals. + * + * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is being supplied + * @param N - number of columns in the matrix `A` + * @param K - number of super-diagonals of the matrix `A` + * @param alpha - scalar constant + * @param A - packed form of a symmetric matrix `A` + * @param strideA1 - stride of the first dimension of `A` + * @param strideA2 - stride of the second dimension of `A` + * @param offsetA - starting index for `A` + * @param x - first input array + * @param strideX - `x` stride length + * @param offsetX - starting `x` index + * @param beta - scalar constant + * @param y - second input array + * @param strideY - `y` stride length + * @param offsetY - starting `y` index + * @returns `y` + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); + * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); + * + * ssbmv( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); + * // y => [ 2.0, 17.0, 21.0 ] + */ + ndarray( uplo: MatrixTriangle, N: number, K: 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; +} + +/** +* Performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals. +* +* @param order - storage layout +* @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is being supplied +* @param N - number of columns in the matrix `A` +* @param K - number of super-diagonals of the matrix `A` +* @param alpha - scalar constant +* @param A - packed form of a symmetric matrix `A` +* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param x - first input array +* @param strideX - `x` stride length +* @param beta - scalar constant +* @param y - second input array +* @param strideY - `y` stride length +* @returns `y` +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); +* +* ssbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); +* // y => [ 2.0, 17.0, 21.0 ] +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); +* +* ssbmv( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); +* // y => [ 2.0, 17.0, 21.0 ] +*/ +declare var ssbmv: Routine; + + +// EXPORTS // + +export = ssbmv; diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/ssbmv/docs/types/test.ts new file mode 100644 index 000000000000..53beb7ebf4cd --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/docs/types/test.ts @@ -0,0 +1,515 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +import ssbmv = require( './index' ); + + +// TESTS // + +// The function returns a Float32Array... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectType Float32Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv( 10, 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( true, 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( false, 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( null, 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( void 0, 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( [], 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( {}, 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( ( x: number ): number => x, 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv( 'row-major', 10, 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', true, 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', false, 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', null, 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', void 0, 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', [ '1' ], 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', {}, 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', ( x: number ): number => x, 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv( 'row-major', 'upper', '10', 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', true, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', false, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', null, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', void 0, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', [], 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', {}, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', ( x: number ): number => x, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv( 'row-major', 'upper', 10, '10', 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, true, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, false, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, null, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, void 0, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, [], 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, {}, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, ( x: number ): number => x, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv( 'row-major', 'upper', 10, 1, '10', A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, true, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, false, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, null, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, void 0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, [], A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, {}, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, ( x: number ): number => x, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a Float32Array... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + + ssbmv( 'row-major', 'upper', 10, 1, 1.0, 10, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, '10', 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, true, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, false, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, null, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, void 0, 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, [ '1' ], 2, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, {}, x, 2, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, ( x: number ): number => x, 2, x, 1, 1.0, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, '10', x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, true, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, false, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, null, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, void 0, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, [ '1' ], x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, {}, x, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, ( x: number ): number => x, x, 1, 1.0, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eighth argument which is not a Float32Array... +{ + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, 10, 1, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, '10', 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, true, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, false, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, null, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, void 0, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, [ '1' ], 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, {}, 1, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, ( x: number ): number => x, 1, 1.0, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, '10', 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, true, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, false, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, null, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, void 0, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, [], 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, {}, 1.0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, ( x: number ): number => x, 1.0, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an tenth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, '10', y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, true, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, false, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, null, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, void 0, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, [], y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, {}, y, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, ( x: number ): number => x, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eleventh argument which is not a Float32Array... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, 10, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, '10', 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, true, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, false, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, null, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, void 0, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, [ '1' ], 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, {}, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a twelfth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, '10' ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, true ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, false ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, null ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, void 0 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, [] ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, {} ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv(); // $ExpectError + ssbmv( 'row-major' ); // $ExpectError + ssbmv( 'row-major', 'upper' ); // $ExpectError + ssbmv( 'row-major', 'upper', 10 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0 ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y ); // $ExpectError + ssbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Float32Array... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectType Float32Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 10, 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( true, 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( false, 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( null, 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( void 0, 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( [ '1' ], 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( {}, 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( ( x: number ): number => x, 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 'upper', '10', 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', true, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', false, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', null, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', void 0, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', [], 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', {}, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', ( x: number ): number => x, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 'upper', 10, '10', 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, true, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, false, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, null, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, void 0, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, [], 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, {}, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, ( x: number ): number => x, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 'upper', 10, 1, '10', A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, true, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, false, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, null, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, void 0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, [], A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, {}, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, ( x: number ): number => x, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a Float32Array... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + + ssbmv.ndarray( 'upper', 10, 1, 1.0, 10, 1, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, '10', 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, true, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, false, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, null, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, void 0, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, [ '1' ], 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, {}, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, ( x: number ): number => x, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, '10', 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, true, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, false, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, null, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, void 0, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, [ '1' ], 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, {}, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, ( x: number ): number => x, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError +} + + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, '10', 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, true, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, false, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, null, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, void 0, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, [ '1' ], 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, {}, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, ( x: number ): number => x, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eighth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, '10', x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, true, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, false, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, null, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, void 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, [ '1' ], x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, {}, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, ( x: number ): number => x, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a Float32Array... +{ + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, 10, 1, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, '10', 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, true, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, false, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, null, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, void 0, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, [ '1' ], 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, {}, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, ( x: number ): number => x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an tenth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, '10', 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, true, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, false, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, null, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, void 0, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, [], 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, {}, 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, ( x: number ): number => x, 0, 1.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eleventh argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, '10', 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, true, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, false, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, null, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, void 0, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, [], 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, {}, 1.0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, ( x: number ): number => x, 1.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a twelfth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, '10', y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, true, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, false, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, null, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, void 0, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, [], y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, {}, y, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, ( x: number ): number => x, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an thirteenth argument which is not a Float32Array... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, 10, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, '10', 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, true, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, false, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, null, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, void 0, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, [ '1' ], 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, {}, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourteenth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, '10', 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, true, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, false, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, null, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, void 0, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, [], 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, {}, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifteenth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, '10' ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, true ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, false ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, null ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, void 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, [] ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, {} ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const x = new Float32Array( 10 ); + const y = new Float32Array( 10 ); + const A = new Float32Array( 55 ); + + ssbmv.ndarray(); // $ExpectError + ssbmv.ndarray( 'upper' ); // $ExpectError + ssbmv.ndarray( 'upper', 10 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1 ); // $ExpectError + ssbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/ssbmv/examples/index.js new file mode 100644 index 000000000000..888ca19d19a4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/examples/index.js @@ -0,0 +1,36 @@ + +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var ssbmv = require( './../lib' ); + +var opts = { + 'dtype': 'float32' +}; + +var N = 3; +var A = [ 1, 2, 0, 3, 4, 5 ]; + +var x = discreteUniform( N, -10, 10, opts ); +var y = discreteUniform( N, -10, 10, opts ); + +ssbmv.ndarray( 'upper', N, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); +console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/base.js new file mode 100644 index 000000000000..61846548d935 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/base.js @@ -0,0 +1,160 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +// MODULES // + +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var sfill = require( '@stdlib/blas/ext/base/sfill' ).ndarray; +var sscal = require( '@stdlib/blas/base/sscal' ).ndarray; +var max = require( '@stdlib/math/base/special/max' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); + + +// MAIN // + +/** +* Performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals. +* +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {NonNegativeInteger} K - number of super-diagonals of the matrix `A` +* @param {number} alpha - scalar constant +* @param {Float32Array} A - matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Float32Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {number} beta - scalar constant +* @param {Float32Array} y - second input array +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting `y` index +* @returns {Float32Array} `y` +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); +* +* ssbmv( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); +* // y => [ 2.0, 17.0, 21.0 ] +*/ +function ssbmv( uplo, N, K, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len + var temp1; + var temp2; + var isrm; + var jmin; + var sa0; + var sa1; + var ix; + var iy; + var jx; + var jy; + var ox; + var oy; + var oa; + var i; + var j; + + isrm = isRowMajor( [ strideA1, strideA2 ] ); + if ( isrm ) { + sa0 = strideA2; + sa1 = strideA1; + } else { + sa0 = strideA1; + sa1 = strideA2; + } + // Form: y = beta*y + if ( beta !== 1.0 ) { + if ( beta === 0.0 ) { + sfill( N, 0.0, y, strideY, offsetY ); + } else { + sscal( N, beta, y, strideY, offsetY ); + } + } + if ( alpha === 0.0 ) { + return y; + } + ox = offsetX; + oy = offsetY; + + // Form: y = alpha*A*x + y + if ( + ( isrm && uplo === 'upper' ) || + ( !isrm && uplo === 'lower' ) + ) { + ix = ox; + iy = oy; + for ( i = 0; i < N; i++ ) { + temp1 = f32( alpha * x[ ix ] ); + temp2 = 0.0; + jmin = max( 0, i - K ); + jx = ox + ( jmin * strideX ); + jy = oy + ( jmin * strideY ); + for ( j = jmin; j < i; j++ ) { + oa = offsetA + ((i - j) * sa0); + y[ jy ] += f32( temp1 * A[ oa + (j * sa1) ] ); + temp2 += f32( x[ jx ] * A[ oa + (j * sa1) ] ); + jx += strideX; + jy += strideY; + } + y[ iy ] += f32( ( temp1 * A[ offsetA + (i * sa1) ] ) + ( alpha * temp2 ) ); + ix += strideX; + iy += strideY; + } + return y; + } + + // ( order === 'row-major' && uplo === 'lower') || ( order === 'column-major' && uplo === 'upper' ) + if ( + ( isrm && uplo === 'lower' ) || + ( !isrm && uplo === 'upper' ) + ) { + ix = ox; + iy = oy; + for ( i = 0; i < N; i++ ) { + temp1 = f32( alpha * x[ ix ] ); + temp2 = 0.0; + jmin = max( 0, i - K ); + jx = ox + ( jmin * strideX ); + jy = oy + ( jmin * strideY ); + for ( j = jmin; j < i; j++ ) { + oa = offsetA + +((K + j - i) * sa0); + y[ jy ] += f32( temp1 * A[ oa + (i * sa1) ] ); + temp2 += f32( x[ jx ] * A[ oa + (i * sa1) ] ); + jx += strideX; + jy += strideY; + } + oa = offsetA + (K * sa0); + y[ iy ] += f32( ( temp1 * A[ oa + (i * sa1) ] ) + ( alpha * temp2 ) ); + ix += strideX; + iy += strideY; + } + return y; + } +} + + +// EXPORTS // + +module.exports = ssbmv; diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/index.js new file mode 100644 index 000000000000..79ae8ffcc3ad --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/index.js @@ -0,0 +1,72 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +/** +* BLAS level 2 routine to perform the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals. +* +* @module @stdlib/blas/base/ssbmv +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* var ssbmv = require( '@stdlib/blas/base/ssbmv' ); +* +* var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); +* +* ssbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); +* // y => [ 2.0, 17.0, 21.0 ] +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* var ssbmv = require( '@stdlib/blas/base/ssbmv' ); +* +* var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); +* +* ssbmv.ndarray( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); +* // y => [ 2.0, 17.0, 21.0 ] +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var ssbmv; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + ssbmv = main; +} else { + ssbmv = tmp; +} + + +// EXPORTS // + +module.exports = ssbmv; + +// exports: { "ndarray": "ssbmv.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/lib/main.js b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/main.js new file mode 100644 index 000000000000..08b04f3ad7eb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var ssbmv = require( './ssbmv.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( ssbmv, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = ssbmv; diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/ndarray.js new file mode 100644 index 000000000000..be4687ab620a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/ndarray.js @@ -0,0 +1,97 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +// MODULES // + +var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals. +* +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {NonNegativeInteger} K - number of super-diagonals of the matrix `A` +* @param {number} alpha - scalar constant +* @param {Float32Array} A - matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Float32Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {number} beta - scalar constant +* @param {Float32Array} y - second input array +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting `y` index +* @throws {TypeError} first argument must specify whether to reference the lower or upper triangular matrix +* @throws {RangeError} second argument must be a nonnegative integer +* @throws {RangeError} third argument must be a nonnegative integer +* @throws {RangeError} sixth argument must be greater than or equal to max(1,N) +* @throws {RangeError} eighth argument must be non-zero +* @throws {RangeError} twelfth argument must be non-zero +* @returns {Float32Array} `y` +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); +* +* ssbmv( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); +* // y => [ 2.0, 17.0, 21.0 ] +*/ +function ssbmv( uplo, N, K, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( 'invalid argument. First argument must specify whether to reference the lower or upper triangular matrix. Value: `%s`.', uplo ); + } + if ( N < 0 ) { + throw new RangeError( 'invalid argument. Second argument must be a nonnegative integer. Value: `%d`.', N ); + } + if ( K < 0 ) { + throw new RangeError( 'invalid argument. Third argument must be a nonnegative integer. Value: `%d`.', K ); + } + if ( strideA1 === 0 ) { + throw new RangeError( 'invalid argument. Sixth argument must be non-zero. Value: `%d`.', strideX ); + } + if ( strideA2 === 0 ) { + throw new RangeError( 'invalid argument. Seventh argument must be non-zero. Value: `%d`.', strideX ); + } + if ( strideX === 0 ) { + throw new RangeError( 'invalid argument. Tenth argument must be non-zero. Value: `%d`.', strideX ); + } + if ( strideY === 0 ) { + throw new RangeError( 'invalid argument. Fourteenth argument must be non-zero. Value: `%d`.', strideY ); + } + // Check if we can early return... + if ( N === 0 || ( alpha === 0.0 && beta === 1.0 ) ) { + return y; + } + return base( uplo, N, K, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = ssbmv; diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/lib/ssbmv.js b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/ssbmv.js new file mode 100644 index 000000000000..7b2e612921c2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/ssbmv.js @@ -0,0 +1,109 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +// MODULES // + +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var format = require( '@stdlib/string/format' ); +var max = require( '@stdlib/math/base/special/max' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals. +* +* @param {string} order - storage layout +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {NonNegativeInteger} K - number of super-diagonals of the matrix `A` +* @param {number} alpha - scalar constant +* @param {Float32Array} A - matrix +* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Float32Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {number} beta - scalar constant +* @param {Float32Array} y - second input array +* @param {integer} strideY - `y` stride length +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied +* @throws {RangeError} third argument must be a nonnegative integer +* @throws {RangeError} fourth argument must be a nonnegative integer +* @throws {RangeError} seventh argument must be greater than max(1,K) +* @throws {RangeError} eighth argument must be non-zero +* @throws {RangeError} eleventh argument must be non-zero +* @returns {Float32Array} `y` +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); +* +* ssbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); +* // y => [ 2.0, 17.0, 21.0 ] +*/ +function ssbmv( order, uplo, N, K, alpha, A, LDA, x, strideX, beta, y, strideY ) { // eslint-disable-line max-params, max-len + var offsetX; + var offsetY; + var sa1; + var sa2; + + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( format( 'invalid argument. Second argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( K < 0 ) { + throw new RangeError( format( 'invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.', K ) ); + } + if ( LDA < max( 1, K + 1 ) ) { + throw new RangeError( 'invalid argument. Seventh argument must be greater than or equal to ( K + 1 ). Value: `%d`.', LDA ); + } + if ( strideX === 0 ) { + throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideX ) ); + } + if ( strideY === 0 ) { + throw new RangeError( format( 'invalid argument. Eleventh argument must be non-zero. Value: `%d`.', strideY ) ); + } + offsetX = stride2offset( N, strideX ); + offsetY = stride2offset( N, strideY ); + if ( order === 'column-major' ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + } + return base( uplo, N, K, alpha, A, sa1, sa2, 0, x, strideX, offsetX, beta, y, strideY, offsetY ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = ssbmv; diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/package.json b/lib/node_modules/@stdlib/blas/base/ssbmv/package.json new file mode 100644 index 000000000000..d12720f72692 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/blas/base/ssbmv", + "version": "0.0.0", + "description": "Perform the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "level 2", + "ssbmv", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "float32", + "double", + "float32array" + ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 000000000000..17ef1b0c01ae --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_complex_access_pattern.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "column-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 2.0, + "strideX": -2, + "offsetX": 4, + "strideY": -3, + "offsetY": 6, + "LDA": 2, + "A": [ 0.0, 0.0, 2.0, 4.0, 0.0, 0.0, 1.0, 0.0, 2.0, 5.0, 0.0, 6.0 ], + "A_mat": [ + [ 4.0, 0.0, 0.0 ], + [ 1.0, 5.0, 0.0 ], + [ 0.0, 2.0, 6.0 ] + ], + "x": [ 1.0, 0.0, 1.0, 0.0, 1.0 ], + "y": [ 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0 ], + "strideA1": 3, + "strideA2": 2, + "offsetA": 3, + "y_out": [ 9.0, 0.0, 0.0, 5.0, 0.0, 0.0, 6.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_l.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_l.json new file mode 100644 index 000000000000..eb9842ab834a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_l.json @@ -0,0 +1,25 @@ +{ + "uplo": "lower", + "order": "column-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 4.0, 1.0, 0.0, 5.0, 2.0, 6.0 ], + "A_mat": [ + [ 4.0, 0.0, 0.0 ], + [ 1.0, 5.0, 0.0 ], + [ 0.0, 2.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "y_out": [ 6.0, 7.0, 8.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_oa.json new file mode 100644 index 000000000000..f413e2c5eada --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_oa.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "column-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 0.0, 4.0, 1.0, 5.0, 0.0, 2.0, 6.0 ], + "A_mat": [ + [ 4.0, 1.0, 0.0 ], + [ 0.0, 5.0, 2.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 1, + "strideA2": 2, + "offsetA": 1, + "y_out": [ 7.0, 8.0, 9.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2.json new file mode 100644 index 000000000000..ad0fe6859c11 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "column-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 0.0, 4.0, 0.0, 0.0, 1.0, 5.0, 0.0, 0.0, 0.0, 2.0, 0.0, 6.0, 0.0 ], + "A_mat": [ + [ 4.0, 1.0, 0.0 ], + [ 0.0, 5.0, 2.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 3, + "strideA2": 2, + "offsetA": 0, + "y_out": [ 1.0, 6.0, 6.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2n.json new file mode 100644 index 000000000000..f60e55374156 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2n.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "column-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 0.0, 4.0, 0.0, 0.0, 1.0, 5.0, 0.0, 0.0, 0.0, 2.0, 0.0, 6.0, 0.0 ], + "A_mat": [ + [ 4.0, 1.0, 0.0 ], + [ 0.0, 5.0, 2.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": -3, + "strideA2": 2, + "offsetA": 8, + "y_out": [ 1.0, 6.0, 1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2.json new file mode 100644 index 000000000000..f60e55374156 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "column-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 0.0, 4.0, 0.0, 0.0, 1.0, 5.0, 0.0, 0.0, 0.0, 2.0, 0.0, 6.0, 0.0 ], + "A_mat": [ + [ 4.0, 1.0, 0.0 ], + [ 0.0, 5.0, 2.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": -3, + "strideA2": 2, + "offsetA": 8, + "y_out": [ 1.0, 6.0, 1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2n.json new file mode 100644 index 000000000000..d6c95104fece --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2n.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "column-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 0.0, 4.0, 0.0, 0.0, 1.0, 5.0, 0.0, 0.0, 0.0, 2.0, 0.0, 6.0, 0.0 ], + "A_mat": [ + [ 4.0, 1.0, 0.0 ], + [ 0.0, 5.0, 2.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": -3, + "strideA2": -2, + "offsetA": 8, + "y_out": [ 1.0, 6.0, 1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_u.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_u.json new file mode 100644 index 000000000000..841b26106624 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_u.json @@ -0,0 +1,26 @@ + +{ + "uplo": "upper", + "order": "column-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 4.0, 1.0, 5.0, 0.0, 2.0, 6.0 ], + "A_mat": [ + [ 4.0, 1.0, 0.0 ], + [ 0.0, 5.0, 2.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "y_out": [ 7.0, 8.0, 9.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyn.json new file mode 100644 index 000000000000..be7a67702db2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyn.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "column-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": -1, + "offsetX": 2, + "strideY": -1, + "offsetY": 2, + "LDA": 2, + "A": [ 4.0, 1.0, 5.0, 0.0, 2.0, 6.0 ], + "A_mat": [ + [ 4.0, 1.0, 0.0 ], + [ 0.0, 5.0, 2.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "y_out": [ 9.0, 8.0, 7.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyp.json new file mode 100644 index 000000000000..2fff669082df --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyp.json @@ -0,0 +1,26 @@ + +{ + "uplo": "upper", + "order": "column-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": -1, + "offsetX": 2, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 4.0, 1.0, 5.0, 0.0, 2.0, 6.0 ], + "A_mat": [ + [ 4.0, 1.0, 0.0 ], + [ 0.0, 5.0, 2.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "y_out": [ 7.0, 8.0, 9.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyn.json new file mode 100644 index 000000000000..a7dde639a98f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyn.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "column-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": -1, + "offsetY": 2, + "LDA": 2, + "A": [ 4.0, 1.0, 5.0, 0.0, 2.0, 6.0 ], + "A_mat": [ + [ 4.0, 1.0, 0.0 ], + [ 0.0, 5.0, 2.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "y_out": [ 9.0, 8.0, 7.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyp.json new file mode 100644 index 000000000000..04d045803e39 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyp.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "column-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 4.0, 1.0, 5.0, 0.0, 2.0, 6.0 ], + "A_mat": [ + [ 4.0, 1.0, 0.0 ], + [ 0.0, 5.0, 2.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "y_out": [ 7.0, 8.0, 9.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 000000000000..c6d14fe29af2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_complex_access_pattern.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "row-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 2.0, + "strideX": -2, + "offsetX": 4, + "strideY": -3, + "offsetY": 6, + "LDA": 2, + "A": [ 0.0, 0.0, 2.0, 4.0, 0.0, 0.0, 1.0, 0.0, 2.0, 5.0, 0.0, 6.0 ], + "A_mat": [ + [ 4.0, 0.0, 0.0 ], + [ 1.0, 5.0, 0.0 ], + [ 0.0, 2.0, 6.0 ] + ], + "x": [ 1.0, 0.0, 1.0, 0.0, 1.0 ], + "y": [ 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0 ], + "strideA1": 2, + "strideA2": 3, + "offsetA": 3, + "y_out": [ 13.0, 0.0, 0.0, 10.0, 0.0, 0.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_l.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_l.json new file mode 100644 index 000000000000..c31be9c3ab16 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_l.json @@ -0,0 +1,25 @@ +{ + "uplo": "lower", + "order": "row-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 4.0, 1.0, 5.0, 0.0, 2.0, 6.0 ], + "A_mat": [ + [ 4.0, 0.0, 0.0 ], + [ 1.0, 5.0, 0.0 ], + [ 0.0, 2.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "y_out": [ 7.0, 8.0, 9.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_oa.json new file mode 100644 index 000000000000..0cce9df556ed --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_oa.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "row-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 0.0, 1.0, 2.0, 0.0, 4.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 2.0, 0.0 ], + [ 0.0, 4.0, 5.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 2, + "strideA2": 1, + "offsetA": 1, + "y_out": [ 4.0, 7.0, 10.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2.json new file mode 100644 index 000000000000..5270bedf2bf0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "row-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 0.0, 1.0, 4.0, 0.0, 0.0, 2.0, 5.0, 0.0, 0.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 2.0, 0.0 ], + [ 0.0, 4.0, 5.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 2, + "strideA2": 3, + "offsetA": 0, + "y_out": [ 5.0, 8.0, 6.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2n.json new file mode 100644 index 000000000000..8e9303457c81 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2n.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "row-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 0.0, 0.0, 1.0, 4.0, 0.0, 0.0, 2.0, 5.0, 0.0, 0.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 2.0, 0.0 ], + [ 0.0, 4.0, 5.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 2, + "strideA2": -3, + "offsetA": 8, + "y_out": [ 7.0, 7.0, 2.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2.json new file mode 100644 index 000000000000..fc6669d89f17 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "row-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 0.0, 0.0, 1.0, 4.0, 0.0, 0.0, 2.0, 5.0, 0.0, 0.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 2.0, 0.0 ], + [ 0.0, 4.0, 5.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": -2, + "strideA2": 3, + "offsetA": 2, + "y_out": [ 1.0, 5.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2n.json new file mode 100644 index 000000000000..847c3e0ad274 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2n.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "row-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 0.0, 0.0, 1.0, 4.0, 0.0, 0.0, 2.0, 5.0, 0.0, 0.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 2.0, 0.0 ], + [ 0.0, 4.0, 5.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": -2, + "strideA2": -3, + "offsetA": 8, + "y_out": [ 3.0, 6.0, 2.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_u.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_u.json new file mode 100644 index 000000000000..dea3021d56db --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_u.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "row-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 1.0, 2.0, 0.0, 4.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 2.0, 0.0 ], + [ 0.0, 4.0, 5.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "y_out": [ 4.0, 7.0, 10.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyn.json new file mode 100644 index 000000000000..78a1590aeddb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyn.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "row-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": -1, + "offsetX": 2, + "strideY": -1, + "offsetY": 2, + "LDA": 2, + "A": [ 1.0, 2.0, 0.0, 4.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 2.0, 0.0 ], + [ 0.0, 4.0, 5.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "y_out": [ 10.0, 7.0, 4.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyp.json new file mode 100644 index 000000000000..91ff3c8f396c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyp.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "row-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": -1, + "offsetX": 2, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 1.0, 2.0, 0.0, 4.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 2.0, 0.0 ], + [ 0.0, 4.0, 5.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "y_out": [ 4.0, 7.0, 10.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyn.json new file mode 100644 index 000000000000..97a176fdef02 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyn.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "row-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": -1, + "offsetY": 2, + "LDA": 2, + "A": [ 1.0, 2.0, 0.0, 4.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 2.0, 0.0 ], + [ 0.0, 4.0, 5.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "y_out": [ 10.0, 7.0, 4.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyp.json new file mode 100644 index 000000000000..dea3021d56db --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyp.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "order": "row-major", + "N": 3, + "K": 1, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 1, + "offsetY": 0, + "LDA": 2, + "A": [ 1.0, 2.0, 0.0, 4.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 2.0, 0.0 ], + [ 0.0, 4.0, 5.0 ], + [ 0.0, 0.0, 6.0 ] + ], + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 1.0, 1.0 ], + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "y_out": [ 4.0, 7.0, 10.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/test.js b/lib/node_modules/@stdlib/blas/base/ssbmv/test/test.js new file mode 100644 index 000000000000..91856765a489 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var ssbmv = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': IS_BROWSER +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof ssbmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof ssbmv.ndarray, 'function', 'method is a function' ); + t.end(); +}); + +tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { + var ssbmv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( ssbmv, mock, 'returns expected value' ); + t.end(); + + function tryRequire() { + return mock; + } + + function mock() { + // Mock... + } +}); + +tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { + var ssbmv; + var main; + + main = require( './../lib/ssbmv.js' ); + + ssbmv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( ssbmv, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/ssbmv/test/test.ndarray.js new file mode 100644 index 000000000000..af83e6ff2990 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/test.ndarray.js @@ -0,0 +1,841 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float32Array = require( '@stdlib/array/float32' ); +var ssbmv = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var rap = require( './fixtures/row_major_complex_access_pattern.json' ); +var roa = require( './fixtures/row_major_oa.json' ); +var rsa1sa2 = require( './fixtures/row_major_sa1_sa2.json' ); +var rsa1nsa2 = require( './fixtures/row_major_sa1n_sa2.json' ); +var rsa1sa2n = require( './fixtures/row_major_sa1_sa2n.json' ); +var rsa1nsa2n = require( './fixtures/row_major_sa1n_sa2n.json' ); +var rl = require( './fixtures/row_major_l.json' ); +var ru = require( './fixtures/row_major_u.json' ); +var rxpyp = require( './fixtures/row_major_xpyp.json' ); +var rxnyp = require( './fixtures/row_major_xnyp.json' ); +var rxpyn = require( './fixtures/row_major_xpyn.json' ); +var rxnyn = require( './fixtures/row_major_xnyn.json' ); + +var cap = require( './fixtures/column_major_complex_access_pattern.json' ); +var coa = require( './fixtures/column_major_oa.json' ); +var csa1sa2 = require( './fixtures/column_major_sa1_sa2.json' ); +var csa1nsa2 = require( './fixtures/column_major_sa1n_sa2.json' ); +var csa1sa2n = require( './fixtures/column_major_sa1_sa2n.json' ); +var csa1nsa2n = require( './fixtures/column_major_sa1n_sa2n.json' ); +var cl = require( './fixtures/column_major_l.json' ); +var cu = require( './fixtures/column_major_u.json' ); +var cxpyp = require( './fixtures/column_major_xpyp.json' ); +var cxnyp = require( './fixtures/column_major_xnyp.json' ); +var cxpyn = require( './fixtures/column_major_xpyn.json' ); +var cxnyn = require( './fixtures/column_major_xnyn.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof ssbmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 15', function test( t ) { + t.strictEqual( ssbmv.length, 15, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssbmv( value, rl.N, rl.K, rl.alpha, new Float32Array( rl.A ), rl.strideA1, rl.strideA2, rl.offsetA, new Float32Array( rl.x ), rl.strideX, rl.offsetX, rl.beta, new Float32Array( rl.y ), rl.strideY, rl.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var i; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssbmv( rl.uplo, value, rl.K, rl.alpha, new Float32Array( rl.A ), rl.strideA1, rl.strideA2, rl.offsetA, new Float32Array( rl.x ), rl.strideX, rl.offsetX, rl.beta, new Float32Array( rl.y ), rl.strideY, rl.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', function test( t ) { + var values; + var i; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssbmv( rl.uplo, rl.N, value, rl.alpha, new Float32Array( rl.A ), rl.strideA1, rl.strideA2, rl.offsetA, new Float32Array( rl.x ), rl.strideX, rl.offsetX, rl.beta, new Float32Array( rl.y ), rl.strideY, rl.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid sixth argument', function test( t ) { + var values; + var i; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssbmv( rl.uplo, rl.N, rl.K, rl.alpha, new Float32Array( rl.A ), value, rl.strideA2, rl.offsetA, new Float32Array( rl.x ), rl.strideX, rl.offsetX, rl.beta, new Float32Array( rl.y ), rl.strideY, rl.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid seventh argument', function test( t ) { + var values; + var i; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssbmv( rl.uplo, rl.N, rl.K, rl.alpha, new Float32Array( rl.A ), rl.strideA1, value, rl.offsetA, new Float32Array( rl.x ), rl.strideX, rl.offsetX, rl.beta, new Float32Array( rl.y ), rl.strideY, rl.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid tenth argument', function test( t ) { + var values; + var i; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssbmv( rl.uplo, rl.N, rl.K, rl.alpha, new Float32Array( rl.A ), rl.strideA1, rl.strideA2, rl.offsetA, new Float32Array( rl.x ), value, rl.offsetX, rl.beta, new Float32Array( rl.y ), rl.strideY, rl.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourteenth argument', function test( t ) { + var values; + var i; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssbmv( rl.uplo, rl.N, rl.K, rl.alpha, new Float32Array( rl.A ), rl.strideA1, rl.strideA2, rl.offsetA, new Float32Array( rl.x ), rl.strideX, rl.offsetX, rl.beta, new Float32Array( rl.y ), value, rl.offsetY ); + }; + } +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, lower)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rl.A ); + x = new Float32Array( rl.x ); + y = new Float32Array( rl.y ); + + expected = new Float32Array( rl.y_out ); + + out = ssbmv( rl.uplo, rl.N, rl.K, rl.alpha, a, rl.strideA1, rl.strideA2, rl.offsetA, x, rl.strideX, rl.offsetX, rl.beta, y, rl.strideY, rl.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, lower)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cl.A ); + x = new Float32Array( cl.x ); + y = new Float32Array( cl.y ); + + expected = new Float32Array( cl.y_out ); + + out = ssbmv( cl.uplo, cl.N, cl.K, cl.alpha, a, cl.strideA1, cl.strideA2, cl.offsetA, x, cl.strideX, cl.offsetX, cl.beta, y, cl.strideY, cl.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, upper)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( ru.A ); + x = new Float32Array( ru.x ); + y = new Float32Array( ru.y ); + + expected = new Float32Array( ru.y_out ); + + out = ssbmv( ru.uplo, ru.N, ru.K, ru.alpha, a, ru.strideA1, ru.strideA2, ru.offsetA, x, ru.strideX, ru.offsetX, ru.beta, y, ru.strideY, ru.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, upper)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cu.A ); + x = new Float32Array( cu.x ); + y = new Float32Array( cu.y ); + + expected = new Float32Array( cu.y_out ); + + out = ssbmv( cu.uplo, cu.N, cu.K, cu.alpha, a, cu.strideA1, cu.strideA2, cu.offsetA, x, cu.strideX, cu.offsetX, cu.beta, y, cu.strideY, cu.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector', function test( t ) { + var out; + var a; + var x; + var y; + + a = new Float32Array( rl.A ); + x = new Float32Array( rl.x ); + y = new Float32Array( rl.y ); + + out = ssbmv( rl.uplo, rl.N, rl.K, rl.alpha, a, rl.strideA1, rl.strideA2, rl.offsetA, x, rl.strideX, rl.offsetX, rl.beta, y, rl.strideY, rl.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero or the scalar constants are zero and unity, respectively, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rl.A ); + x = new Float32Array( rl.x ); + y = new Float32Array( rl.y ); + + expected = new Float32Array( rl.y ); + + out = ssbmv( rl.uplo, 0, rl.K, rl.alpha, a, rl.strideA1, rl.strideA2, rl.offsetA, x, rl.strideX, rl.offsetX, rl.beta, y, rl.strideY, rl.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + out = ssbmv( rl.uplo, rl.N, rl.K, 0.0, a, rl.strideA1, rl.strideA2, rl.offsetA, x, rl.strideX, rl.offsetX, 1.0, y, rl.strideY, rl.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero or the scalar constants are zero and unity, respectively, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cl.A ); + x = new Float32Array( cl.x ); + y = new Float32Array( cl.y ); + + expected = new Float32Array( cl.y ); + + out = ssbmv( cl.uplo, 0, cl.K, cl.alpha, a, cl.strideA1, cl.strideA2, cl.offsetA, x, cl.strideX, cl.offsetX, cl.beta, y, cl.strideY, cl.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + out = ssbmv( cl.uplo, cl.N, cl.K, 0.0, a, cl.strideA1, cl.strideA2, cl.offsetA, x, cl.strideX, cl.offsetX, 1.0, y, cl.strideY, cl.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'when `α` is zero, the function scales the second input vector (row-major, upper)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( ru.A ); + x = new Float32Array( ru.x ); + y = new Float32Array( ru.y ); + + expected = new Float32Array( ru.y.length ); + + out = ssbmv( ru.uplo, ru.N, ru.K, 0.0, a, ru.strideA1, ru.strideA2, ru.offsetA, x, ru.strideX, ru.offsetX, 0.0, y, ru.strideY, ru.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'when `α` is zero, the function scales the second input vector (row-major, lower)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rl.A ); + x = new Float32Array( rl.x ); + y = new Float32Array( rl.y ); + + expected = new Float32Array( rl.y.length ); + + out = ssbmv( rl.uplo, rl.N, rl.K, 0.0, a, rl.strideA1, rl.strideA2, rl.offsetA, x, rl.strideX, rl.offsetX, 0.0, y, rl.strideY, rl.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'when `α` is zero, the function scales the second input vector (column-major, upper)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cu.A ); + x = new Float32Array( cu.x ); + y = new Float32Array( cu.y ); + + expected = new Float32Array( cu.y.length ); + + out = ssbmv( cu.uplo, cu.N, cu.K, 0.0, a, cu.strideA1, cu.strideA2, cu.offsetA, x, cu.strideX, cu.offsetX, 0.0, y, cu.strideY, cu.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'when `α` is zero, the function scales the second input vector (column-major, lower)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cl.A ); + x = new Float32Array( cl.x ); + y = new Float32Array( cl.y ); + + expected = new Float32Array( cl.y.length ); + + out = ssbmv( cl.uplo, cl.N, cl.K, 0, a, cl.strideA1, cl.strideA2, cl.offsetA, x, cl.strideX, cl.offsetX, 0.0, y, cl.strideY, cl.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, oa=1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( roa.A ); + x = new Float32Array( roa.x ); + y = new Float32Array( roa.y ); + + expected = new Float32Array( roa.y_out ); + + out = ssbmv( roa.uplo, roa.N, roa.K, roa.alpha, a, roa.strideA1, roa.strideA2, roa.offsetA, x, roa.strideX, roa.offsetX, roa.beta, y, roa.strideY, roa.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, oa=1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( coa.A ); + x = new Float32Array( coa.x ); + y = new Float32Array( coa.y ); + + expected = new Float32Array( coa.y_out ); + + out = ssbmv( coa.uplo, coa.N, coa.K, coa.alpha, a, coa.strideA1, coa.strideA2, coa.offsetA, x, coa.strideX, coa.offsetX, coa.beta, y, coa.strideY, coa.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sa1=2, sa2=3)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rsa1sa2.A ); + x = new Float32Array( rsa1sa2.x ); + y = new Float32Array( rsa1sa2.y ); + + expected = new Float32Array( rsa1sa2.y_out ); + + out = ssbmv( rsa1sa2.uplo, rsa1sa2.N, rsa1sa2.K, rsa1sa2.alpha, a, rsa1sa2.strideA1, rsa1sa2.strideA2, rsa1sa2.offsetA, x, rsa1sa2.strideX, rsa1sa2.offsetX, rsa1sa2.beta, y, rsa1sa2.strideY, rsa1sa2.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sa1=3, sa2=2)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( csa1sa2.A ); + x = new Float32Array( csa1sa2.x ); + y = new Float32Array( csa1sa2.y ); + + expected = new Float32Array( csa1sa2.y_out ); + + out = ssbmv( csa1sa2.uplo, csa1sa2.N, csa1sa2.K, csa1sa2.alpha, a, csa1sa2.strideA1, csa1sa2.strideA2, csa1sa2.offsetA, x, csa1sa2.strideX, csa1sa2.offsetX, csa1sa2.beta, y, csa1sa2.strideY, csa1sa2.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sa1=-2, sa2=3)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rsa1nsa2.A ); + x = new Float32Array( rsa1nsa2.x ); + y = new Float32Array( rsa1nsa2.y ); + + expected = new Float32Array( rsa1nsa2.y_out ); + + out = ssbmv( rsa1nsa2.uplo, rsa1nsa2.N, rsa1nsa2.K, rsa1nsa2.alpha, a, rsa1nsa2.strideA1, rsa1nsa2.strideA2, rsa1nsa2.offsetA, x, rsa1nsa2.strideX, rsa1nsa2.offsetX, rsa1nsa2.beta, y, rsa1nsa2.strideY, rsa1nsa2.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sa1=-3, sa2=2)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( csa1nsa2.A ); + x = new Float32Array( csa1nsa2.x ); + y = new Float32Array( csa1nsa2.y ); + + expected = new Float32Array( csa1nsa2.y_out ); + + out = ssbmv( csa1nsa2.uplo, csa1nsa2.N, csa1nsa2.K, csa1nsa2.alpha, a, csa1nsa2.strideA1, csa1nsa2.strideA2, csa1nsa2.offsetA, x, csa1nsa2.strideX, csa1nsa2.offsetX, csa1nsa2.beta, y, csa1nsa2.strideY, csa1nsa2.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sa1=2, sa2=-3)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rsa1sa2n.A ); + x = new Float32Array( rsa1sa2n.x ); + y = new Float32Array( rsa1sa2n.y ); + + expected = new Float32Array( rsa1sa2n.y_out ); + + out = ssbmv( rsa1sa2n.uplo, rsa1sa2n.N, rsa1sa2n.K, rsa1sa2n.alpha, a, rsa1sa2n.strideA1, rsa1sa2n.strideA2, rsa1sa2n.offsetA, x, rsa1sa2n.strideX, rsa1sa2n.offsetX, rsa1sa2n.beta, y, rsa1sa2n.strideY, rsa1sa2n.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sa1=3, sa2=-2)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( csa1sa2n.A ); + x = new Float32Array( csa1sa2n.x ); + y = new Float32Array( csa1sa2n.y ); + + expected = new Float32Array( csa1sa2n.y_out ); + + out = ssbmv( csa1sa2n.uplo, csa1sa2n.N, csa1sa2n.K, csa1sa2n.alpha, a, csa1sa2n.strideA1, csa1sa2n.strideA2, csa1sa2n.offsetA, x, csa1sa2n.strideX, csa1sa2n.offsetX, csa1sa2n.beta, y, csa1sa2n.strideY, csa1sa2n.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sa1=-2, sa2=-3)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rsa1nsa2n.A ); + x = new Float32Array( rsa1nsa2n.x ); + y = new Float32Array( rsa1nsa2n.y ); + + expected = new Float32Array( rsa1nsa2n.y_out ); + + out = ssbmv( rsa1nsa2n.uplo, rsa1nsa2n.N, rsa1nsa2n.K, rsa1nsa2n.alpha, a, rsa1nsa2n.strideA1, rsa1nsa2n.strideA2, rsa1nsa2n.offsetA, x, rsa1nsa2n.strideX, rsa1nsa2n.offsetX, rsa1nsa2n.beta, y, rsa1nsa2n.strideY, rsa1nsa2n.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sa1=-3, sa2=-2)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( csa1nsa2n.A ); + x = new Float32Array( csa1nsa2n.x ); + y = new Float32Array( csa1nsa2n.y ); + + expected = new Float32Array( csa1nsa2n.y_out ); + + out = ssbmv( csa1nsa2n.uplo, csa1nsa2n.N, csa1nsa2n.K, csa1nsa2n.alpha, a, csa1nsa2n.strideA1, csa1nsa2n.strideA2, csa1nsa2n.offsetA, x, csa1nsa2n.strideX, csa1nsa2n.offsetX, csa1nsa2n.beta, y, csa1nsa2n.strideY, csa1nsa2n.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sx=1, sy=1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rxpyp.A ); + x = new Float32Array( rxpyp.x ); + y = new Float32Array( rxpyp.y ); + + expected = new Float32Array( rxpyp.y_out ); + + out = ssbmv( rxpyp.uplo, rxpyp.N, rxpyp.K, rxpyp.alpha, a, rxpyp.strideA1, rxpyp.strideA2, rxpyp.offsetA, x, rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, y, rxpyp.strideY, rxpyp.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sx=1, sy=1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cxpyp.A ); + x = new Float32Array( cxpyp.x ); + y = new Float32Array( cxpyp.y ); + + expected = new Float32Array( cxpyp.y_out ); + + out = ssbmv( cxpyp.uplo, cxpyp.N, cxpyp.K, cxpyp.alpha, a, cxpyp.strideA1, cxpyp.strideA2, cxpyp.offsetA, x, cxpyp.strideX, cxpyp.offsetX, cxpyp.beta, y, cxpyp.strideY, cxpyp.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sx=1, sy=-1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rxpyn.A ); + x = new Float32Array( rxpyn.x ); + y = new Float32Array( rxpyn.y ); + + expected = new Float32Array( rxpyn.y_out ); + + out = ssbmv( rxpyn.uplo, rxpyn.N, rxpyn.K, rxpyn.alpha, a, rxpyn.strideA1, rxpyn.strideA2, rxpyn.offsetA, x, rxpyn.strideX, rxpyn.offsetX, rxpyn.beta, y, rxpyn.strideY, rxpyn.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sx=1, sy=-1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cxpyn.A ); + x = new Float32Array( cxpyn.x ); + y = new Float32Array( cxpyn.y ); + + expected = new Float32Array( cxpyn.y_out ); + + out = ssbmv( cxpyn.uplo, cxpyn.N, cxpyn.K, cxpyn.alpha, a, cxpyn.strideA1, cxpyn.strideA2, cxpyn.offsetA, x, cxpyn.strideX, cxpyn.offsetX, cxpyn.beta, y, cxpyn.strideY, cxpyn.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sx=-1, sy=1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rxnyp.A ); + x = new Float32Array( rxnyp.x ); + y = new Float32Array( rxnyp.y ); + + expected = new Float32Array( rxnyp.y_out ); + + out = ssbmv( rxnyp.uplo, rxnyp.N, rxnyp.K, rxnyp.alpha, a, rxnyp.strideA1, rxnyp.strideA2, rxnyp.offsetA, x, rxnyp.strideX, rxnyp.offsetX, rxnyp.beta, y, rxnyp.strideY, rxnyp.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sx=-1, sy=1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cxnyp.A ); + x = new Float32Array( cxnyp.x ); + y = new Float32Array( cxnyp.y ); + + expected = new Float32Array( cxnyp.y_out ); + + out = ssbmv( cxnyp.uplo, cxnyp.N, cxnyp.K, cxnyp.alpha, a, cxnyp.strideA1, cxnyp.strideA2, cxnyp.offsetA, x, cxnyp.strideX, cxnyp.offsetX, cxnyp.beta, y, cxnyp.strideY, cxnyp.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sx=-1, sy=-1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rxnyn.A ); + x = new Float32Array( rxnyn.x ); + y = new Float32Array( rxnyn.y ); + + expected = new Float32Array( rxnyn.y_out ); + + out = ssbmv( rxnyn.uplo, rxnyn.N, rxnyn.K, rxnyn.alpha, a, rxnyn.strideA1, rxnyn.strideA2, rxnyn.offsetA, x, rxnyn.strideX, rxnyn.offsetX, rxnyn.beta, y, rxnyn.strideY, rxnyn.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sx=-1, sy=-1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cxnyn.A ); + x = new Float32Array( cxnyn.x ); + y = new Float32Array( cxnyn.y ); + + expected = new Float32Array( cxnyn.y_out ); + + out = ssbmv( cxnyn.uplo, cxnyn.N, cxnyn.K, cxnyn.alpha, a, cxnyn.strideA1, cxnyn.strideA2, cxnyn.offsetA, x, cxnyn.strideX, cxnyn.offsetX, cxnyn.beta, y, cxnyn.strideY, cxnyn.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (row-major)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rap.A ); + x = new Float32Array( rap.x ); + y = new Float32Array( rap.y ); + + expected = new Float32Array( rap.y_out ); + + out = ssbmv( rap.uplo, rap.N, rap.K, rap.alpha, a, rap.strideA1, rap.strideA2, rap.offsetA, x, rap.strideX, rap.offsetX, rap.beta, y, rap.strideY, rap.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (column-major)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cap.A ); + x = new Float32Array( cap.x ); + y = new Float32Array( cap.y ); + + expected = new Float32Array( cap.y_out ); + + out = ssbmv( cap.uplo, cap.N, cap.K, cap.alpha, a, cap.strideA1, cap.strideA2, cap.offsetA, x, cap.strideX, cap.offsetX, cap.beta, y, cap.strideY, cap.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/test.ssbmv.js b/lib/node_modules/@stdlib/blas/base/ssbmv/test/test.ssbmv.js new file mode 100644 index 000000000000..afff828f6c1e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/test.ssbmv.js @@ -0,0 +1,592 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float32Array = require( '@stdlib/array/float32' ); +var ssbmv = require( './../lib/ssbmv.js' ); + + +// FIXTURES // + +var rl = require( './fixtures/row_major_l.json' ); +var ru = require( './fixtures/row_major_u.json' ); +var rxpyp = require( './fixtures/row_major_xpyp.json' ); +var rxnyp = require( './fixtures/row_major_xnyp.json' ); +var rxpyn = require( './fixtures/row_major_xpyn.json' ); +var rxnyn = require( './fixtures/row_major_xnyn.json' ); + +var cl = require( './fixtures/column_major_l.json' ); +var cu = require( './fixtures/column_major_u.json' ); +var cxpyp = require( './fixtures/column_major_xpyp.json' ); +var cxnyp = require( './fixtures/column_major_xnyp.json' ); +var cxpyn = require( './fixtures/column_major_xpyn.json' ); +var cxnyn = require( './fixtures/column_major_xnyn.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof ssbmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 12', function test( t ) { + t.strictEqual( ssbmv.length, 12, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssbmv( value, rl.uplo, rl.N, rl.K, rl.alpha, new Float32Array( rl.A ), rl.LDA, new Float32Array( rl.x ), rl.strideX, rl.beta, new Float32Array( rl.y ), rl.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssbmv( rl.order, value, rl.N, rl.K, rl.alpha, new Float32Array( rl.A ), rl.LDA, new Float32Array( rl.x ), rl.strideX, rl.beta, new Float32Array( rl.y ), rl.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', function test( t ) { + var values; + var i; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssbmv( rl.order, rl.uplo, value, rl.K, rl.alpha, new Float32Array( rl.A ), rl.LDA, new Float32Array( rl.x ), rl.strideX, rl.beta, new Float32Array( rl.y ), rl.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourth argument', function test( t ) { + var values; + var i; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssbmv( rl.order, rl.uplo, rl.N, value, rl.alpha, new Float32Array( rl.A ), 3, new Float32Array( rl.x ), rl.strideX, rl.beta, new Float32Array( rl.y ), rl.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid seventh argument', function test( t ) { + var values; + var i; + + values = [ + 1 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssbmv( rl.order, rl.uplo, rl.N, rl.K, rl.alpha, new Float32Array( rl.A ), value, new Float32Array( rl.x ), rl.strideX, rl.beta, new Float32Array( rl.y ), rl.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid ninth argument', function test( t ) { + var values; + var i; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssbmv( rl.order, rl.uplo, rl.N, rl.K, rl.alpha, new Float32Array( rl.A ), rl.LDA, new Float32Array( rl.x ), value, rl.beta, new Float32Array( rl.y ), rl.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid twelfth argument', function test( t ) { + var values; + var i; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssbmv( rl.order, rl.uplo, rl.N, rl.K, rl.alpha, new Float32Array( rl.A ), rl.LDA, new Float32Array( rl.x ), rl.strideX, rl.beta, new Float32Array( rl.y ), value ); + }; + } +}); + +tape( 'the function performs matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals (row-major, lower)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rl.A ); + x = new Float32Array( rl.x ); + y = new Float32Array( rl.y ); + + expected = new Float32Array( rl.y_out ); + + out = ssbmv( rl.order, rl.uplo, rl.N, rl.K, rl.alpha, a, rl.LDA, x, rl.strideX, rl.beta, y, rl.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals (column-major, lower)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cl.A ); + x = new Float32Array( cl.x ); + y = new Float32Array( cl.y ); + + expected = new Float32Array( cl.y_out ); + + out = ssbmv( cl.order, cl.uplo, cl.N, cl.K, cl.alpha, a, cl.LDA, x, cl.strideX, cl.beta, y, cl.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals (row-major, upper)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( ru.A ); + x = new Float32Array( ru.x ); + y = new Float32Array( ru.y ); + + expected = new Float32Array( ru.y_out ); + + out = ssbmv( ru.order, ru.uplo, ru.N, ru.K, ru.alpha, a, ru.LDA, x, ru.strideX, ru.beta, y, ru.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals (column-major, upper)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cu.A ); + x = new Float32Array( cu.x ); + y = new Float32Array( cu.y ); + + expected = new Float32Array( cu.y_out ); + + out = ssbmv( cu.order, cu.uplo, cu.N, cu.K, cu.alpha, a, cu.LDA, x, cu.strideX, cu.beta, y, cu.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector', function test( t ) { + var out; + var a; + var x; + var y; + + a = new Float32Array( rl.A ); + x = new Float32Array( rl.x ); + y = new Float32Array( rl.y ); + + out = ssbmv( rl.order, rl.uplo, rl.N, rl.K, rl.alpha, a, rl.LDA, x, rl.strideX, rl.beta, y, rl.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero or the scalar constants are zero and unity, respectively, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rl.A ); + x = new Float32Array( rl.x ); + y = new Float32Array( rl.y ); + + expected = new Float32Array( rl.y ); + + out = ssbmv( rl.order, rl.uplo, 0, rl.K, rl.alpha, a, rl.LDA, x, rl.strideX, rl.beta, y, rl.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + out = ssbmv( rl.order, rl.uplo, rl.N, rl.K, 0.0, a, rl.LDA, x, rl.strideX, 1.0, y, rl.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero or the scalar constants are zero and unity, respectively, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cl.A ); + x = new Float32Array( cl.x ); + y = new Float32Array( cl.y ); + + expected = new Float32Array( cl.y ); + + out = ssbmv( cl.order, cl.uplo, 0, cl.K, cl.alpha, a, cl.LDA, x, cl.strideX, cl.beta, y, cl.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + out = ssbmv( cl.order, cl.uplo, cl.N, cl.K, 0.0, a, cl.LDA, x, cl.strideX, 1.0, y, cl.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'when `α` is zero, the function scales the second input vector (row-major, upper)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( ru.A ); + x = new Float32Array( ru.x ); + y = new Float32Array( ru.y ); + + expected = new Float32Array( ru.y.length ); + + out = ssbmv( ru.order, ru.uplo, ru.N, ru.K, 0.0, a, ru.LDA, x, ru.strideX, 0.0, y, ru.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'when `α` is zero, the function scales the second input vector (row-major, lower)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rl.A ); + x = new Float32Array( rl.x ); + y = new Float32Array( rl.y ); + + expected = new Float32Array( rl.y.length ); + + out = ssbmv( rl.order, rl.uplo, rl.N, rl.K, 0.0, a, rl.LDA, x, rl.strideX, 0.0, y, rl.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'when `α` is zero, the function scales the second input vector (column-major, upper)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cu.A ); + x = new Float32Array( cu.x ); + y = new Float32Array( cu.y ); + + expected = new Float32Array( cu.y.length ); + + out = ssbmv( cu.order, cu.uplo, cu.N, cu.K, 0.0, a, cu.LDA, x, cu.strideX, 0.0, y, cu.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'when `α` is zero, the function scales the second input vector (column-major, lower)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cl.A ); + x = new Float32Array( cl.x ); + y = new Float32Array( cl.y ); + + expected = new Float32Array( cl.y.length ); + + out = ssbmv( cl.order, cl.uplo, cl.N, cl.K, 0.0, a, cl.LDA, x, cl.strideX, 0.0, y, cl.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric band matrix, with `K` super-diagonals (row-major, sx=1, sy=1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rxpyp.A ); + x = new Float32Array( rxpyp.x ); + y = new Float32Array( rxpyp.y ); + + expected = new Float32Array( rxpyp.y_out ); + + out = ssbmv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.K, rxpyp.alpha, a, rxpyp.LDA, x, rxpyp.strideX, rxpyp.beta, y, rxpyp.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` banded symmetric matrix (column-major, sx=1, sy=1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cxpyp.A ); + x = new Float32Array( cxpyp.x ); + y = new Float32Array( cxpyp.y ); + + expected = new Float32Array( cxpyp.y_out ); + + out = ssbmv( cxpyp.order, cxpyp.uplo, cxpyp.N, cxpyp.K, cxpyp.alpha, a, cxpyp.LDA, x, cxpyp.strideX, cxpyp.beta, y, cxpyp.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` banded symmetric matrix (row-major, sx=-1, sy=1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rxnyp.A ); + x = new Float32Array( rxnyp.x ); + y = new Float32Array( rxnyp.y ); + + expected = new Float32Array( rxnyp.y_out ); + + out = ssbmv( rxnyp.order, rxnyp.uplo, rxnyp.N, rxnyp.K, rxnyp.alpha, a, rxnyp.LDA, x, rxnyp.strideX, rxnyp.beta, y, rxnyp.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` banded symmetric matrix (column-major, sx=-1, sy=1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cxnyp.A ); + x = new Float32Array( cxnyp.x ); + y = new Float32Array( cxnyp.y ); + + expected = new Float32Array( cxnyp.y_out ); + + out = ssbmv( cxnyp.order, cxnyp.uplo, cxnyp.N, cxnyp.K, cxnyp.alpha, a, cxnyp.LDA, x, cxnyp.strideX, cxnyp.beta, y, cxnyp.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` banded symmetric matrix (row-major, sx=1, sy=-1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rxpyn.A ); + x = new Float32Array( rxpyn.x ); + y = new Float32Array( rxpyn.y ); + + expected = new Float32Array( rxpyn.y_out ); + + out = ssbmv( rxpyn.order, rxpyn.uplo, rxpyn.N, rxpyn.K, rxpyn.alpha, a, rxpyn.LDA, x, rxpyn.strideX, rxpyn.beta, y, rxpyn.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` banded symmetric matrix (column-major, sx=1, sy=-1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cxpyn.A ); + x = new Float32Array( cxpyn.x ); + y = new Float32Array( cxpyn.y ); + + expected = new Float32Array( cxpyn.y_out ); + + out = ssbmv( cxpyn.order, cxpyn.uplo, cxpyn.N, cxpyn.K, cxpyn.alpha, a, cxpyn.LDA, x, cxpyn.strideX, cxpyn.beta, y, cxpyn.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` banded symmetric matrix (row-major, sx=-1, sy=-1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( rxnyn.A ); + x = new Float32Array( rxnyn.x ); + y = new Float32Array( rxnyn.y ); + + expected = new Float32Array( rxnyn.y_out ); + + out = ssbmv( rxnyn.order, rxnyn.uplo, rxnyn.N, rxnyn.K, rxnyn.alpha, a, rxnyn.LDA, x, rxnyn.strideX, rxnyn.beta, y, rxnyn.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` banded symmetric matrix (column-major, sx=-1, sy=-1)', function test( t ) { + var expected; + var out; + var a; + var x; + var y; + + a = new Float32Array( cxnyn.A ); + x = new Float32Array( cxnyn.x ); + y = new Float32Array( cxnyn.y ); + + expected = new Float32Array( cxnyn.y_out ); + + out = ssbmv( cxnyn.order, cxnyn.uplo, cxnyn.N, cxnyn.K, cxnyn.alpha, a, cxnyn.LDA, x, cxnyn.strideX, cxnyn.beta, y, cxnyn.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); From 2537f059abf8a4cf48dd39614b183df9b715407d Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 13 Apr 2025 17:52:01 +0530 Subject: [PATCH 2/8] chore: update test cases --- 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: 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/ssbmv/test/fixtures/column_major_l.json | 4 ++-- .../blas/base/ssbmv/test/fixtures/column_major_oa.json | 4 ++-- .../blas/base/ssbmv/test/fixtures/column_major_u.json | 5 ++--- .../blas/base/ssbmv/test/fixtures/column_major_xnyn.json | 4 ++-- .../blas/base/ssbmv/test/fixtures/column_major_xnyp.json | 5 ++--- .../blas/base/ssbmv/test/fixtures/column_major_xpyn.json | 4 ++-- .../blas/base/ssbmv/test/fixtures/column_major_xpyp.json | 4 ++-- .../@stdlib/blas/base/ssbmv/test/fixtures/row_major_l.json | 4 ++-- .../@stdlib/blas/base/ssbmv/test/fixtures/row_major_oa.json | 5 +++-- .../@stdlib/blas/base/ssbmv/test/fixtures/row_major_u.json | 4 ++-- .../blas/base/ssbmv/test/fixtures/row_major_xnyn.json | 4 ++-- .../blas/base/ssbmv/test/fixtures/row_major_xnyp.json | 4 ++-- .../blas/base/ssbmv/test/fixtures/row_major_xpyn.json | 4 ++-- .../blas/base/ssbmv/test/fixtures/row_major_xpyp.json | 4 ++-- 14 files changed, 29 insertions(+), 30 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_l.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_l.json index eb9842ab834a..290c784d625f 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_l.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_l.json @@ -10,7 +10,7 @@ "strideY": 1, "offsetY": 0, "LDA": 2, - "A": [ 4.0, 1.0, 0.0, 5.0, 2.0, 6.0 ], + "A": [ 0.0, 1.0, 2.0, 4.0, 5.0, 6.0 ], "A_mat": [ [ 4.0, 0.0, 0.0 ], [ 1.0, 5.0, 0.0 ], @@ -21,5 +21,5 @@ "strideA1": 1, "strideA2": 2, "offsetA": 0, - "y_out": [ 6.0, 7.0, 8.0 ] + "y_out": [ 2.0, 8.0, 10.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_oa.json index f413e2c5eada..0f2d800ee692 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_oa.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_oa.json @@ -10,7 +10,7 @@ "strideY": 1, "offsetY": 0, "LDA": 2, - "A": [ 0.0, 4.0, 1.0, 5.0, 0.0, 2.0, 6.0 ], + "A": [ 0.0, 4.0, 5.0, 6.0, 0.0, 1.0, 2.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -21,5 +21,5 @@ "strideA1": 1, "strideA2": 2, "offsetA": 1, - "y_out": [ 7.0, 8.0, 9.0 ] + "y_out": [ 12.0, 8.0, 4.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_u.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_u.json index 841b26106624..d85797a1a6da 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_u.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_u.json @@ -1,4 +1,3 @@ - { "uplo": "upper", "order": "column-major", @@ -11,7 +10,7 @@ "strideY": 1, "offsetY": 0, "LDA": 2, - "A": [ 4.0, 1.0, 5.0, 0.0, 2.0, 6.0 ], + "A": [ 4.0, 5.0, 6.0, 0.0, 1.0, 2.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -22,5 +21,5 @@ "strideA1": 1, "strideA2": 2, "offsetA": 0, - "y_out": [ 7.0, 8.0, 9.0 ] + "y_out": [ 12.0, 8.0, 4.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyn.json index be7a67702db2..271eced3c9e4 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyn.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyn.json @@ -10,7 +10,7 @@ "strideY": -1, "offsetY": 2, "LDA": 2, - "A": [ 4.0, 1.0, 5.0, 0.0, 2.0, 6.0 ], + "A": [ 4.0, 5.0, 6.0, 0.0, 1.0, 2.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -21,5 +21,5 @@ "strideA1": 1, "strideA2": 2, "offsetA": 0, - "y_out": [ 9.0, 8.0, 7.0 ] + "y_out": [ 4.0, 8.0, 12.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyp.json index 2fff669082df..781e253e7823 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyp.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyp.json @@ -1,4 +1,3 @@ - { "uplo": "upper", "order": "column-major", @@ -11,7 +10,7 @@ "strideY": 1, "offsetY": 0, "LDA": 2, - "A": [ 4.0, 1.0, 5.0, 0.0, 2.0, 6.0 ], + "A": [ 4.0, 5.0, 6.0, 0.0, 1.0, 2.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -22,5 +21,5 @@ "strideA1": 1, "strideA2": 2, "offsetA": 0, - "y_out": [ 7.0, 8.0, 9.0 ] + "y_out": [ 12.0, 8.0, 4.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyn.json index a7dde639a98f..d610e50cb055 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyn.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyn.json @@ -10,7 +10,7 @@ "strideY": -1, "offsetY": 2, "LDA": 2, - "A": [ 4.0, 1.0, 5.0, 0.0, 2.0, 6.0 ], + "A": [ 4.0, 5.0, 6.0, 0.0, 1.0, 2.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -21,5 +21,5 @@ "strideA1": 1, "strideA2": 2, "offsetA": 0, - "y_out": [ 9.0, 8.0, 7.0 ] + "y_out": [ 4.0, 8.0, 12.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyp.json index 04d045803e39..d85797a1a6da 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyp.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyp.json @@ -10,7 +10,7 @@ "strideY": 1, "offsetY": 0, "LDA": 2, - "A": [ 4.0, 1.0, 5.0, 0.0, 2.0, 6.0 ], + "A": [ 4.0, 5.0, 6.0, 0.0, 1.0, 2.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -21,5 +21,5 @@ "strideA1": 1, "strideA2": 2, "offsetA": 0, - "y_out": [ 7.0, 8.0, 9.0 ] + "y_out": [ 12.0, 8.0, 4.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_l.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_l.json index c31be9c3ab16..a1fa5dcef3bb 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_l.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_l.json @@ -10,7 +10,7 @@ "strideY": 1, "offsetY": 0, "LDA": 2, - "A": [ 4.0, 1.0, 5.0, 0.0, 2.0, 6.0 ], + "A": [ 4.0, 5.0, 6.0, 1.0, 2.0, 0.0 ], "A_mat": [ [ 4.0, 0.0, 0.0 ], [ 1.0, 5.0, 0.0 ], @@ -21,5 +21,5 @@ "strideA1": 2, "strideA2": 1, "offsetA": 0, - "y_out": [ 7.0, 8.0, 9.0 ] + "y_out": [ 12.0, 10.0, 3.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_oa.json index 0cce9df556ed..8aafd0fdc82d 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_oa.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_oa.json @@ -1,3 +1,4 @@ + { "uplo": "upper", "order": "row-major", @@ -10,7 +11,7 @@ "strideY": 1, "offsetY": 0, "LDA": 2, - "A": [ 0.0, 1.0, 2.0, 0.0, 4.0, 5.0, 6.0 ], + "A": [ 0.0, 0.0, 2.0, 5.0, 1.0, 4.0, 6.0 ], "A_mat": [ [ 1.0, 2.0, 0.0 ], [ 0.0, 4.0, 5.0 ], @@ -21,5 +22,5 @@ "strideA1": 2, "strideA2": 1, "offsetA": 1, - "y_out": [ 4.0, 7.0, 10.0 ] + "y_out": [ 3.0, 9.0, 6.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_u.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_u.json index dea3021d56db..56b10ad0eb34 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_u.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_u.json @@ -10,7 +10,7 @@ "strideY": 1, "offsetY": 0, "LDA": 2, - "A": [ 1.0, 2.0, 0.0, 4.0, 5.0, 6.0 ], + "A": [ 0.0, 2.0, 5.0, 1.0, 4.0, 6.0 ], "A_mat": [ [ 1.0, 2.0, 0.0 ], [ 0.0, 4.0, 5.0 ], @@ -21,5 +21,5 @@ "strideA1": 2, "strideA2": 1, "offsetA": 0, - "y_out": [ 4.0, 7.0, 10.0 ] + "y_out": [ 3.0, 9.0, 6.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyn.json index 78a1590aeddb..de666189bc4e 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyn.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyn.json @@ -10,7 +10,7 @@ "strideY": -1, "offsetY": 2, "LDA": 2, - "A": [ 1.0, 2.0, 0.0, 4.0, 5.0, 6.0 ], + "A": [ 0.0, 2.0, 5.0, 1.0, 4.0, 6.0 ], "A_mat": [ [ 1.0, 2.0, 0.0 ], [ 0.0, 4.0, 5.0 ], @@ -21,5 +21,5 @@ "strideA1": 2, "strideA2": 1, "offsetA": 0, - "y_out": [ 10.0, 7.0, 4.0 ] + "y_out": [ 6.0, 9.0, 3.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyp.json index 91ff3c8f396c..595302e9a6c9 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyp.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xnyp.json @@ -10,7 +10,7 @@ "strideY": 1, "offsetY": 0, "LDA": 2, - "A": [ 1.0, 2.0, 0.0, 4.0, 5.0, 6.0 ], + "A": [ 0.0, 2.0, 5.0, 1.0, 4.0, 6.0 ], "A_mat": [ [ 1.0, 2.0, 0.0 ], [ 0.0, 4.0, 5.0 ], @@ -21,5 +21,5 @@ "strideA1": 2, "strideA2": 1, "offsetA": 0, - "y_out": [ 4.0, 7.0, 10.0 ] + "y_out": [ 3.0, 9.0, 6.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyn.json index 97a176fdef02..6832804f92f4 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyn.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyn.json @@ -10,7 +10,7 @@ "strideY": -1, "offsetY": 2, "LDA": 2, - "A": [ 1.0, 2.0, 0.0, 4.0, 5.0, 6.0 ], + "A": [ 0.0, 2.0, 5.0, 1.0, 4.0, 6.0 ], "A_mat": [ [ 1.0, 2.0, 0.0 ], [ 0.0, 4.0, 5.0 ], @@ -21,5 +21,5 @@ "strideA1": 2, "strideA2": 1, "offsetA": 0, - "y_out": [ 10.0, 7.0, 4.0 ] + "y_out": [ 6.0, 9.0, 3.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyp.json index dea3021d56db..56b10ad0eb34 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyp.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_xpyp.json @@ -10,7 +10,7 @@ "strideY": 1, "offsetY": 0, "LDA": 2, - "A": [ 1.0, 2.0, 0.0, 4.0, 5.0, 6.0 ], + "A": [ 0.0, 2.0, 5.0, 1.0, 4.0, 6.0 ], "A_mat": [ [ 1.0, 2.0, 0.0 ], [ 0.0, 4.0, 5.0 ], @@ -21,5 +21,5 @@ "strideA1": 2, "strideA2": 1, "offsetA": 0, - "y_out": [ 4.0, 7.0, 10.0 ] + "y_out": [ 3.0, 9.0, 6.0 ] } From c7edfdeadbde94dd0390db32c2d2f1c8f3b1f82f Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Mon, 14 Apr 2025 11:48:08 +0530 Subject: [PATCH 3/8] chore: update examples Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/ssbmv/examples/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/ssbmv/examples/index.js index 888ca19d19a4..3f79a11ed6cc 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/examples/index.js @@ -27,10 +27,10 @@ var opts = { }; var N = 3; -var A = [ 1, 2, 0, 3, 4, 5 ]; +var A = [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0 ]; var x = discreteUniform( N, -10, 10, opts ); var y = discreteUniform( N, -10, 10, opts ); -ssbmv.ndarray( 'upper', N, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); +ssbmv.ndarray( 'upper', N, 1, 1.0, A, 2, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); console.log( y ); From 138eaa7361f3e201980309b56f5eb6b0f71035a2 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Wed, 16 Apr 2025 20:50:54 +0530 Subject: [PATCH 4/8] chore: update examples --- 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: 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ssbmv/README.md | 20 +++++++++---------- .../@stdlib/blas/base/ssbmv/docs/repl.txt | 20 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/README.md b/lib/node_modules/@stdlib/blas/base/ssbmv/README.md index cd9624a40fcf..6e7c734de94c 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/README.md @@ -37,12 +37,12 @@ Performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and ```javascript var Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +var A = new Float32Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); ssbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); -// y => [ 2.0, 17.0, 21.0 ] +// y => [ 10.0, 25.0, 10.0 ] ``` The function has the following parameters: @@ -65,12 +65,12 @@ The stride parameters determine how elements in the input arrays are accessed at ```javascript var Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +var A = new Float32Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); ssbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, -1 ); -// y => [ 21.0, 17.0, 2.0 ] +// y => [ 10.0, 25.0, 10.0 ] ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. @@ -83,14 +83,14 @@ var Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... var x0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); -var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +var A = new Float32Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); // Create offset views... var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element ssbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x1, 1, 0.0, y1, 1 ); -// y0 => [ 0.0, 2.0, 17.0, 21.0 ] +// y0 => [ 0.0, 10.0, 25.0, 10.0 ] ``` #### ssbmv.ndarray( uplo, N, K, α, A, sa1, sa2, oa, x, sx, ox, β, y, sy, oy ) @@ -100,12 +100,12 @@ Performs the matrix-vector operation `y = alpha*A*x + beta*y` using alternative ```javascript var Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +var A = new Float32Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); ssbmv.ndarray( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); -// y => [ 2.0, 17.0, 21.0 ] +// y => [ 10.0, 25.0, 10.0 ] ``` The function has the following additional parameters: @@ -121,12 +121,12 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript var Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +var A = new Float32Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); var x = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); ssbmv.ndarray( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 1, 0.0, y, 1, 1 ); -// y => [ 0.0, 2.0, 17.0, 21.0 ] +// y => [ 0.0, 10.0, 25.0, 10.0 ] ``` diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/ssbmv/docs/repl.txt index 66085de53068..08196dee6230 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/docs/repl.txt @@ -61,26 +61,26 @@ // Standard usage: > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 3.0 ] ); > var y = new {{alias:@stdlib/array/float32}}( [ 0.0, 0.0, 0.0 ] ); - > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); > {{alias}}( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ) - [ 2.0, 17.0, 21.0 ] + [ 10.0, 25.0, 10.0 ] // Advanced indexing: > x = new {{alias:@stdlib/array/float32}}( [ 3.0, 2.0, 1.0 ] ); > y = new {{alias:@stdlib/array/float32}}( [ 0.0, 0.0, 0.0 ] ); - > A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + > A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); > {{alias}}( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, -1, 0.0, y, -1 ) - [ 21.0, 17.0, 2.0 ] + [ 10.0, 25.0, 10.0 ] // Using typed array views: > var x0 = new {{alias:@stdlib/array/float32}}( [ 0.0, 1.0, 2.0, 3.0 ] ); > var y0 = new {{alias:@stdlib/array/float32}}( [ 0.0, 0.0, 0.0, 0.0 ] ); - > A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + > A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); > var x1 = new {{alias:@stdlib/array/float32}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); > var y1 = new {{alias:@stdlib/array/float32}}( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); > {{alias}}( 'row-major', 'lower', 3, 1, 1.0, A, 2, x1, 1, 0.0, y1, 1 ); > y0 - [ 0.0, 2.0, 17.0, 21.0 ] + [ 0.0, 10.0, 25.0, 10.0 ] {{alias}}.ndarray( uplo, N, K, α, A, sa1, sa2, oa, x, sx, ox, β, y, sy, oy ) @@ -151,18 +151,18 @@ // Standard usage: > var x = new {{alias:@stdlib/array/float32}}( [ 0.0, 1.0, 2.0, 3.0 ] ); > var y = new {{alias:@stdlib/array/float32}}( [ 0.0, 0.0, 0.0, 0.0 ] ); - > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); > var uplo = 'lower'; > {{alias}}.ndarray( uplo, 3, 1, 1.0, A, 2, 1, 0, x, 1, 1, 0.0, y, 1, 1 ) - [ 0.0, 2.0, 17.0, 21.0 ] + [ 0.0, 10.0, 25.0, 10.0 ] // Advanced indexing: > var x = new {{alias:@stdlib/array/float32}}( [ 3.0, 2.0, 1.0 ] ); > var y = new {{alias:@stdlib/array/float32}}( [ 0.0, 0.0, 0.0 ] ); - > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); > var uplo = 'lower'; > {{alias}}.ndarray( uplo, 3, 1, 1.0, A, 2, 1, 0, x, -1, 2, 0.0, y, -1, 2 ) - [ 21.0, 17.0, 2.0 ] + [ 10.0, 25.0, 10.0 ] See Also -------- From 818eb48aba7d9754ea3c4fbaec659696ad689ab3 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Wed, 16 Apr 2025 20:52:54 +0530 Subject: [PATCH 5/8] chore: update jsdoc --- 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: na - task: lint_javascript_src status: passed - 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 --- --- .../blas/base/ssbmv/docs/types/index.d.ts | 16 ++++++++-------- .../@stdlib/blas/base/ssbmv/lib/base.js | 4 ++-- .../@stdlib/blas/base/ssbmv/lib/index.js | 8 ++++---- .../@stdlib/blas/base/ssbmv/lib/ndarray.js | 4 ++-- .../@stdlib/blas/base/ssbmv/lib/ssbmv.js | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/ssbmv/docs/types/index.d.ts index 172b97242b99..7fe7d039c30d 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/docs/types/index.d.ts @@ -46,12 +46,12 @@ interface Routine { * @example * var Float32Array = require( '@stdlib/array/float32' ); * - * var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + * var A = new Float32Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); * * ssbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); - * // y => [ 2.0, 17.0, 21.0 ] + * // y => [ 10.0, 25.0, 10.0 ] */ ( order: Layout, uplo: MatrixTriangle, N: number, K: number, alpha: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number, beta: number, y: Float32Array, strideY: number ): Float32Array; @@ -78,12 +78,12 @@ interface Routine { * @example * var Float32Array = require( '@stdlib/array/float32' ); * - * var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); + * var A = new Float32Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); * * ssbmv( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); - * // y => [ 2.0, 17.0, 21.0 ] + * // y => [ 10.0, 25.0, 10.0 ] */ ndarray( uplo: MatrixTriangle, N: number, K: 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; } @@ -108,22 +108,22 @@ interface Routine { * @example * var Float32Array = require( '@stdlib/array/float32' ); * -* var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +* var A = new Float32Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); * * ssbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); -* // y => [ 2.0, 17.0, 21.0 ] +* // y => [ 10.0, 25.0, 10.0 ] * * @example * var Float32Array = require( '@stdlib/array/float32' ); * -* var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +* var A = new Float32Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); * * ssbmv( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); -* // y => [ 2.0, 17.0, 21.0 ] +* // y => [ 10.0, 25.0, 10.0 ] */ declare var ssbmv: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/base.js index 61846548d935..4ad497099412 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/base.js @@ -52,12 +52,12 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' ); * @example * var Float32Array = require( '@stdlib/array/float32' ); * -* var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +* var A = new Float32Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); * * ssbmv( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); -* // y => [ 2.0, 17.0, 21.0 ] +* // y => [ 10.0, 25.0, 10.0 ] */ function ssbmv( uplo, N, K, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len var temp1; diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/index.js index 79ae8ffcc3ad..40f2fd7b46bb 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/index.js @@ -27,23 +27,23 @@ * var Float32Array = require( '@stdlib/array/float32' ); * var ssbmv = require( '@stdlib/blas/base/ssbmv' ); * -* var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +* var A = new Float32Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); * * ssbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); -* // y => [ 2.0, 17.0, 21.0 ] +* // y => [ 10.0, 25.0, 10.0 ] * * @example * var Float32Array = require( '@stdlib/array/float32' ); * var ssbmv = require( '@stdlib/blas/base/ssbmv' ); * -* var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +* var A = new Float32Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); * * ssbmv.ndarray( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); -* // y => [ 2.0, 17.0, 21.0 ] +* // y => [ 10.0, 25.0, 10.0 ] */ // MODULES // diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/ndarray.js index be4687ab620a..a30cba2cd0be 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/ndarray.js @@ -55,12 +55,12 @@ var base = require( './base.js' ); * @example * var Float32Array = require( '@stdlib/array/float32' ); * -* var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +* var A = new Float32Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); * * ssbmv( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); -* // y => [ 2.0, 17.0, 21.0 ] +* // y => [ 10.0, 25.0, 10.0 ] */ function ssbmv( uplo, N, K, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len if ( !isMatrixTriangle( uplo ) ) { diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/lib/ssbmv.js b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/ssbmv.js index 7b2e612921c2..1aad2354ab42 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/lib/ssbmv.js +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/lib/ssbmv.js @@ -57,12 +57,12 @@ var base = require( './base.js' ); * @example * var Float32Array = require( '@stdlib/array/float32' ); * -* var A = new Float32Array( [ 1.0, 2.0, 0.0, 4.0, 3.0, 5.0 ] ); +* var A = new Float32Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); * * ssbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); -* // y => [ 2.0, 17.0, 21.0 ] +* // y => [ 10.0, 25.0, 10.0 ] */ function ssbmv( order, uplo, N, K, alpha, A, LDA, x, strideX, beta, y, strideY ) { // eslint-disable-line max-params, max-len var offsetX; From 38630121df2f6ec1ea3e6413047e6facc707220e Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Wed, 16 Apr 2025 20:59:26 +0530 Subject: [PATCH 6/8] chore: update fixtures --- 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: 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ssbmv/test/fixtures/column_major_l.json | 4 ++-- .../@stdlib/blas/base/ssbmv/test/fixtures/column_major_u.json | 4 ++-- .../blas/base/ssbmv/test/fixtures/column_major_xnyn.json | 4 ++-- .../blas/base/ssbmv/test/fixtures/column_major_xnyp.json | 4 ++-- .../blas/base/ssbmv/test/fixtures/column_major_xpyn.json | 4 ++-- .../blas/base/ssbmv/test/fixtures/column_major_xpyp.json | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_l.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_l.json index 290c784d625f..241b0bc121ff 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_l.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_l.json @@ -10,7 +10,7 @@ "strideY": 1, "offsetY": 0, "LDA": 2, - "A": [ 0.0, 1.0, 2.0, 4.0, 5.0, 6.0 ], + "A": [ 4.0, 1.0, 5.0, 2.0, 6.0, 0.0 ], "A_mat": [ [ 4.0, 0.0, 0.0 ], [ 1.0, 5.0, 0.0 ], @@ -21,5 +21,5 @@ "strideA1": 1, "strideA2": 2, "offsetA": 0, - "y_out": [ 2.0, 8.0, 10.0 ] + "y_out": [ 6.0, 9.0, 9.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_u.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_u.json index d85797a1a6da..7d5b2d7bc4f8 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_u.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_u.json @@ -10,7 +10,7 @@ "strideY": 1, "offsetY": 0, "LDA": 2, - "A": [ 4.0, 5.0, 6.0, 0.0, 1.0, 2.0 ], + "A": [ 0.0, 4.0, 1.0, 5.0, 2.0, 6.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -21,5 +21,5 @@ "strideA1": 1, "strideA2": 2, "offsetA": 0, - "y_out": [ 12.0, 8.0, 4.0 ] + "y_out": [ 6.0, 9.0, 9.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyn.json index 271eced3c9e4..a7587c40042e 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyn.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyn.json @@ -10,7 +10,7 @@ "strideY": -1, "offsetY": 2, "LDA": 2, - "A": [ 4.0, 5.0, 6.0, 0.0, 1.0, 2.0 ], + "A": [ 0.0, 4.0, 1.0, 5.0, 2.0, 6.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -21,5 +21,5 @@ "strideA1": 1, "strideA2": 2, "offsetA": 0, - "y_out": [ 4.0, 8.0, 12.0 ] + "y_out": [ 9.0, 9.0, 6.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyp.json index 781e253e7823..9c807ae01541 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyp.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xnyp.json @@ -10,7 +10,7 @@ "strideY": 1, "offsetY": 0, "LDA": 2, - "A": [ 4.0, 5.0, 6.0, 0.0, 1.0, 2.0 ], + "A": [ 0.0, 4.0, 1.0, 5.0, 2.0, 6.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -21,5 +21,5 @@ "strideA1": 1, "strideA2": 2, "offsetA": 0, - "y_out": [ 12.0, 8.0, 4.0 ] + "y_out": [ 6.0, 9.0, 9.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyn.json index d610e50cb055..b96212e621be 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyn.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyn.json @@ -10,7 +10,7 @@ "strideY": -1, "offsetY": 2, "LDA": 2, - "A": [ 4.0, 5.0, 6.0, 0.0, 1.0, 2.0 ], + "A": [ 0.0, 4.0, 1.0, 5.0, 2.0, 6.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -21,5 +21,5 @@ "strideA1": 1, "strideA2": 2, "offsetA": 0, - "y_out": [ 4.0, 8.0, 12.0 ] + "y_out": [ 9.0, 9.0, 6.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyp.json index d85797a1a6da..7d5b2d7bc4f8 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyp.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_xpyp.json @@ -10,7 +10,7 @@ "strideY": 1, "offsetY": 0, "LDA": 2, - "A": [ 4.0, 5.0, 6.0, 0.0, 1.0, 2.0 ], + "A": [ 0.0, 4.0, 1.0, 5.0, 2.0, 6.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -21,5 +21,5 @@ "strideA1": 1, "strideA2": 2, "offsetA": 0, - "y_out": [ 12.0, 8.0, 4.0 ] + "y_out": [ 6.0, 9.0, 9.0 ] } From b210733f1ceb2d6c4224fc84fc6d432759512a47 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Thu, 24 Apr 2025 13:28:39 +0530 Subject: [PATCH 7/8] chore: fix test fixtures --- 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: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../column_major_complex_access_pattern.json | 14 ++++++------- .../test/fixtures/column_major_sa1_sa2.json | 10 +++++----- .../test/fixtures/column_major_sa1_sa2n.json | 10 +++++----- .../test/fixtures/column_major_sa1n_sa2.json | 11 +++++----- .../test/fixtures/column_major_sa1n_sa2n.json | 10 +++++----- .../row_major_complex_access_pattern.json | 20 +++++++++---------- .../test/fixtures/row_major_sa1_sa2.json | 10 +++++----- .../test/fixtures/row_major_sa1_sa2n.json | 10 +++++----- .../test/fixtures/row_major_sa1n_sa2.json | 12 +++++------ .../test/fixtures/row_major_sa1n_sa2n.json | 10 +++++----- .../blas/base/ssbmv/test/test.ndarray.js | 16 +++++++-------- 11 files changed, 67 insertions(+), 66 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_complex_access_pattern.json index 17ef1b0c01ae..139a9f2d61bd 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_complex_access_pattern.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_complex_access_pattern.json @@ -4,13 +4,13 @@ "N": 3, "K": 1, "alpha": 1.0, - "beta": 2.0, + "beta": 1.0, "strideX": -2, "offsetX": 4, "strideY": -3, "offsetY": 6, - "LDA": 2, - "A": [ 0.0, 0.0, 2.0, 4.0, 0.0, 0.0, 1.0, 0.0, 2.0, 5.0, 0.0, 6.0 ], + "LDA": 4, + "A": [ 999.0, 999.0, 0.0, 999.0, 4.0, 999.0, 1.0, 999.0, 5.0, 999.0, 2.0, 999.0, 6.0, 999.0 ], "A_mat": [ [ 4.0, 0.0, 0.0 ], [ 1.0, 5.0, 0.0 ], @@ -18,8 +18,8 @@ ], "x": [ 1.0, 0.0, 1.0, 0.0, 1.0 ], "y": [ 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0 ], - "strideA1": 3, - "strideA2": 2, - "offsetA": 3, - "y_out": [ 9.0, 0.0, 0.0, 5.0, 0.0, 0.0, 6.0 ] + "strideA1": 2, + "strideA2": 4, + "offsetA": 2, + "y_out": [ 9.0, 0.0, 0.0, 9.0, 0.0, 0.0, 6.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2.json index ad0fe6859c11..a26baef6523e 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2.json @@ -9,8 +9,8 @@ "offsetX": 0, "strideY": 1, "offsetY": 0, - "LDA": 2, - "A": [ 0.0, 4.0, 0.0, 0.0, 1.0, 5.0, 0.0, 0.0, 0.0, 2.0, 0.0, 6.0, 0.0 ], + "LDA": 4, + "A": [ 0.0, 999.0, 4.0, 999.0, 1.0, 999.0, 5.0, 999.0, 2.0, 999.0, 6.0, 999.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -18,8 +18,8 @@ ], "x": [ 1.0, 1.0, 1.0 ], "y": [ 1.0, 1.0, 1.0 ], - "strideA1": 3, - "strideA2": 2, + "strideA1": 2, + "strideA2": 4, "offsetA": 0, - "y_out": [ 1.0, 6.0, 6.0 ] + "y_out": [ 6.0, 9.0, 9.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2n.json index f60e55374156..3f59a4579e09 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1_sa2n.json @@ -9,8 +9,8 @@ "offsetX": 0, "strideY": 1, "offsetY": 0, - "LDA": 2, - "A": [ 0.0, 4.0, 0.0, 0.0, 1.0, 5.0, 0.0, 0.0, 0.0, 2.0, 0.0, 6.0, 0.0 ], + "LDA": 3, + "A": [ 0.0, 999.0, 2.0, 999.0, 6.0, 1.0, 999.0, 5.0, 999.0, 999.0, 4.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -18,8 +18,8 @@ ], "x": [ 1.0, 1.0, 1.0 ], "y": [ 1.0, 1.0, 1.0 ], - "strideA1": -3, - "strideA2": 2, + "strideA1": 2, + "strideA2": -3, "offsetA": 8, - "y_out": [ 1.0, 6.0, 1.0 ] + "y_out": [ 6.0, 9.0, 9.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2.json index f60e55374156..d4ad4c29fc2c 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2.json @@ -1,3 +1,4 @@ + { "uplo": "upper", "order": "column-major", @@ -9,8 +10,8 @@ "offsetX": 0, "strideY": 1, "offsetY": 0, - "LDA": 2, - "A": [ 0.0, 4.0, 0.0, 0.0, 1.0, 5.0, 0.0, 0.0, 0.0, 2.0, 0.0, 6.0, 0.0 ], + "LDA": 4, + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 4.0, 999.0, 0.0, 999.0, 5.0, 999.0, 1.0, 999.0, 6.0, 999.0, 2.0, 999.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -18,8 +19,8 @@ ], "x": [ 1.0, 1.0, 1.0 ], "y": [ 1.0, 1.0, 1.0 ], - "strideA1": -3, - "strideA2": 2, + "strideA1": -2, + "strideA2": 4, "offsetA": 8, - "y_out": [ 1.0, 6.0, 1.0 ] + "y_out": [ 6.0, 9.0, 9.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2n.json index d6c95104fece..c319f4d2a853 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_sa1n_sa2n.json @@ -9,8 +9,8 @@ "offsetX": 0, "strideY": 1, "offsetY": 0, - "LDA": 2, - "A": [ 0.0, 4.0, 0.0, 0.0, 1.0, 5.0, 0.0, 0.0, 0.0, 2.0, 0.0, 6.0, 0.0 ], + "LDA": 3, + "A": [ 6.0, 0.0, 2.0, 5.0, 999.0, 1.0, 4.0 ], "A_mat": [ [ 4.0, 1.0, 0.0 ], [ 0.0, 5.0, 2.0 ], @@ -18,8 +18,8 @@ ], "x": [ 1.0, 1.0, 1.0 ], "y": [ 1.0, 1.0, 1.0 ], - "strideA1": -3, - "strideA2": -2, + "strideA1": -2, + "strideA2": -3, "offsetA": 8, - "y_out": [ 1.0, 6.0, 1.0 ] + "y_out": [ 6.0, 9.0, 9.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_complex_access_pattern.json index c6d14fe29af2..a7e6be7b8762 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_complex_access_pattern.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_complex_access_pattern.json @@ -4,22 +4,22 @@ "N": 3, "K": 1, "alpha": 1.0, - "beta": 2.0, + "beta": 1.0, "strideX": -2, "offsetX": 4, "strideY": -3, "offsetY": 6, - "LDA": 2, - "A": [ 0.0, 0.0, 2.0, 4.0, 0.0, 0.0, 1.0, 0.0, 2.0, 5.0, 0.0, 6.0 ], + "LDA": 4, + "A": [ 999.0, 999.0, 0.0, 999.0, 2.0, 999.0, 5.0, 999.0, 1.0, 999.0, 4.0, 999.0, 6.0, 999.0 ], "A_mat": [ - [ 4.0, 0.0, 0.0 ], - [ 1.0, 5.0, 0.0 ], - [ 0.0, 2.0, 6.0 ] + [ 1.0, 2.0, 0.0 ], + [ 0.0, 4.0, 5.0 ], + [ 0.0, 0.0, 6.0 ] ], "x": [ 1.0, 0.0, 1.0, 0.0, 1.0 ], "y": [ 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0 ], - "strideA1": 2, - "strideA2": 3, - "offsetA": 3, - "y_out": [ 13.0, 0.0, 0.0, 10.0, 0.0, 0.0, 3.0 ] + "strideA1": 4, + "strideA2": 2, + "offsetA": 2, + "y_out": [ 6.0, 0.0, 0.0, 9.0, 0.0, 0.0, 3.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2.json index 5270bedf2bf0..48c924404a33 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2.json @@ -9,8 +9,8 @@ "offsetX": 0, "strideY": 1, "offsetY": 0, - "LDA": 2, - "A": [ 0.0, 1.0, 4.0, 0.0, 0.0, 2.0, 5.0, 0.0, 0.0, 6.0, 0.0 ], + "LDA": 4, + "A": [ 0.0, 999.0, 2.0, 999.0, 5.0, 999.0, 1.0, 999.0, 4.0, 999.0, 6.0, 999.0 ], "A_mat": [ [ 1.0, 2.0, 0.0 ], [ 0.0, 4.0, 5.0 ], @@ -18,8 +18,8 @@ ], "x": [ 1.0, 1.0, 1.0 ], "y": [ 1.0, 1.0, 1.0 ], - "strideA1": 2, - "strideA2": 3, + "strideA1": 4, + "strideA2": 2, "offsetA": 0, - "y_out": [ 5.0, 8.0, 6.0 ] + "y_out": [ 3.0, 9.0, 6.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2n.json index 8e9303457c81..3c79fe84a270 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1_sa2n.json @@ -9,8 +9,8 @@ "offsetX": 0, "strideY": 1, "offsetY": 0, - "LDA": 2, - "A": [ 0.0, 0.0, 1.0, 4.0, 0.0, 0.0, 2.0, 5.0, 0.0, 0.0, 6.0, 0.0 ], + "LDA": 3, + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 999.0, 0.0, 1.0, 999.0, 5.0, 6.0, 999.0, 4.0 ], "A_mat": [ [ 1.0, 2.0, 0.0 ], [ 0.0, 4.0, 5.0 ], @@ -18,8 +18,8 @@ ], "x": [ 1.0, 1.0, 1.0 ], "y": [ 1.0, 1.0, 1.0 ], - "strideA1": 2, - "strideA2": -3, + "strideA1": 3, + "strideA2": -2, "offsetA": 8, - "y_out": [ 7.0, 7.0, 2.0 ] + "y_out": [ 3.0, 9.0, 6.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2.json index fc6669d89f17..3a5ae3e765a9 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2.json @@ -9,8 +9,8 @@ "offsetX": 0, "strideY": 1, "offsetY": 0, - "LDA": 2, - "A": [ 0.0, 0.0, 1.0, 4.0, 0.0, 0.0, 2.0, 5.0, 0.0, 0.0, 6.0, 0.0 ], + "LDA": 3, + "A": [ 999.0, 4.0, 6.0, 999.0, 5.0, 999.0, 1.0, 0.0, 999.0, 2.0 ], "A_mat": [ [ 1.0, 2.0, 0.0 ], [ 0.0, 4.0, 5.0 ], @@ -18,8 +18,8 @@ ], "x": [ 1.0, 1.0, 1.0 ], "y": [ 1.0, 1.0, 1.0 ], - "strideA1": -2, - "strideA2": 3, - "offsetA": 2, - "y_out": [ 1.0, 5.0, 3.0 ] + "strideA1": -3, + "strideA2": 2, + "offsetA": 7, + "y_out": [ 3.0, 9.0, 6.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2n.json index 847c3e0ad274..53a8e12c8d34 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/row_major_sa1n_sa2n.json @@ -9,8 +9,8 @@ "offsetX": 0, "strideY": 1, "offsetY": 0, - "LDA": 2, - "A": [ 0.0, 0.0, 1.0, 4.0, 0.0, 0.0, 2.0, 5.0, 0.0, 0.0, 6.0, 0.0 ], + "LDA": 3, + "A": [ 6.0, 999.0, 4.0, 1.0, 999.0, 5.0, 2.0, 999.0, 0.0 ], "A_mat": [ [ 1.0, 2.0, 0.0 ], [ 0.0, 4.0, 5.0 ], @@ -18,8 +18,8 @@ ], "x": [ 1.0, 1.0, 1.0 ], "y": [ 1.0, 1.0, 1.0 ], - "strideA1": -2, - "strideA2": -3, + "strideA1": -3, + "strideA2": -2, "offsetA": 8, - "y_out": [ 3.0, 6.0, 2.0 ] + "y_out": [ 3.0, 9.0, 6.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/ssbmv/test/test.ndarray.js index af83e6ff2990..01a7024f6142 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/test.ndarray.js @@ -480,7 +480,7 @@ tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sa1=2, sa2=3)', function test( t ) { +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sa1=4, sa2=2)', function test( t ) { var expected; var out; var a; @@ -500,7 +500,7 @@ tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sa1=3, sa2=2)', function test( t ) { +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sa1=2, sa2=4)', function test( t ) { var expected; var out; var a; @@ -520,7 +520,7 @@ tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sa1=-2, sa2=3)', function test( t ) { +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sa1=-3, sa2=2)', function test( t ) { var expected; var out; var a; @@ -540,7 +540,7 @@ tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sa1=-3, sa2=2)', function test( t ) { +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sa1=-2, sa2=4)', function test( t ) { var expected; var out; var a; @@ -560,7 +560,7 @@ tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sa1=2, sa2=-3)', function test( t ) { +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sa1=3, sa2=-2)', function test( t ) { var expected; var out; var a; @@ -580,7 +580,7 @@ tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sa1=3, sa2=-2)', function test( t ) { +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sa1=2, sa2=-3)', function test( t ) { var expected; var out; var a; @@ -600,7 +600,7 @@ tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sa1=-2, sa2=-3)', function test( t ) { +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (row-major, sa1=-3, sa2=-2)', function test( t ) { var expected; var out; var a; @@ -620,7 +620,7 @@ tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sa1=-3, sa2=-2)', function test( t ) { +tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` banded symmetric matrix (column-major, sa1=-2, sa2=-3)', function test( t ) { var expected; var out; var a; From f15ddbbf46b13fdef31fff40e856df85d14cc8aa Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Tue, 29 Apr 2025 19:45:47 +0530 Subject: [PATCH 8/8] test: update test cases --- 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: 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../test/fixtures/column_major_complex_access_pattern.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_complex_access_pattern.json index 139a9f2d61bd..7dc461c1a5a5 100644 --- a/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_complex_access_pattern.json +++ b/lib/node_modules/@stdlib/blas/base/ssbmv/test/fixtures/column_major_complex_access_pattern.json @@ -12,9 +12,9 @@ "LDA": 4, "A": [ 999.0, 999.0, 0.0, 999.0, 4.0, 999.0, 1.0, 999.0, 5.0, 999.0, 2.0, 999.0, 6.0, 999.0 ], "A_mat": [ - [ 4.0, 0.0, 0.0 ], - [ 1.0, 5.0, 0.0 ], - [ 0.0, 2.0, 6.0 ] + [ 4.0, 1.0, 0.0 ], + [ 0.0, 5.0, 2.0 ], + [ 0.0, 0.0, 6.0 ] ], "x": [ 1.0, 0.0, 1.0, 0.0, 1.0 ], "y": [ 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0 ],