diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/README.md b/lib/node_modules/@stdlib/blas/base/dsbmv/README.md new file mode 100644 index 000000000000..d8f5bde28c77 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/README.md @@ -0,0 +1,266 @@ + + +# dsbmv + +> 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 dsbmv = require( '@stdlib/blas/base/dsbmv' ); +``` + +#### dsbmv( 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 Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); +var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); + +dsbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); +// y => [ 10.0, 25.0, 10.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 [`Float64Array`][mdn-float64array]. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +- **x**: input [`Float64Array`][mdn-float64array]. +- **sx**: index increment for `x`. +- **β**: scalar constant. +- **y**: output [`Float64Array`][mdn-float64array]. +- **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 Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); +var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); + +dsbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, -1 ); +// 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. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial arrays... +var x0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +var A = new Float64Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); + +// Create offset views... +var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +dsbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x1, 1, 0.0, y1, 1 ); +// y0 => [ 0.0, 10.0, 25.0, 10.0 ] +``` + +#### dsbmv.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 Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); +var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); + +dsbmv.ndarray( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); +// y => [ 10.0, 25.0, 10.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 Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); +var x = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + +dsbmv.ndarray( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 1, 0.0, y, 1, 1 ); +// y => [ 0.0, 10.0, 25.0, 10.0 ] +``` + +
+ + + +
+ +## Notes + +- `dsbmv()` corresponds to the [BLAS][blas] level 2 function [`dsbmv`][dsbmv]. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var dsbmv = require( '@stdlib/blas/base/dsbmv' ); + +var opts = { + 'dtype': 'float64' +}; + +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 ); + +dsbmv.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/dsbmv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dsbmv/benchmark/benchmark.js new file mode 100644 index 000000000000..16f309ff62c3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var pkg = require( './../package.json' ).name; +var dsbmv = require( './../lib/dsbmv.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// 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 = dsbmv( 'row-major', 'upper', len, 1.0, 1, A, 2, x, 1, 1.0, y, 1 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( 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/dsbmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsbmv/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..45a370514c54 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var pkg = require( './../package.json' ).name; +var dsbmv = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// 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 = dsbmv( 'upper', len, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( 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/dsbmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dsbmv/docs/repl.txt new file mode 100644 index 000000000000..ca2a3bbd020e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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: Float64Array + Matrix in packed form. + + LDA: integer + Leading dimension of the matrix `A`. + + x: Float64Array + Input vector `x`. + + sx: integer + Index increment for `x`. + + β: number + Scalar constant. + + y: Float64Array + Input/output vector `y`. + + sy: integer + Index increment for `y`. + + Returns + ------- + y: Float64Array + Output array. + + Examples + -------- + // Standard usage: + > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 3.0 ] ); + > var y = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0 ] ); + > var A = new {{alias:@stdlib/array/float64}}( [ 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 ) + [ 10.0, 25.0, 10.0 ] + + // Advanced indexing: + > x = new {{alias:@stdlib/array/float64}}( [ 3.0, 2.0, 1.0 ] ); + > y = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0 ] ); + > A = new {{alias:@stdlib/array/float64}}( [ 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 ) + [ 10.0, 25.0, 10.0 ] + + // Using typed array views: + > var x0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 2.0, 3.0 ] ); + > var y0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); + > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > var y1 = new {{alias:@stdlib/array/float64}}( 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, 10.0, 25.0, 10.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: Float64Array + 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: Float64Array + Input vector `x`. + + sx: integer + Index increment for `x`. + + ox: integer + Starting index for `x`. + + β: number + Scalar. + + y: Float64Array + Input/output vector `y`. + + sy: integer + Index increment for `y`. + + oy: integer + Starting index for `y`. + + Returns + ------- + y: Float64Array + Output array. + + Examples + -------- + // Standard usage: + > var x = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 2.0, 3.0 ] ); + > var y = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); + > var A = new {{alias:@stdlib/array/float64}}( [ 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, 10.0, 25.0, 10.0 ] + + // Advanced indexing: + > var x = new {{alias:@stdlib/array/float64}}( [ 3.0, 2.0, 1.0 ] ); + > var y = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0 ] ); + > var A = new {{alias:@stdlib/array/float64}}( [ 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 ) + [ 10.0, 25.0, 10.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dsbmv/docs/types/index.d.ts new file mode 100644 index 000000000000..d7de3287b148 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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 `dsbmv`. +*/ +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 Float64Array = require( '@stdlib/array/float64' ); + * + * var A = new Float64Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); + * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + * var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); + * + * dsbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); + * // y => [ 10.0, 25.0, 10.0 ] + */ + ( order: Layout, uplo: MatrixTriangle, N: number, K: number, alpha: number, A: Float64Array, LDA: number, x: Float64Array, strideX: number, beta: number, y: Float64Array, strideY: number ): Float64Array; + + /** + * 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 Float64Array = require( '@stdlib/array/float64' ); + * + * var A = new Float64Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); + * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + * var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); + * + * dsbmv( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); + * // y => [ 10.0, 25.0, 10.0 ] + */ + ndarray( uplo: MatrixTriangle, N: number, K: number, alpha: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number, x: Float64Array, strideX: number, offsetX: number, beta: number, y: Float64Array, strideY: number, offsetY: number ): Float64Array; +} + +/** +* 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 Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); +* +* dsbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); +* // y => [ 10.0, 25.0, 10.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); +* +* dsbmv( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); +* // y => [ 10.0, 25.0, 10.0 ] +*/ +declare var dsbmv: Routine; + + +// EXPORTS // + +export = dsbmv; diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dsbmv/docs/types/test.ts new file mode 100644 index 000000000000..98198a668f2e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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 dsbmv = require( './index' ); + + +// TESTS // + +// The function returns a Float64Array... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv( 10, 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( true, 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( false, 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( null, 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( void 0, 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( [], 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( {}, 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( ( 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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv( 'row-major', 10, 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', true, 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', false, 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', null, 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', void 0, 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', [ '1' ], 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', {}, 10, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( '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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv( 'row-major', 'upper', '10', 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', true, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', false, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', null, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', void 0, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', [], 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', {}, 1, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( '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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv( 'row-major', 'upper', 10, '10', 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, true, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, false, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, null, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, void 0, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, [], 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, {}, 1.0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( '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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv( 'row-major', 'upper', 10, 1, '10', A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, true, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, false, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, null, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, void 0, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, [], A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, {}, A, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( '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 Float64Array... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + dsbmv( 'row-major', 'upper', 10, 1, 1.0, 10, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, '10', 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, true, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, false, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, null, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, void 0, 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, [ '1' ], 2, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, {}, x, 2, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( '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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, '10', x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, true, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, false, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, null, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, void 0, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, [ '1' ], x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, {}, x, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( '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 Float64Array... +{ + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, 10, 1, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, '10', 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, true, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, false, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, null, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, void 0, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, [ '1' ], 1, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, {}, 1, 1.0, y, 1 ); // $ExpectError + dsbmv( '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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, '10', 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, true, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, false, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, null, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, void 0, 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, [], 1.0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, {}, 1.0, y, 1 ); // $ExpectError + dsbmv( '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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, '10', y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, true, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, false, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, null, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, void 0, y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, [], y, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, {}, y, 1 ); // $ExpectError + dsbmv( '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 Float64Array... +{ + const x = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, 10, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, '10', 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, true, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, false, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, null, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, void 0, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, [ '1' ], 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, {}, 1 ); // $ExpectError + dsbmv( '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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, '10' ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, true ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, false ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, null ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, void 0 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, [] ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y, {} ); // $ExpectError + dsbmv( '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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv(); // $ExpectError + dsbmv( 'row-major' ); // $ExpectError + dsbmv( 'row-major', 'upper' ); // $ExpectError + dsbmv( 'row-major', 'upper', 10 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0 ); // $ExpectError + dsbmv( 'row-major', 'upper', 10, 1, 1.0, A, 2, x, 1, 1.0, y ); // $ExpectError + dsbmv( '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 Float64Array... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 10, 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( true, 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( false, 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( null, 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( void 0, 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( [ '1' ], 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( {}, 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 'upper', '10', 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', true, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', false, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', null, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', void 0, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', [], 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', {}, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 'upper', 10, '10', 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, true, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, false, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, null, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, void 0, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, [], 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, {}, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 'upper', 10, 1, '10', A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, true, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, false, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, null, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, void 0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, [], A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, {}, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.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 Float64Array... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + dsbmv.ndarray( 'upper', 10, 1, 1.0, 10, 1, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, '10', 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, true, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, false, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, null, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, void 0, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, [ '1' ], 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, {}, 1, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, '10', 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, true, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, false, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, null, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, void 0, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, [ '1' ], 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, {}, 2, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, '10', 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, true, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, false, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, null, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, void 0, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, [ '1' ], 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, {}, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, '10', x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, true, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, false, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, null, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, void 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, [ '1' ], x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, {}, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.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 Float64Array... +{ + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, 10, 1, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, '10', 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, true, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, false, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, null, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, void 0, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, [ '1' ], 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, {}, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, '10', 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, true, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, false, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, null, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, void 0, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, [], 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, {}, 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, '10', 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, true, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, false, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, null, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, void 0, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, [], 1.0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, {}, 1.0, y, 1, 0 ); // $ExpectError + dsbmv.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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, '10', y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, true, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, false, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, null, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, void 0, y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, [], y, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, {}, y, 1, 0 ); // $ExpectError + dsbmv.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 Float64Array... +{ + const x = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, 10, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, '10', 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, true, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, false, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, null, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, void 0, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, [ '1' ], 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, {}, 1, 0 ); // $ExpectError + dsbmv.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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, '10', 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, true, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, false, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, null, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, void 0, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, [], 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, {}, 0 ); // $ExpectError + dsbmv.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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, '10' ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, true ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, false ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, null ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, void 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, [] ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1, {} ); // $ExpectError + dsbmv.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 Float64Array( 10 ); + const y = new Float64Array( 10 ); + const A = new Float64Array( 55 ); + + dsbmv.ndarray(); // $ExpectError + dsbmv.ndarray( 'upper' ); // $ExpectError + dsbmv.ndarray( 'upper', 10 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0 ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y ); // $ExpectError + dsbmv.ndarray( 'upper', 10, 1, 1.0, A, 1, 2, 0, x, 1, 0, 1.0, y, 1 ); // $ExpectError + dsbmv.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/dsbmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/dsbmv/examples/index.js new file mode 100644 index 000000000000..ddb966dd5808 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/examples/index.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'; + +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var dsbmv = require( './../lib' ); + +var opts = { + 'dtype': 'float64' +}; + +var N = 3; +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 ); + +dsbmv.ndarray( 'upper', N, 1, 1.0, A, 2, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); +console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/dsbmv/lib/base.js new file mode 100644 index 000000000000..e4162a0c02af --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/lib/base.js @@ -0,0 +1,159 @@ +/** +* @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 dfill = require( '@stdlib/blas/ext/base/dfill' ).ndarray; +var dscal = require( '@stdlib/blas/base/dscal' ).ndarray; +var max = require( '@stdlib/math/base/special/max' ); + + +// 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 {Float64Array} 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 {Float64Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {number} beta - scalar constant +* @param {Float64Array} y - second input array +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting `y` index +* @returns {Float64Array} `y` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); +* +* dsbmv( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); +* // y => [ 10.0, 25.0, 10.0 ] +*/ +function dsbmv( 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 ) { + dfill( N, 0.0, y, strideY, offsetY ); + } else { + dscal( 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 = 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 ] += temp1 * A[ oa + (j * sa1) ]; + temp2 += x[ jx ] * A[ oa + (j * sa1) ]; + jx += strideX; + jy += strideY; + } + y[ iy ] += ( 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 = 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 ] += temp1 * A[ oa + (i * sa1) ]; + temp2 += x[ jx ] * A[ oa + (i * sa1) ]; + jx += strideX; + jy += strideY; + } + oa = offsetA + (K * sa0); + y[ iy ] += ( temp1 * A[ oa + (i * sa1) ] ) + ( alpha * temp2 ); + ix += strideX; + iy += strideY; + } + return y; + } +} + + +// EXPORTS // + +module.exports = dsbmv; diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/lib/dsbmv.js b/lib/node_modules/@stdlib/blas/base/dsbmv/lib/dsbmv.js new file mode 100644 index 000000000000..f4b6d7c6c16d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/lib/dsbmv.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 {Float64Array} A - matrix +* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Float64Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {number} beta - scalar constant +* @param {Float64Array} 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 {Float64Array} `y` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); +* +* dsbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); +* // y => [ 10.0, 25.0, 10.0 ] +*/ +function dsbmv( 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 = dsbmv; diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/dsbmv/lib/index.js new file mode 100644 index 000000000000..42c956160801 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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/dsbmv +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dsbmv = require( '@stdlib/blas/base/dsbmv' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); +* +* dsbmv( 'row-major', 'lower', 3, 1, 1.0, A, 2, x, 1, 0.0, y, 1 ); +* // y => [ 10.0, 25.0, 10.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dsbmv = require( '@stdlib/blas/base/dsbmv' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); +* +* dsbmv.ndarray( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); +* // y => [ 10.0, 25.0, 10.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 dsbmv; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dsbmv = main; +} else { + dsbmv = tmp; +} + + +// EXPORTS // + +module.exports = dsbmv; + +// exports: { "ndarray": "dsbmv.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/lib/main.js b/lib/node_modules/@stdlib/blas/base/dsbmv/lib/main.js new file mode 100644 index 000000000000..171d031a6995 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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 dsbmv = require( './dsbmv.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dsbmv, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dsbmv; diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dsbmv/lib/ndarray.js new file mode 100644 index 000000000000..1c056635785d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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 {Float64Array} 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 {Float64Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {number} beta - scalar constant +* @param {Float64Array} 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 {Float64Array} `y` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 4.0, 3.0, 5.0, 0.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); +* +* dsbmv( 'lower', 3, 1, 1.0, A, 2, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); +* // y => [ 10.0, 25.0, 10.0 ] +*/ +function dsbmv( 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 = dsbmv; diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/package.json b/lib/node_modules/@stdlib/blas/base/dsbmv/package.json new file mode 100644 index 000000000000..610e2b8d1bf0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/blas/base/dsbmv", + "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", + "dsbmv", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "float64", + "double", + "float64array" + ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 000000000000..17ef1b0c01ae --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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/dsbmv/test/fixtures/column_major_l.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_l.json new file mode 100644 index 000000000000..241b0bc121ff --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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, 5.0, 2.0, 6.0, 0.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, 9.0, 9.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_oa.json new file mode 100644 index 000000000000..4d1f893e93f1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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, 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 ], + [ 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": [ 6.0, 9.0, 9.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_sa1_sa2.json new file mode 100644 index 000000000000..ad0fe6859c11 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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/dsbmv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_sa1_sa2n.json new file mode 100644 index 000000000000..f60e55374156 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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/dsbmv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_sa1n_sa2.json new file mode 100644 index 000000000000..f60e55374156 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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/dsbmv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_sa1n_sa2n.json new file mode 100644 index 000000000000..d6c95104fece --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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/dsbmv/test/fixtures/column_major_u.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_u.json new file mode 100644 index 000000000000..7d5b2d7bc4f8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_u.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, 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": [ 6.0, 9.0, 9.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_xnyn.json new file mode 100644 index 000000000000..a7587c40042e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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": [ 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 ], + [ 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, 9.0, 6.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_xnyp.json new file mode 100644 index 000000000000..9c807ae01541 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_xnyp.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": 0, + "LDA": 2, + "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 ], + [ 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": [ 6.0, 9.0, 9.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_xpyn.json new file mode 100644 index 000000000000..b96212e621be --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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": [ 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 ], + [ 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, 9.0, 6.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/column_major_xpyp.json new file mode 100644 index 000000000000..7d5b2d7bc4f8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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": [ 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 ], + [ 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": [ 6.0, 9.0, 9.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 000000000000..c6d14fe29af2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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/dsbmv/test/fixtures/row_major_l.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_l.json new file mode 100644 index 000000000000..1920fefeefae --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_l.json @@ -0,0 +1,26 @@ + +{ + "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, 5.0, 6.0, 1.0, 2.0, 0.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": [ 12.0, 10.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_oa.json new file mode 100644 index 000000000000..f5d1fa454f72 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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, 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 ], + [ 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": [ 3.0, 9.0, 6.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_sa1_sa2.json new file mode 100644 index 000000000000..5270bedf2bf0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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/dsbmv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_sa1_sa2n.json new file mode 100644 index 000000000000..8e9303457c81 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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/dsbmv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_sa1n_sa2.json new file mode 100644 index 000000000000..fc6669d89f17 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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/dsbmv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_sa1n_sa2n.json new file mode 100644 index 000000000000..847c3e0ad274 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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/dsbmv/test/fixtures/row_major_u.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_u.json new file mode 100644 index 000000000000..56b10ad0eb34 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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": [ 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 ], + [ 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": [ 3.0, 9.0, 6.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_xnyn.json new file mode 100644 index 000000000000..de666189bc4e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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": [ 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 ], + [ 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": [ 6.0, 9.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_xnyp.json new file mode 100644 index 000000000000..595302e9a6c9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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": [ 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 ], + [ 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": [ 3.0, 9.0, 6.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_xpyn.json new file mode 100644 index 000000000000..6832804f92f4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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": [ 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 ], + [ 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": [ 6.0, 9.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/dsbmv/test/fixtures/row_major_xpyp.json new file mode 100644 index 000000000000..56b10ad0eb34 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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": [ 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 ], + [ 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": [ 3.0, 9.0, 6.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/test.dsbmv.js b/lib/node_modules/@stdlib/blas/base/dsbmv/test/test.dsbmv.js new file mode 100644 index 000000000000..7435ba2d478a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/test/test.dsbmv.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 Float64Array = require( '@stdlib/array/float64' ); +var dsbmv = require( './../lib/dsbmv.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 dsbmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 12', function test( t ) { + t.strictEqual( dsbmv.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() { + dsbmv( value, rl.uplo, rl.N, rl.K, rl.alpha, new Float64Array( rl.A ), rl.LDA, new Float64Array( rl.x ), rl.strideX, rl.beta, new Float64Array( 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() { + dsbmv( rl.order, value, rl.N, rl.K, rl.alpha, new Float64Array( rl.A ), rl.LDA, new Float64Array( rl.x ), rl.strideX, rl.beta, new Float64Array( 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() { + dsbmv( rl.order, rl.uplo, value, rl.K, rl.alpha, new Float64Array( rl.A ), rl.LDA, new Float64Array( rl.x ), rl.strideX, rl.beta, new Float64Array( 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() { + dsbmv( rl.order, rl.uplo, rl.N, value, rl.alpha, new Float64Array( rl.A ), 3, new Float64Array( rl.x ), rl.strideX, rl.beta, new Float64Array( 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() { + dsbmv( rl.order, rl.uplo, rl.N, rl.K, rl.alpha, new Float64Array( rl.A ), value, new Float64Array( rl.x ), rl.strideX, rl.beta, new Float64Array( 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() { + dsbmv( rl.order, rl.uplo, rl.N, rl.K, rl.alpha, new Float64Array( rl.A ), rl.LDA, new Float64Array( rl.x ), value, rl.beta, new Float64Array( 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() { + dsbmv( rl.order, rl.uplo, rl.N, rl.K, rl.alpha, new Float64Array( rl.A ), rl.LDA, new Float64Array( rl.x ), rl.strideX, rl.beta, new Float64Array( 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 Float64Array( rl.A ); + x = new Float64Array( rl.x ); + y = new Float64Array( rl.y ); + + expected = new Float64Array( rl.y_out ); + + out = dsbmv( 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 Float64Array( cl.A ); + x = new Float64Array( cl.x ); + y = new Float64Array( cl.y ); + + expected = new Float64Array( cl.y_out ); + + out = dsbmv( 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 Float64Array( ru.A ); + x = new Float64Array( ru.x ); + y = new Float64Array( ru.y ); + + expected = new Float64Array( ru.y_out ); + + out = dsbmv( 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 Float64Array( cu.A ); + x = new Float64Array( cu.x ); + y = new Float64Array( cu.y ); + + expected = new Float64Array( cu.y_out ); + + out = dsbmv( 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 Float64Array( rl.A ); + x = new Float64Array( rl.x ); + y = new Float64Array( rl.y ); + + out = dsbmv( 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 Float64Array( rl.A ); + x = new Float64Array( rl.x ); + y = new Float64Array( rl.y ); + + expected = new Float64Array( rl.y ); + + out = dsbmv( 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 = dsbmv( 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 Float64Array( cl.A ); + x = new Float64Array( cl.x ); + y = new Float64Array( cl.y ); + + expected = new Float64Array( cl.y ); + + out = dsbmv( 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 = dsbmv( 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 Float64Array( ru.A ); + x = new Float64Array( ru.x ); + y = new Float64Array( ru.y ); + + expected = new Float64Array( ru.y.length ); + + out = dsbmv( 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 Float64Array( rl.A ); + x = new Float64Array( rl.x ); + y = new Float64Array( rl.y ); + + expected = new Float64Array( rl.y.length ); + + out = dsbmv( 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 Float64Array( cu.A ); + x = new Float64Array( cu.x ); + y = new Float64Array( cu.y ); + + expected = new Float64Array( cu.y.length ); + + out = dsbmv( 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 Float64Array( cl.A ); + x = new Float64Array( cl.x ); + y = new Float64Array( cl.y ); + + expected = new Float64Array( cl.y.length ); + + out = dsbmv( 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 Float64Array( rxpyp.A ); + x = new Float64Array( rxpyp.x ); + y = new Float64Array( rxpyp.y ); + + expected = new Float64Array( rxpyp.y_out ); + + out = dsbmv( 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 Float64Array( cxpyp.A ); + x = new Float64Array( cxpyp.x ); + y = new Float64Array( cxpyp.y ); + + expected = new Float64Array( cxpyp.y_out ); + + out = dsbmv( 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 Float64Array( rxnyp.A ); + x = new Float64Array( rxnyp.x ); + y = new Float64Array( rxnyp.y ); + + expected = new Float64Array( rxnyp.y_out ); + + out = dsbmv( 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 Float64Array( cxnyp.A ); + x = new Float64Array( cxnyp.x ); + y = new Float64Array( cxnyp.y ); + + expected = new Float64Array( cxnyp.y_out ); + + out = dsbmv( 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 Float64Array( rxpyn.A ); + x = new Float64Array( rxpyn.x ); + y = new Float64Array( rxpyn.y ); + + expected = new Float64Array( rxpyn.y_out ); + + out = dsbmv( 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 Float64Array( cxpyn.A ); + x = new Float64Array( cxpyn.x ); + y = new Float64Array( cxpyn.y ); + + expected = new Float64Array( cxpyn.y_out ); + + out = dsbmv( 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 Float64Array( rxnyn.A ); + x = new Float64Array( rxnyn.x ); + y = new Float64Array( rxnyn.y ); + + expected = new Float64Array( rxnyn.y_out ); + + out = dsbmv( 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 Float64Array( cxnyn.A ); + x = new Float64Array( cxnyn.x ); + y = new Float64Array( cxnyn.y ); + + expected = new Float64Array( cxnyn.y_out ); + + out = dsbmv( 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(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/test.js b/lib/node_modules/@stdlib/blas/base/dsbmv/test/test.js new file mode 100644 index 000000000000..1b88e9373fc2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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 dsbmv = 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 dsbmv, '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 dsbmv.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 dsbmv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dsbmv, 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 dsbmv; + var main; + + main = require( './../lib/dsbmv.js' ); + + dsbmv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dsbmv, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/base/dsbmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsbmv/test/test.ndarray.js new file mode 100644 index 000000000000..b90539fcbb23 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsbmv/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 Float64Array = require( '@stdlib/array/float64' ); +var dsbmv = 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 dsbmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 15', function test( t ) { + t.strictEqual( dsbmv.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() { + dsbmv( value, rl.N, rl.K, rl.alpha, new Float64Array( rl.A ), rl.strideA1, rl.strideA2, rl.offsetA, new Float64Array( rl.x ), rl.strideX, rl.offsetX, rl.beta, new Float64Array( 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() { + dsbmv( rl.uplo, value, rl.K, rl.alpha, new Float64Array( rl.A ), rl.strideA1, rl.strideA2, rl.offsetA, new Float64Array( rl.x ), rl.strideX, rl.offsetX, rl.beta, new Float64Array( 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() { + dsbmv( rl.uplo, rl.N, value, rl.alpha, new Float64Array( rl.A ), rl.strideA1, rl.strideA2, rl.offsetA, new Float64Array( rl.x ), rl.strideX, rl.offsetX, rl.beta, new Float64Array( 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() { + dsbmv( rl.uplo, rl.N, rl.K, rl.alpha, new Float64Array( rl.A ), value, rl.strideA2, rl.offsetA, new Float64Array( rl.x ), rl.strideX, rl.offsetX, rl.beta, new Float64Array( 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() { + dsbmv( rl.uplo, rl.N, rl.K, rl.alpha, new Float64Array( rl.A ), rl.strideA1, value, rl.offsetA, new Float64Array( rl.x ), rl.strideX, rl.offsetX, rl.beta, new Float64Array( 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() { + dsbmv( rl.uplo, rl.N, rl.K, rl.alpha, new Float64Array( rl.A ), rl.strideA1, rl.strideA2, rl.offsetA, new Float64Array( rl.x ), value, rl.offsetX, rl.beta, new Float64Array( 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() { + dsbmv( rl.uplo, rl.N, rl.K, rl.alpha, new Float64Array( rl.A ), rl.strideA1, rl.strideA2, rl.offsetA, new Float64Array( rl.x ), rl.strideX, rl.offsetX, rl.beta, new Float64Array( 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 Float64Array( rl.A ); + x = new Float64Array( rl.x ); + y = new Float64Array( rl.y ); + + expected = new Float64Array( rl.y_out ); + + out = dsbmv( 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 Float64Array( cl.A ); + x = new Float64Array( cl.x ); + y = new Float64Array( cl.y ); + + expected = new Float64Array( cl.y_out ); + + out = dsbmv( 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 Float64Array( ru.A ); + x = new Float64Array( ru.x ); + y = new Float64Array( ru.y ); + + expected = new Float64Array( ru.y_out ); + + out = dsbmv( 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 Float64Array( cu.A ); + x = new Float64Array( cu.x ); + y = new Float64Array( cu.y ); + + expected = new Float64Array( cu.y_out ); + + out = dsbmv( 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 Float64Array( rl.A ); + x = new Float64Array( rl.x ); + y = new Float64Array( rl.y ); + + out = dsbmv( 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 Float64Array( rl.A ); + x = new Float64Array( rl.x ); + y = new Float64Array( rl.y ); + + expected = new Float64Array( rl.y ); + + out = dsbmv( 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 = dsbmv( 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 Float64Array( cl.A ); + x = new Float64Array( cl.x ); + y = new Float64Array( cl.y ); + + expected = new Float64Array( cl.y ); + + out = dsbmv( 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 = dsbmv( 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 Float64Array( ru.A ); + x = new Float64Array( ru.x ); + y = new Float64Array( ru.y ); + + expected = new Float64Array( ru.y.length ); + + out = dsbmv( 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 Float64Array( rl.A ); + x = new Float64Array( rl.x ); + y = new Float64Array( rl.y ); + + expected = new Float64Array( rl.y.length ); + + out = dsbmv( 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 Float64Array( cu.A ); + x = new Float64Array( cu.x ); + y = new Float64Array( cu.y ); + + expected = new Float64Array( cu.y.length ); + + out = dsbmv( 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 Float64Array( cl.A ); + x = new Float64Array( cl.x ); + y = new Float64Array( cl.y ); + + expected = new Float64Array( cl.y.length ); + + out = dsbmv( 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 Float64Array( roa.A ); + x = new Float64Array( roa.x ); + y = new Float64Array( roa.y ); + + expected = new Float64Array( roa.y_out ); + + out = dsbmv( 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 Float64Array( coa.A ); + x = new Float64Array( coa.x ); + y = new Float64Array( coa.y ); + + expected = new Float64Array( coa.y_out ); + + out = dsbmv( 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 Float64Array( rsa1sa2.A ); + x = new Float64Array( rsa1sa2.x ); + y = new Float64Array( rsa1sa2.y ); + + expected = new Float64Array( rsa1sa2.y_out ); + + out = dsbmv( 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 Float64Array( csa1sa2.A ); + x = new Float64Array( csa1sa2.x ); + y = new Float64Array( csa1sa2.y ); + + expected = new Float64Array( csa1sa2.y_out ); + + out = dsbmv( 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 Float64Array( rsa1nsa2.A ); + x = new Float64Array( rsa1nsa2.x ); + y = new Float64Array( rsa1nsa2.y ); + + expected = new Float64Array( rsa1nsa2.y_out ); + + out = dsbmv( 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 Float64Array( csa1nsa2.A ); + x = new Float64Array( csa1nsa2.x ); + y = new Float64Array( csa1nsa2.y ); + + expected = new Float64Array( csa1nsa2.y_out ); + + out = dsbmv( 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 Float64Array( rsa1sa2n.A ); + x = new Float64Array( rsa1sa2n.x ); + y = new Float64Array( rsa1sa2n.y ); + + expected = new Float64Array( rsa1sa2n.y_out ); + + out = dsbmv( 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 Float64Array( csa1sa2n.A ); + x = new Float64Array( csa1sa2n.x ); + y = new Float64Array( csa1sa2n.y ); + + expected = new Float64Array( csa1sa2n.y_out ); + + out = dsbmv( 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 Float64Array( rsa1nsa2n.A ); + x = new Float64Array( rsa1nsa2n.x ); + y = new Float64Array( rsa1nsa2n.y ); + + expected = new Float64Array( rsa1nsa2n.y_out ); + + out = dsbmv( 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 Float64Array( csa1nsa2n.A ); + x = new Float64Array( csa1nsa2n.x ); + y = new Float64Array( csa1nsa2n.y ); + + expected = new Float64Array( csa1nsa2n.y_out ); + + out = dsbmv( 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 Float64Array( rxpyp.A ); + x = new Float64Array( rxpyp.x ); + y = new Float64Array( rxpyp.y ); + + expected = new Float64Array( rxpyp.y_out ); + + out = dsbmv( 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 Float64Array( cxpyp.A ); + x = new Float64Array( cxpyp.x ); + y = new Float64Array( cxpyp.y ); + + expected = new Float64Array( cxpyp.y_out ); + + out = dsbmv( 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 Float64Array( rxpyn.A ); + x = new Float64Array( rxpyn.x ); + y = new Float64Array( rxpyn.y ); + + expected = new Float64Array( rxpyn.y_out ); + + out = dsbmv( 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 Float64Array( cxpyn.A ); + x = new Float64Array( cxpyn.x ); + y = new Float64Array( cxpyn.y ); + + expected = new Float64Array( cxpyn.y_out ); + + out = dsbmv( 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 Float64Array( rxnyp.A ); + x = new Float64Array( rxnyp.x ); + y = new Float64Array( rxnyp.y ); + + expected = new Float64Array( rxnyp.y_out ); + + out = dsbmv( 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 Float64Array( cxnyp.A ); + x = new Float64Array( cxnyp.x ); + y = new Float64Array( cxnyp.y ); + + expected = new Float64Array( cxnyp.y_out ); + + out = dsbmv( 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 Float64Array( rxnyn.A ); + x = new Float64Array( rxnyn.x ); + y = new Float64Array( rxnyn.y ); + + expected = new Float64Array( rxnyn.y_out ); + + out = dsbmv( 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 Float64Array( cxnyn.A ); + x = new Float64Array( cxnyn.x ); + y = new Float64Array( cxnyn.y ); + + expected = new Float64Array( cxnyn.y_out ); + + out = dsbmv( 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 Float64Array( rap.A ); + x = new Float64Array( rap.x ); + y = new Float64Array( rap.y ); + + expected = new Float64Array( rap.y_out ); + + out = dsbmv( 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 Float64Array( cap.A ); + x = new Float64Array( cap.x ); + y = new Float64Array( cap.y ); + + expected = new Float64Array( cap.y_out ); + + out = dsbmv( 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(); +});