diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/README.md b/lib/node_modules/@stdlib/blas/base/chbmv/README.md new file mode 100644 index 000000000000..2e5523435e59 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/README.md @@ -0,0 +1,298 @@ + + +# chbmv + +> Performs the matrix-vector operation `y = α*A*x + β*y` for complex-valued data. + +
+ +## Usage + +```javascript +var chbmv = require( '@stdlib/blas/base/chbmv' ); +``` + +#### chbmv( order, uplo, N, K, α, A, LDA, x, sx, β, y, sy ) + +Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are complex vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` sub-diagonals or super-diagonals. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); // eslint-disable-line max-params, max-len +var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +var alpha = new Complex64( 0.5, 0.5 ); +var beta = new Complex64( 0.5, -0.5 ); + +chbmv( 'row-major', 'lower', 3, 1, alpha, A, 2, x, 1, beta, y, 1 ); +// y => [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +``` + +The function has the following parameters: + +- **order**: storage layout. +- **uplo**: specifies whether the upper or lower triangular part of the matrix `A` is supplied. +- **N**: specifies number of elements along each dimension of `A` +- **K**: specifies number of super-diagonals or sub-diagonals of matrix `A`. +- **α**: complex scalar constant. +- **A**: complex input matrix stored in linear memory as a [`Complex64Array`][@stdlib/array/complex64]. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **x**: complex input vector [`Complex64Array`][@stdlib/array/complex64]. +- **sx**: stride length for `x`. +- **β**: complex scalar constant. +- **y**: output [`Complex64Array`][@stdlib/array/complex64]. +- **sy**: stride length for `y`. + +The stride parameters determine how elements are accessed. For example, to iterate over every other element in `x` and `y`, + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); // eslint-disable-line max-params, max-len +var x = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 0.0, 0.0, 3.0, 3.0 ] ); // eslint-disable-line max-params, max-len +var y = new Complex64Array( [ 3.0, 3.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0 ] ); // eslint-disable-line max-params, max-len +var alpha = new Complex64( 0.5, 0.5 ); +var beta = new Complex64( 0.5, -0.5 ); + +chbmv( 'row-major', 'lower', 3, 1, alpha, A, 2, x, 3, beta, y, 2 ); +// y => [ -1.0, 5.0, 0.0, 0.0, -8.0, 20.0, 0.0, 0.0, 9.0, 23.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +// Initial arrays... +var x0 = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +var y0 = new Complex64Array( [ 0.0, 0.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); // eslint-disable-line max-params, max-len +var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); // eslint-disable-line max-params, max-len +var alpha = new Complex64( 0.5, 0.5 ); +var beta = new Complex64( 0.5, -0.5 ); + +// Create offset views... +var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd complex element +var y1 = new Complex64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd complex element + +chbmv( 'row-major', 'lower', 3, 1, alpha, A, 2, x1, 1, beta, y1, 1 ); +// y1 => [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +``` + + + +#### chbmv.ndarray( uplo, N, K, α, A, sa1, sa2, oa, x, sx, ox, β, y, sy, oy ) + +Performs the matrix-vector operation `y = α*A*x + β*y` using alternative indexing semantics, where `α` and `β` are complex scalars, `x` and `y` are complex vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` sub-diagonals or super-diagonals. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); // eslint-disable-line max-params, max-len +var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +var alpha = new Complex64( 0.5, 0.5 ); +var beta = new Complex64( 0.5, -0.5 ); + +chbmv.ndarray( 'lower', 3, 1, alpha, A, 2, 1, 0, x, 1, 0, beta, y, 1, 0 ); +// y => [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +``` + +The function has the following additional parameters: + +- **sa1**: stride of the first dimension of `A`. +- **sa2**: stride of the second dimension of `A`. +- **oa**: starting index 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 Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); // eslint-disable-line max-params, max-len +var x = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +var y = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0 ] ); // eslint-disable-line max-params, max-len + +var alpha = new Complex64( 0.5, 0.5 ); +var beta = new Complex64( 0.5, -0.5 ); + +chbmv.ndarray( 'lower', 3, 1, alpha, A, 1, 2, 0, x, 1, 1, beta, y, -1, 4 ); +// y => [ 9.0, 23.0, 0.0, 0.0, -8.0, 20.0, 0.0, 0.0, -1.0, 5.0 ] +``` + +
+ + + +
+ +## Notes + +- `chbmv()` corresponds to the [BLAS][blas] level 2 function [`chbmv`][chbmv]. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var logEach = require( '@stdlib/console/log-each' ); +var chbmv = require( '@stdlib/blas/base/chbmv' ); + +function rand() { + return new Complex64( discreteUniform( 0, 255 ), discreteUniform( -128, 127 ) ); // eslint-disable-line max-params, max-len +} + +var N = 3; +var K = 1; + +var A = filledarrayBy( N*(K+1), 'complex64', rand ); +var x = filledarrayBy( N, 'complex64', rand ); +var y = filledarrayBy( N, 'complex64', rand ); + +var alpha = new Complex64( 0.5, 0.5 ); +var beta = new Complex64( 0.5, -0.5 ); + +chbmv( 'row-major', 'lower', N, 1, alpha, A, (K+1), x, 1, beta, y, 1 ); + +// Print the results: +logEach( '(%s)', x ); + +chbmv.ndarray( 'lower', N, 1, alpha, A, (K+1), 1, 0, x, 1, 0, beta, y, 1, 0 ); + +// Print the results: +logEach( '(%s)', x ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/chbmv/benchmark/benchmark.js new file mode 100644 index 000000000000..c99b1fb8d35b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/benchmark/benchmark.js @@ -0,0 +1,127 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var chbmv = require( './../lib/chbmv.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var xbuf; + var ybuf; + var Abuf; + var x; + var y; + var A; + var K; + + K = N - 1; + + xbuf = uniform( N*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + ybuf = uniform( N*2, -100.0, 100.0, options ); + y = new Complex64Array( ybuf.buffer ); + Abuf = uniform( (N*(K+1))*2, -100.0, 100.0, options ); + A = new Complex64Array( Abuf.buffer ); + + alpha = new Complex64( 0.5, 0.5 ); + beta = new Complex64( 0.5, -0.5 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + var z; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = chbmv( 'row-major', 'lower', N, K, alpha, A, (K+1), x, 1, beta, y, 1 ); + if ( isnanf( z[ i% ( z.length ) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z[ i % ( z.length ) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( format( '%s:size=%d', pkg, N*N ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/chbmv/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..0f0b376e8e8a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/benchmark/benchmark.ndarray.js @@ -0,0 +1,127 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var chgmv = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var xbuf; + var ybuf; + var Abuf; + var x; + var y; + var A; + var K; + + K = N - 1; + + xbuf = uniform( N*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + ybuf = uniform( N*2, -100.0, 100.0, options ); + y = new Complex64Array( ybuf.buffer ); + Abuf = uniform( (N*(K+1))*2, -100.0, 100.0, options ); + A = new Complex64Array( Abuf.buffer ); + + alpha = new Complex64( 0.5, 0.5 ); + beta = new Complex64( 0.5, -0.5 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + var z; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = chgmv( 'lower', N, K, alpha, A, 1, (K+1), 0, x, 1, 0, beta, y, 1, 0 ); + if ( isnanf( z[ i % ( z.length ) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z[ i % ( z.length ) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/chbmv/docs/repl.txt new file mode 100644 index 000000000000..1d229a4f23ba --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/docs/repl.txt @@ -0,0 +1,189 @@ + +{{alias}}( order, uplo, N, K, α, A, lda, x, sx, β, y, sy ) + Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` + are complex scalars, `x` and `y` are complex vectors, and `A` is an `N` by + `N` Hermitian band matrix with `K` sub-diagonals or 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 + 0i` and `β` equals `1 + 0i`, the function returns `y` + unchanged. + + Parameters + ---------- + order: string + Row-major (C-style) or column-major (Fortran-style) order. + + 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 or sub-diagonals of matrix `A`. + + α: Complex64 + Complex scalar constant. + + A: Complex64Array + Complex input matrix. + + lda: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + x: Complex64Array + First complex input vector. + + sx: integer + Index increment for `x`. + + β: Complex64 + Complex scalar constant. + + y: Complex64Array + Second complex input vector. + + sy: integer + Index increment for `y`. + + Returns + ------- + y: Complex64Array + Second complex input vector. + + Examples + -------- + // Standard usage: + > var x = new {{alias:@stdlib/array/complex64}}([1.0,1.0,2.0,2.0,3.0,3.0]); + > var y = new {{alias:@stdlib/array/complex64}}([3.0,3.0,2.0,2.0,1.0,1.0]); + > var buf1 = [0.0,0.0,1.0,0.0,2.0,-2.0]; + > var buf2 = [3.0,0.0,4.0,-4.0,5.0,0.0]; + > var buf = buf1.concat( buf2 ); + > var A = new {{alias:@stdlib/array/complex64}}( buf ); + > var alpha = new {{alias:@stdlib/complex/float32/ctor}}(0.5,0.5); + > var beta = new {{alias:@stdlib/complex/float32/ctor}}(0.5,-0.5); + > var ord = 'row-major'; + > var uplo = 'lower'; + > {{alias}}( ord, uplo, 3, 1, alpha, A, 2, x, 1, beta, y, 1 ) + [-1.0,5.0,-8.0,20.0,9.0,23.0] + + // Advanced indexing: + > x = new {{alias:@stdlib/array/complex64}}([3.0,3.0,2.0,2.0,1.0,1.0]); + > y = new {{alias:@stdlib/array/complex64}}([1.0,1.0,2.0,2.0,3.0,3.0]); + > buf1 = [0.0,0.0,1.0,0.0,2.0,-2.0]; + > buf2 = [3.0,0.0,4.0,-4.0,5.0,0.0]; + > buf = buf1.concat( buf2 ); + > A = new {{alias:@stdlib/array/complex64}}( buf ); + > alpha = new {{alias:@stdlib/complex/float32/ctor}}(0.5,0.5); + > beta = new {{alias:@stdlib/complex/float32/ctor}}(0.5,-0.5); + > ord = 'row-major'; + > uplo = 'lower'; + > {{alias}}( ord, uplo, 3, 1, alpha, A, 2, x, -1, beta, y, -1 ) + [9.0,23.0,-8.0,20.0,-1.0,5.0] + + // Using typed array views: + > var x0buf = [0.0,0.0,3.0,3.0,2.0,2.0,1.0,1.0]; + > var x0 = new {{alias:@stdlib/array/complex64}}( x0buf ); + > var y0buf = [0.0,0.0,1.0,1.0,2.0,2.0,3.0,3.0]; + > var y0 = new {{alias:@stdlib/array/complex64}}( y0buf ); + > var x0bytes = x0.BYTES_PER_ELEMENT*1; + > var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, x0bytes ); + > var y0bytes = y0.BYTES_PER_ELEMENT*1; + > var y1 = new {{alias:@stdlib/array/complex64}}( y0.buffer, y0bytes ); + > buf1 = [0.0,0.0,1.0,0.0,2.0,-2.0]; + > buf2 = [3.0,0.0,4.0,-4.0,5.0,0.0]; + > buf = buf1.concat( buf2 ); + > A = new {{alias:@stdlib/array/complex64}}( buf ); + > alpha = new {{alias:@stdlib/complex/float32/ctor}}(0.5,0.5); + > beta = new {{alias:@stdlib/complex/float32/ctor}}(0.5,-0.5); + > ord = 'row-major'; + > uplo = 'lower'; + > {{alias}}( ord, uplo, 3, 1, alpha, A, 2, x1, -1, beta, y1, -1 ) + [9.0,23.0,-8.0,20.0,-1.0,5.0] + + +{{alias}}.ndarray( uplo, N, K, α, A, sa1, sa2, oa, x, sx, ox, β, y, sy, oy ) + Performs the matrix-vector operation `y = α*A*x + β*y` using alternative + indexing semantics and, where `α` and `β` are complex scalars, `x` and `y` + are complex vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` + sub-diagonals or 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 columns in `A`. + + K: integer + Number of super-diagonals or sub-diagonals of matrix `A`. + + α: Complex64 + Complex scalar constant. + + A: Complex64Array + Complex input matrix. + + sa1: integer + Stride of the first dimension of `A`. + + sa2: integer + Stride of the second dimension of `A`. + + oa: integer + Starting index (offset) for `A`. + + x: Complex64Array + First complex input vector. + + sx: integer + Index increment for `x`. + + ox: integer + Starting index (offset) for `x`. + + β: Complex64 + Complex scalar constant. + + y: Complex64Array + Second complex input vector. + + sy: integer + Index increment for `y`. + + oy: integer + Starting index (offset) for `y`. + + Returns + ------- + y: Complex64Array + Second complex input vector. + + Examples + -------- + > x = new {{alias:@stdlib/array/complex64}}([1.0,1.0,2.0,2.0,3.0,3.0]); + > y = new {{alias:@stdlib/array/complex64}}([3.0,3.0,2.0,2.0,1.0,1.0]); + > buf1 = [0.0,0.0,1.0,0.0,2.0,-2.0]; + > buf2 = [3.0,0.0,4.0,-4.0,5.0,0.0]; + > buf = buf1.concat( buf2 ); + > A = new {{alias:@stdlib/array/complex64}}( buf ); + > alpha = new {{alias:@stdlib/complex/float32/ctor}}(0.5,0.5); + > beta = new {{alias:@stdlib/complex/float32/ctor}}(0.5,-0.5); + > uplo = 'lower'; + > {{alias}}.ndarray(uplo,3,1,alpha,A,2,1,0,x,1,0,beta,y,1,0) + [-1.0,5.0,-8.0,20.0,9.0,23.0] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/chbmv/docs/types/index.d.ts new file mode 100644 index 000000000000..91129ebed941 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/docs/types/index.d.ts @@ -0,0 +1,147 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 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 { Complex64Array } from '@stdlib/types/array'; +import { Layout, MatrixTriangle } from '@stdlib/types/blas'; +import { Complex64 } from '@stdlib/types/complex'; + +/** +* Interface describing `chbmv`. +*/ +interface Routine { + /** + * Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are complex vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` sub-diagonals or super-diagonals. + * + * @param order - storage layout + * @param uplo - specifies whether `A` is an upper or lower triangular part of matrix is supplied. + * @param N - number of elements along each dimension of `A` + * @param K - number of super-diagonals or sub-diagonals of matrix `A`. + * @param alpha - complex scalar constant + * @param A - complex input matrix + * @param LDA - stride of the first dimension of `A` + * @param x - first complex input vector + * @param strideX - `x` stride length + * @param beta - complex scalar constant + * @param y - second complex input vector + * @param strideY - `y` stride length + * @returns `y` + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); + * var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); + * var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); + * var alpha = new Complex64( 0.5, 0.5 ); + * var beta = new Complex64( 0.5, -0.5 ); + * + * chbmv( 'row-major', 'lower', 3, 1, alpha, A, 2, x, 1, beta, y, 1 ); + * // y => [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] + */ + ( order: Layout, uplo: MatrixTriangle, N: number, K: Number, alpha: Complex64, A: Complex64Array, LDA: number, x: Complex64Array, strideX: number, beta: Complex64, y: Complex64Array, strideY: number ): Complex64Array; + + /** + * Performs the matrix-vector operation `y = α*A*x + β*y`, using alternative indexing semantics. + * + * @param uplo - specifies whether `A` is an upper or lower triangular part of matrix is supplied. + * @param N - number of elements along each dimension of `A` + * @param K - number of super-diagonals or sub-diagonals of matrix `A`. + * @param alpha - complex scalar constant + * @param A - complex input matrix + * @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 complex input vector + * @param strideX - `x` stride length + * @param offsetX - starting index for `x` + * @param beta - complex scalar constant + * @param y - second complex input vector + * @param strideY - `y` stride length + * @param offsetY - starting index for `y` + * @returns `y` + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); + * var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); + * var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); + * var alpha = new Complex64( 0.5, 0.5 ); + * var beta = new Complex64( 0.5, -0.5 ); + * + * chbmv.ndarray( 'lower', 3, 1, alpha, A, 2, 1, 0, x, 1, 0, beta, y, 1, 0 ); + * // y => [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] + */ + ndarray( uplo: MatrixTriangle, N: number, K: Number, alpha: Complex64, A: Complex64Array, strideA1: number, strideA2: number, offsetA: number, x: Complex64Array, strideX: number, offsetX: number, beta: Complex64, y: Complex64Array, strideY: number, offsetY: number ): Complex64Array; +} + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are complex vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` sub-diagonals or super-diagonals. +* +* @param order - storage layout +* @param uplo - specifies whether `A` is an upper or lower triangular part of matrix is supplied. +* @param N - number of elements along each dimension of `A` +* @param K - number of super-diagonals or sub-diagonals of matrix `A`. +* @param alpha - complex scalar constant +* @param A - complex input matrix +* @param LDA - stride of the first dimension of `A` +* @param x - first complex input vector +* @param strideX - `x` stride length +* @param beta - complex scalar constant +* @param y - second complex input vector +* @param strideY - `y` stride length +* @returns `y` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chbmv( 'row-major', 'lower', 3, 1, alpha, A, 2, x, 1, beta, y, 1 ); +* // y => [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chbmv.ndarray( 'lower', 3, 1, alpha, A, 2, 1, 0, x, 1, 0, beta, y, 1, 0 ); +* // y => [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +*/ +declare var chbmv: Routine; + + +// EXPORTS // + +export = chbmv; diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/chbmv/docs/types/test.ts new file mode 100644 index 000000000000..b9a399ccaf17 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/docs/types/test.ts @@ -0,0 +1,580 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 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 Complex64Array = require( '@stdlib/array/complex64' ); +import Complex64 = require( '@stdlib/complex/float32/ctor' ); +import chbmv = require( './index' ); + + +// TESTS // + +// The function returns a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 1.0, 0.0 ); + const beta = new Complex64( 1.0, 0.0 ); + + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectType Complex64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv( 10, 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( true, 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( false, 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( null, 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( undefined, 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( [], 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( {}, 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( ( x: number ): number => x, 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv( 'row-major', 10, 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', true, 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', false, 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', null, 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', undefined, 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', [], 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', {}, 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', ( x: number ): number => x, 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv( 'row-major', 'lower', '10', 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', true, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', false, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', null, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', undefined, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', [], 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', {}, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', ( x: number ): number => x, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv( 'row-major', 'lower', 10, '10', alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, true, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, false, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, null, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, undefined, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, [], alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, {}, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, ( x: number ): number => x, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a Complex64... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv( 'row-major', 'lower', 10, 10, '10', A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, true, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, false, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, null, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, undefined, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, [], A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, {}, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, ( x: number ): number => x, A, 10, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv( 'row-major', 'lower', 10, 10, alpha, 10, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, '10', 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, true, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, false, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, null, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, undefined, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, [ '1' ], 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, {}, 10, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, ( x: number ): number => x, 10, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv( 'row-major', 'lower', 10, 10, alpha, A, '10', x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, true, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, false, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, null, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, undefined, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, [], x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, {}, x, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, ( x: number ): number => x, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a Complex64Array... +{ + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, 10, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, '10', 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, true, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, false, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, null, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, undefined, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, [ '1' ], 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, {}, 1, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, ( x: number ): number => x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, '10', beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, true, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, false, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, null, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, undefined, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, [], beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, {}, beta, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, ( x: number ): number => x, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a Complex64... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, '10', y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, true, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, false, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, null, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, undefined, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, [], y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, {}, y, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, ( x: number ): number => x, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eleventh argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, 10, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, '10', 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, true, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, false, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, null, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, undefined, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, [], 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, {}, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, ( 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 Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, '10' ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, true ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, false ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, null ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, undefined ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, [] ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, {} ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv(); // $ExpectError + chbmv( 'row-major' ); // $ExpectError + chbmv( 'row-major', 'lower' ); // $ExpectError + chbmv( 'row-major', 'lower', 10 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1 ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y ); // $ExpectError + chbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectType Complex64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 10, 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( true, 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( false, 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( null, 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( undefined, 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( [ '1' ], 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( {}, 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( ( x: number ): number => x, 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, 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 Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 'lower', '10', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', true, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', false, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', null, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', undefined, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', [], 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', {}, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', ( x: number ): number => x, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, 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 Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 'lower', 10, '10', alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, true, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, false, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, null, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, undefined, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, [], alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, {}, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, ( x: number ): number => x, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a Complex64... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 'lower', 10, 10, '10', A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, 10, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, true, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, false, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, null, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, undefined, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, [], A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, {}, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, ( x: number ): number => x, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 'lower', 10, 10, alpha, 10, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, '10', 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, true, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, false, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, null, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, undefined, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, [], 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, {}, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, ( x: number ): number => x, 10, 1, 0, x, 1, 0, beta, 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 Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 'lower', 10, 10, alpha, A, '10', 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, true, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, false, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, null, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, undefined, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, [], 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, {}, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, ( x: number ): number => x, 1, 0, x, 1, 0, beta, 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 Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, '10', 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, true, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, false, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, null, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, undefined, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, [], 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, {}, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, ( x: number ): number => x, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, '10', x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, true, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, false, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, null, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, undefined, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, [], x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, {}, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, ( x: number ): number => x, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a Complex64Array... +{ + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, 10, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, '10', 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, true, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, false, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, null, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, undefined, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, [], 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, {}, 1, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, ( x: number ): number => x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, '10', 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, true, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, false, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, null, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, undefined, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, [], 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, {}, 0, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, ( x: number ): number => x, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eleventh argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, '10', beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, true, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, false, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, null, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, undefined, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, [], beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, {}, beta, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, ( x: number ): number => x, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a twelfth argument which is not a Complex64... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, '10', y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, 10, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, true, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, false, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, null, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, undefined, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, [], y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, {}, y, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, ( x: number ): number => x, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a thirteenth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, 10, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, '10', 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, true, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, false, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, null, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, undefined, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, [], 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, {}, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, ( 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 Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, '10', 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, true, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, false, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, null, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, undefined, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, [], 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, {}, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, 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 Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, '10' ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, true ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, false ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, null ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, undefined ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, [] ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, {} ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, 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 Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chbmv.ndarray(); // $ExpectError + chbmv.ndarray( 'lower' ); // $ExpectError + chbmv.ndarray( 'lower', 10 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1 ); // $ExpectError + chbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/chbmv/examples/index.js new file mode 100644 index 000000000000..8deade348d1b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/examples/index.js @@ -0,0 +1,70 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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/base/discrete-uniform' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var logEach = require( '@stdlib/console/log-each' ); +var chgmv = require( './../lib' ); + +var alpha; +var beta; +var N; +var K; +var x; +var y; +var A; + + +// FUNCTIONS // + +/** +* Generates a random complex number with discrete uniform real and imaginary parts. +* +* @private +* @returns {Complex64} random complex number +* +* @example +* var z = rand(); +* // returns a +*/ +function rand() { + return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); +} + +N = 3; +K = 1; + +x = filledarrayBy( N, 'complex64', rand ); +y = filledarrayBy( N, 'complex64', rand ); +A = filledarrayBy( N*(K+1), 'complex64', rand ); + +alpha = new Complex64( 2.0, 3.0 ); +beta = new Complex64( 3.0, -2.0 ); + +chgmv( 'row-major', 'lower', N, K, alpha, A, (K+1), x, 1, beta, y, 1 ); + +// Print the results: +logEach( '(%s)', y ); + +chgmv.ndarray( 'lower', N, K, alpha, A, 1, (K+1), 0, x, 1, 0, beta, y, 1, 0 ); + +// Print the results: +logEach( '(%s)', y ); diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js new file mode 100644 index 000000000000..25c1d3241a85 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js @@ -0,0 +1,232 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 cfill = require( '@stdlib/blas/ext/base/cfill' ).ndarray; +var cscal = require( '@stdlib/blas/base/cscal' ).ndarray; +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var muladd = require( '@stdlib/complex/float32/base/mul-add' ).assign; +var max = require( '@stdlib/math/base/special/max' ); +var min = require( '@stdlib/math/base/special/min' ); + + +// MAIN // + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are complex vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` sub-diagonals or super-diagonals. +* +* @private +* @param {string} uplo - specifies whether `A` is an upper or lower triangular part of matrix is supplied. +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {NonNegativeInteger} K - number of super-diagonals or sub-diagonals of matrix `A`. +* @param {Complex64} alpha - complex scalar constant +* @param {Complex64Array} A - complex input 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 {Complex64Array} x - first complex input vector +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {Complex64} beta - complex scalar constant +* @param {Complex64Array} y - second complex input vector +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting index for `y` +* @returns {Complex64Array} `y` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chbmv( 'lower', 3, 1, alpha, A, 2, 1, 0, x, 1, 0, beta, y, 1, 0 ); +* // y => [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +*/ +function chbmv( uplo, N, K, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len + var realpha; + var imalpha; + var rebeta; + var imbeta; + var retmp1; + var imtmp1; + var retmp2; + var imtmp2; + var viewA; + var viewX; + var viewY; + var isrm; + var cima; + var sign; + var sa0; + var sa1; + var oa2; + var oa3; + var rea; + var ima; + var rex; + var imx; + var ix; + var iy; + var oa; + var ox; + var oy; + var sx; + var sy; + var i0; + var i1; + var ia; + var m; + + // Layout + isrm = isRowMajor( [ strideA1, strideA2 ] ); + + // Decompose scalars + rebeta = realf( beta ); + imbeta = imagf( beta ); + realpha = realf( alpha ); + imalpha = imagf( alpha ); + + // y = beta*y + if ( rebeta === 0.0 && imbeta === 0.0 ) { + cfill( N, 0.0, y, strideY, offsetY ); + } else if ( rebeta !== 1.0 || imbeta !== 0.0 ) { + cscal( N, beta, y, strideY, offsetY ); + } + + // If alpha is zero, early return y + if ( realpha === 0.0 && imalpha === 0.0 ) { + return y; + } + + // Reinterpret arrays to raw numeric views + viewA = reinterpret( A, 0 ); + viewX = reinterpret( x, 0 ); + viewY = reinterpret( y, 0 ); + + if ( isrm ) { + // For row-major matrices, the last dimension has the fastest changing index... + sa0 = strideA2 * 2; // offset increment for innermost loop + sa1 = strideA1 * 2; // offset increment for outermost loop + } else { // isColMajor + // For column-major matrices, the first dimension has the fastest changing index... + sa0 = strideA1 * 2; // offset increment for innermost loop + sa1 = strideA2 * 2; // offset increment for outermost loop + } + + // Adjust sign to account for layout-dependent conjugation + if ( isrm ) { + sign = -1; + } else { + sign = 1; + } + + // Vector indexing base + oa = offsetA * 2; + ox = offsetX * 2; + oy = offsetY * 2; + + // Vector strides + sx = strideX * 2; + sy = strideY * 2; + + if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { + for ( i1 = 0; i1 < N; i1++ ) { + ix = ox + ( i1 * sx ); + rex = viewX[ ix ]; + imx = viewX[ ix + 1 ]; + retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); + imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); + retmp2 = 0.0; + imtmp2 = 0.0; + oa3 = oa + ( i1 * sa1 ); + ia = oa3; + rea = viewA[ ia ]; + iy = oy + ( i1 * sy ); + viewY[ iy ] += f32( retmp1 * rea ); + viewY[ iy + 1 ] += f32( imtmp1 * rea ); + m = -i1; + oa2 = oa3 + ( m * sa0 ); + for ( i0 = i1 + 1; i0 < min( N, i1 + K + 1 ); i0++ ) { + ia = oa2 + ( i0 * sa0 ); + rea = viewA[ ia ]; + ima = viewA[ ia + 1 ]; + cima = sign * ima; + iy = oy + ( i0 * sy ); + muladd( retmp1, imtmp1, rea, cima, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len + ix = ox + ( i0 * sx ); + rex = viewX[ ix ]; + imx = viewX[ ix + 1 ]; + retmp2 += f32( ( rea * rex ) + ( cima * imx ) ); + imtmp2 += f32( ( rea * imx ) - ( cima * rex ) ); + } + iy = oy + ( i1 * sy ); + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len + } + return y; + } + + // ( isrm && uplo === 'lower' ) || ( !isrm && uplo === 'upper' ) + for ( i1 = 0; i1 < N; i1++ ) { + ix = ox + ( i1 * sx ); + rex = viewX[ ix ]; + imx = viewX[ ix + 1 ]; + retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); + imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); + retmp2 = 0.0; + imtmp2 = 0.0; + oa3 = oa + ( i1 * sa1 ); + m = K - i1; + oa2 = oa3 + ( m * sa0 ); + for ( i0 = max( 0, i1 - K ); i0 < i1; i0++ ) { + ia = oa2 + ( i0 * sa0 ); + rea = viewA[ ia ]; + ima = viewA[ ia + 1 ]; + cima = sign * ima; + iy = oy + ( i0 * sy ); + muladd( retmp1, imtmp1, rea, cima, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len + ix = ox + ( i0 * sx ); + rex = viewX[ ix ]; + imx = viewX[ ix + 1 ]; + retmp2 += f32( ( rea * rex ) + ( cima * imx ) ); + imtmp2 += f32( ( rea * imx ) - ( cima * rex ) ); + } + ia = oa3 + ( K * sa0 ); + rea = viewA[ ia ]; + iy = oy + ( i1 * sy ); + viewY[ iy ] += f32( retmp1 * rea ); + viewY[ iy + 1 ] += f32( imtmp1 * rea ); + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len + } + return y; +} + + +// EXPORTS // + +module.exports = chbmv; diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/lib/chbmv.js b/lib/node_modules/@stdlib/blas/base/chbmv/lib/chbmv.js new file mode 100644 index 000000000000..41f3975b19e7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/lib/chbmv.js @@ -0,0 +1,126 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are complex vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` sub-diagonals or super-diagonals. +* +* @param {string} order - storage layout +* @param {string} uplo - specifies whether `A` is an upper or lower triangular part of matrix is supplied. +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {NonNegativeInteger} K - number of super-diagonals or sub-diagonals of matrix `A`. +* @param {Complex64} alpha - complex scalar constant +* @param {Complex64Array} A - complex input matrix +* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Complex64Array} x - first complex input vector +* @param {integer} strideX - `x` stride length +* @param {Complex64} beta - complex scalar constant +* @param {Complex64Array} y - second complex input vector +* @param {integer} strideY - `y` stride length +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must specify whether to reference the lower or upper triangular matrix +* @throws {RangeError} third argument must be a nonnegative integer +* @throws {RangeError} seventh argument must be a valid stride +* @throws {RangeError} ninth argument must be non-zero +* @throws {RangeError} twelfth argument must be non-zero +* @returns {Complex64Array} `y` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chbmv( 'row-major', 'lower', 3, 1, alpha, A, 2, x, 1, beta, y, 1 ); +* // y => [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +*/ +function chbmv( order, uplo, N, K, alpha, A, LDA, x, strideX, beta, y, strideY ) { // eslint-disable-line max-params + var realpha; + var imalpha; + var rebeta; + var imbeta; + var sa1; + var sa2; + var ox; + var oy; + + 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 to reference the lower or upper triangular matrix. 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 ( strideX === 0 ) { + throw new RangeError( format( 'invalid argument. Ninth argument must be non-zero. Value: `%d`.', strideX ) ); + } + if ( strideY === 0 ) { + throw new RangeError( format( 'invalid argument. Twelfth argument must be non-zero. Value: `%d`.', strideY ) ); + } + if ( LDA < ( K + 1 ) ) { + throw new RangeError( format( 'invalid argument. Sixth argument (LDA) must be greater than or equal to (K+1)=%d. Value: `%d`.', K + 1, LDA ) ); + } + rebeta = realf( beta ); + imbeta = imagf( beta ); + realpha = realf( alpha ); + imalpha = imagf( alpha ); + + // Check if we can early return... + if ( N === 0 || ( realpha === 0.0 && imalpha === 0.0 && rebeta === 1.0 && imbeta === 0.0 ) ) { // eslint-disable-line max-len + return y; + } + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + } + ox = stride2offset( N, strideX ); + oy = stride2offset( N, strideY ); + return base( uplo, N, K, alpha, A, sa1, sa2, 0, x, strideX, ox, beta, y, strideY, oy ); +} + + +// EXPORTS // + +module.exports = chbmv; diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/chbmv/lib/index.js new file mode 100644 index 000000000000..1748c1be7b9c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/lib/index.js @@ -0,0 +1,79 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are complex vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` sub-diagonals or super-diagonals. +* +* @module @stdlib/blas/base/chbmv +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* var chbmv = require( '@stdlib/blas/base/chbmv' ); +* +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chbmv( 'row-major', 'lower', 3, 1, alpha, A, 2, x, 1, beta, y, 1 ); +* // y => [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* var chbmv = require( '@stdlib/blas/base/chbmv' ); +* +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chbmv.ndarray( 'lower', 3, 1, alpha, A, 2, 1, 0, x, 1, 0, beta, y, 1, 0 ); +* // y => [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.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 chbmv; +var tmp = tryRequire( join( __dirname, './native.js' ) ); + +if ( isError( tmp ) ) { + chbmv = main; +} else { + chbmv = tmp; +} + + +// EXPORTS // + +module.exports = chbmv; + +// exports: { "ndarray": "chbmv.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/lib/main.js b/lib/node_modules/@stdlib/blas/base/chbmv/lib/main.js new file mode 100644 index 000000000000..4b681a5c3957 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 chbmv = require( './chbmv.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( chbmv, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = chbmv; diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/chbmv/lib/ndarray.js new file mode 100644 index 000000000000..88aa5e1448cb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/lib/ndarray.js @@ -0,0 +1,112 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 format = require( '@stdlib/string/format' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are complex vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` sub-diagonals or super-diagonals. +* +* @param {string} uplo - specifies whether `A` is an upper or lower triangular part of matrix is supplied. +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {NonNegativeInteger} K - number of super-diagonals or sub-diagonals of matrix `A`. +* @param {Complex64} alpha - complex scalar constant +* @param {Complex64Array} A - complex input 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 {Complex64Array} x - first complex input vector +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {Complex64} beta - complex scalar constant +* @param {Complex64Array} y - second complex input vector +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting index for `y` +* @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} sixth argument must be non-zero +* @throws {RangeError} seventh argument must be non-zero +* @throws {RangeError} tenth argument must be non-zero +* @throws {RangeError} fourteenth argument must be non-zero +* @returns {Complex64Array} `y` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chbmv( 'lower', 3, 1, alpha, A, 2, 1, 0, x, 1, 0, beta, y, 1, 0 ); +* // y => [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +*/ +function chbmv( uplo, N, K, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len + var realpha; + var imalpha; + var rebeta; + var imbeta; + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( format( 'invalid argument. First argument must specify whether to reference the lower or upper triangular matrix. Value: `%s`.', uplo ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( K < 0 ) { + throw new RangeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%d`.', K ) ); + } + if ( strideA1 === 0 ) { + throw new RangeError( format( 'invalid argument. Sixth argument must be non-zero. Value: `%d`.', strideA1 ) ); + } + if ( strideA2 === 0 ) { + throw new RangeError( format( 'invalid argument. Seventh argument must be non-zero. Value: `%d`.', strideA2 ) ); + } + if ( strideX === 0 ) { + throw new RangeError( format( 'invalid argument. Tenth argument must be non-zero. Value: `%d`.', strideX ) ); + } + if ( strideY === 0 ) { + throw new RangeError( format( 'invalid argument. Fourteenth argument must be non-zero. Value: `%d`.', strideY ) ); + } + rebeta = realf( beta ); + imbeta = imagf( beta ); + realpha = realf( alpha ); + imalpha = imagf( alpha ); + + // Check if we can early return... + if ( N === 0 || ( realpha === 0.0 && imalpha === 0.0 && rebeta === 1.0 && imbeta === 0.0 ) ) { // eslint-disable-line max-len + return y; + } + return base( uplo, N, K, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ); +} + + +// EXPORTS // + +module.exports = chbmv; diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/package.json b/lib/node_modules/@stdlib/blas/base/chbmv/package.json new file mode 100644 index 000000000000..a090177fd92a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/package.json @@ -0,0 +1,75 @@ +{ + "name": "@stdlib/blas/base/chbmv", + "version": "0.0.0", + "description": "Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are complex vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` sub-diagonals or 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", + "browser": "./lib/main.js", + "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", + "chbmv", + "hermitian", + "band", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "complex", + "complex64", + "complex64array", + "float", + "float32", + "single", + "float32array" + ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_alpha_zero.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_alpha_zero.json new file mode 100644 index 000000000000..44856891862c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_alpha_zero.json @@ -0,0 +1,29 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.0, 0.0 ], + "A": [ 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 0.0, 3.0, 0.0, 5.0, 0.0 ], + [ 2.0, -2.0, 4.0, -4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 3.0, 0.0, 2.0, 0.0, 1.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 000000000000..10383bb0f6ac --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_complex_access_pattern.json @@ -0,0 +1,29 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 4.0, -4.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 0.0 ], + "A_compact": [ + [ 1.0, 0.0, 3.0, 0.0, 5.0, 0.0 ], + [ 2.0, -2.0, 4.0, -4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "lda": 2, + "strideA1": -6, + "strideA2": -13, + "offsetA": 35, + "x": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideX": -1, + "offsetX": 2, + "beta": [ 0.5, -0.5 ], + "y": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideY": -1, + "offsetY": 2, + "y_out": [ 9.0, 23.0, -8.0, 20.0, -1.0, 5.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_l.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_l.json new file mode 100644 index 000000000000..5cfab2abce43 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_l.json @@ -0,0 +1,29 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 0.0, 3.0, 0.0, 5.0, 0.0 ], + [ 2.0, -2.0, 4.0, -4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_oa.json new file mode 100644 index 000000000000..917668b2142c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_oa.json @@ -0,0 +1,29 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 0.0, 3.0, 0.0, 5.0, 0.0 ], + [ 2.0, -2.0, 4.0, -4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 9, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_sa1_sa2.json new file mode 100644 index 000000000000..d7e7beb38c57 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_sa1_sa2.json @@ -0,0 +1,28 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 999.0, 999.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 0.0, 999.0, 999.0, 999.0, 999.0, 4.0, -4.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 0.0, 3.0, 0.0, 5.0, 0.0 ], + [ 2.0, -2.0, 4.0, -4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "strideA1": 3, + "strideA2": 7, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_sa1_sa2n.json new file mode 100644 index 000000000000..b5b85f02d6f8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_sa1_sa2n.json @@ -0,0 +1,28 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 5.0, 0.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 0.0, 999.0, 999.0, 4.0, -4.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 0.0, 999.0, 999.0, 2.0, -2.0 ], + "A_compact": [ + [ 1.0, 0.0, 3.0, 0.0, 5.0, 0.0 ], + [ 2.0, -2.0, 4.0, -4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "strideA1": 2, + "strideA2": -8, + "offsetA": 16, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_sa1n_sa2.json new file mode 100644 index 000000000000..f2b504bd3a76 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_sa1n_sa2.json @@ -0,0 +1,28 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 2.0, -2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 4.0, -4.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 0.0 ], + "A_compact": [ + [ 1.0, 0.0, 3.0, 0.0, 5.0, 0.0 ], + [ 2.0, -2.0, 4.0, -4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "strideA1": -4, + "strideA2": 11, + "offsetA": 4, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_sa1n_sa2n.json new file mode 100644 index 000000000000..311a3945a608 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_sa1n_sa2n.json @@ -0,0 +1,28 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 4.0, -4.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 0.0 ], + "A_compact": [ + [ 1.0, 0.0, 3.0, 0.0, 5.0, 0.0 ], + [ 2.0, -2.0, 4.0, -4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "strideA1": -5, + "strideA2": -10, + "offsetA": 25, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_u.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_u.json new file mode 100644 index 000000000000..0dcedb73fd33 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_u.json @@ -0,0 +1,29 @@ +{ + "order": "column-major", + "uplo": "upper", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 1.0, 0.0, 2.0, 2.0, 3.0, 0.0, 4.0, 4.0, 5.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 2.0, 2.0, 4.0, 4.0 ], + [ 1.0, 0.0, 3.0, 0.0, 5.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 2.0, 2.0, 0.0, 0.0 ], + [ 0.0, 0.0, 3.0, 0.0, 4.0, 4.0 ], + [ 0.0, 0.0, 0.0, 0.0, 5.0, 0.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_x_zeros.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_x_zeros.json new file mode 100644 index 000000000000..d46d3fec7ec7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_x_zeros.json @@ -0,0 +1,29 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 0.0, 3.0, 0.0, 5.0, 0.0 ], + [ 2.0, -2.0, 4.0, -4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "x": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 3.0, 0.0, 2.0, 0.0, 1.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_x_zeros_beta_one.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_x_zeros_beta_one.json new file mode 100644 index 000000000000..7df9846d4d64 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_x_zeros_beta_one.json @@ -0,0 +1,29 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 0.0, 3.0, 0.0, 5.0, 0.0 ], + [ 2.0, -2.0, 4.0, -4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "x": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 1.0, 0.0 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_xnyn.json new file mode 100644 index 000000000000..6c68b2c0b30e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_xnyn.json @@ -0,0 +1,31 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + "K": 2, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 2.0, -2.0, 3.0, 3.0, 4.0, 0.0, 5.0, -5.0, 6.0, 6.0, 7.0, 0.0, 8.0, -8.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 0.0, 4.0, 0.0, 7.0, 0.0, 9.0, 0.0 ], + [ 2.0, -2.0, 5.0, -5.0, 8.0, -8.0, 0.0, 0.0 ], + [ 3.0, 3.0, 6.0, 6.0, 0.0, 0.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, -5.0, 7.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideX": -1, + "offsetX": 3, + "beta": [ 0.5, -0.5 ], + "y": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideY": -1, + "offsetY": 3, + "y_out": [ 13.0, 72.0, -23.0, 66.0, 14.0, 49.0, 9.0, 14.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_xnyp.json new file mode 100644 index 000000000000..61d06e9cb8ac --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_xnyp.json @@ -0,0 +1,31 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + "K": 2, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 2.0, -2.0, 3.0, 3.0, 4.0, 0.0, 5.0, -5.0, 6.0, 6.0, 7.0, 0.0, 8.0, -8.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 0.0, 4.0, 0.0, 7.0, 0.0, 9.0, 0.0 ], + [ 2.0, -2.0, 5.0, -5.0, 8.0, -8.0, 0.0, 0.0 ], + [ 3.0, 3.0, 6.0, 6.0, 0.0, 0.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, -5.0, 7.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideX": -1, + "offsetX": 3, + "beta": [ 0.5, -0.5 ], + "y": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 9.0, 14.0, 14.0, 49.0, -23.0, 66.0, 13.0, 72.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_xpyn.json new file mode 100644 index 000000000000..19299f10b67b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_xpyn.json @@ -0,0 +1,31 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + "K": 2, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 2.0, -2.0, 3.0, 3.0, 4.0, 0.0, 5.0, -5.0, 6.0, 6.0, 7.0, 0.0, 8.0, -8.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 0.0, 4.0, 0.0, 7.0, 0.0, 9.0, 0.0 ], + [ 2.0, -2.0, 5.0, -5.0, 8.0, -8.0, 0.0, 0.0 ], + [ 3.0, 3.0, 6.0, 6.0, 0.0, 0.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, -5.0, 7.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideY": -1, + "offsetY": 3, + "y_out": [ 13.0, 72.0, -23.0, 66.0, 14.0, 49.0, 9.0, 14.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_xpyp.json new file mode 100644 index 000000000000..531d06996920 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/column_major_xpyp.json @@ -0,0 +1,31 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + "K": 2, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 2.0, -2.0, 3.0, 3.0, 4.0, 0.0, 5.0, -5.0, 6.0, 6.0, 7.0, 0.0, 8.0, -8.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 0.0, 4.0, 0.0, 7.0, 0.0, 9.0, 0.0 ], + [ 2.0, -2.0, 5.0, -5.0, 8.0, -8.0, 0.0, 0.0 ], + [ 3.0, 3.0, 6.0, 6.0, 0.0, 0.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, -5.0, 7.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 9.0, 14.0, 14.0, 49.0, -23.0, 66.0, 13.0, 72.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_alpha_zero.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_alpha_zero.json new file mode 100644 index 000000000000..d166f94ada81 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_alpha_zero.json @@ -0,0 +1,30 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.0, 0.0 ], + "A": [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0 ], + [ 4.0, -4.0, 5.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "lda": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 3.0, 0.0, 2.0, 0.0, 1.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 000000000000..c6589df2a7e9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_complex_access_pattern.json @@ -0,0 +1,29 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 4.0, -4.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0 ], + [ 4.0, -4.0, 5.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "strideA1": -11, + "strideA2": -5, + "offsetA": 30, + "x": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideX": -1, + "offsetX": 2, + "beta": [ 0.5, -0.5 ], + "y": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideY": -1, + "offsetY": 2, + "y_out": [ 9.0, 23.0, -8.0, 20.0, -1.0, 5.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_l.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_l.json new file mode 100644 index 000000000000..f69dcf3c44f5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_l.json @@ -0,0 +1,30 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0 ], + [ 4.0, -4.0, 5.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "lda": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_oa.json new file mode 100644 index 000000000000..e7375ad58c46 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_oa.json @@ -0,0 +1,29 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0 ], + [ 4.0, -4.0, 5.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "strideA1": 2, + "strideA2": 1, + "offsetA": 6, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_sa1_sa2.json new file mode 100644 index 000000000000..0edb815d4aae --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_sa1_sa2.json @@ -0,0 +1,29 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 999.0, 999.0, 1.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 3.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 4.0, -4.0, 999.0, 999.0, 5.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0 ], + [ 4.0, -4.0, 5.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "strideA1": 6, + "strideA2": 2, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_sa1_sa2n.json new file mode 100644 index 000000000000..b83b332a644a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_sa1_sa2n.json @@ -0,0 +1,29 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 0.0, 999.0, 999.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 0.0, 999.0, 999.0, 999.0, 999.0, 4.0, -4.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0 ], + [ 4.0, -4.0, 5.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "strideA1": 9, + "strideA2": -3, + "offsetA": 3, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_sa1n_sa2.json new file mode 100644 index 000000000000..3a187bb9ebf8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_sa1n_sa2.json @@ -0,0 +1,29 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 4.0, -4.0, 999.0, 999.0, 5.0, 0.0, 999.0, 999.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 3.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 1.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0 ], + [ 4.0, -4.0, 5.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "strideA1": -5, + "strideA2": 2, + "offsetA": 10, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_sa1n_sa2n.json new file mode 100644 index 000000000000..6b4dc8fba5f2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_sa1n_sa2n.json @@ -0,0 +1,29 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 5.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 4.0, -4.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0 ], + [ 4.0, -4.0, 5.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "strideA1": -10, + "strideA2": -4, + "offsetA": 24, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_u.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_u.json new file mode 100644 index 000000000000..b06899c9051d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_u.json @@ -0,0 +1,30 @@ +{ + "order": "row-major", + "uplo": "upper", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 2.0, 2.0, 3.0, 0.0, 4.0, 4.0, 5.0, 0.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 0.0, 2.0, 2.0 ], + [ 3.0, 0.0, 4.0, 4.0 ], + [ 5.0, 0.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 2.0, 2.0, 0.0, 0.0 ], + [ 0.0, 0.0, 3.0, 0.0, 4.0, 4.0 ], + [ 0.0, 0.0, 0.0, 0.0, 5.0, 0.0 ] + ], + "lda": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_x_zeros.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_x_zeros.json new file mode 100644 index 000000000000..e5dad3017830 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_x_zeros.json @@ -0,0 +1,30 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0 ], + [ 4.0, -4.0, 5.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "lda": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "x": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 3.0, 0.0, 2.0, 0.0, 1.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_x_zeros_beta_one.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_x_zeros_beta_one.json new file mode 100644 index 000000000000..a05f027817c9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_x_zeros_beta_one.json @@ -0,0 +1,30 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "K": 1, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0 ], + [ 4.0, -4.0, 5.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 3.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] + ], + "lda": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "x": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 1.0, 0.0 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_xnyn.json new file mode 100644 index 000000000000..e98d0e06402d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_xnyn.json @@ -0,0 +1,32 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + "K": 2, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, 3.0, 5.0, -5.0, 7.0, 0.0, 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ], + [ 0.0, 0.0, 2.0, -2.0, 4.0, 0.0 ], + [ 3.0, 3.0, 5.0, -5.0, 7.0, 0.0 ], + [ 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, -5.0, 7.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideX": -1, + "offsetX": 3, + "beta": [ 0.5, -0.5 ], + "y": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideY": -1, + "offsetY": 3, + "y_out": [ 13.0, 72.0, -23.0, 66.0, 14.0, 49.0, 9.0, 14.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_xnyp.json new file mode 100644 index 000000000000..a360935f192f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_xnyp.json @@ -0,0 +1,32 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + "K": 2, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, 3.0, 5.0, -5.0, 7.0, 0.0, 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ], + [ 0.0, 0.0, 2.0, -2.0, 4.0, 0.0 ], + [ 3.0, 3.0, 5.0, -5.0, 7.0, 0.0 ], + [ 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, -5.0, 7.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideX": -1, + "offsetX": 3, + "beta": [ 0.5, -0.5 ], + "y": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 9.0, 14.0, 14.0, 49.0, -23.0, 66.0, 13.0, 72.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_xpyn.json new file mode 100644 index 000000000000..2528a96c4422 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_xpyn.json @@ -0,0 +1,32 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + "K": 2, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, 3.0, 5.0, -5.0, 7.0, 0.0, 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ], + [ 0.0, 0.0, 2.0, -2.0, 4.0, 0.0 ], + [ 3.0, 3.0, 5.0, -5.0, 7.0, 0.0 ], + [ 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, -5.0, 7.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideY": -1, + "offsetY": 3, + "y_out": [ 13.0, 72.0, -23.0, 66.0, 14.0, 49.0, 9.0, 14.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_xpyp.json new file mode 100644 index 000000000000..1058da20ce7e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/fixtures/row_major_xpyp.json @@ -0,0 +1,32 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + "K": 2, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, 3.0, 5.0, -5.0, 7.0, 0.0, 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ], + [ 0.0, 0.0, 2.0, -2.0, 4.0, 0.0 ], + [ 3.0, 3.0, 5.0, -5.0, 7.0, 0.0 ], + [ 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, -5.0, 7.0, 0.0, 0.0, 0.0 ], + [ 0.0, 0.0, 6.0, 6.0, 8.0, -8.0, 9.0, 0.0 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 9.0, 14.0, 14.0, 49.0, -23.0, 66.0, 13.0, 72.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/test.chbmv.js b/lib/node_modules/@stdlib/blas/base/chbmv/test/test.chbmv.js new file mode 100644 index 000000000000..b5979c1728d4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/test.chbmv.js @@ -0,0 +1,987 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var chbmv = require( './../lib/chbmv.js' ); + + +// FIXTURES // + +var cu = require( './fixtures/column_major_u.json' ); +var cl = require( './fixtures/column_major_l.json' ); +var cx = require( './fixtures/column_major_x_zeros.json' ); +var cxb = require( './fixtures/column_major_x_zeros_beta_one.json' ); +var ca = require( './fixtures/column_major_alpha_zero.json' ); +var cxnyn = require( './fixtures/column_major_xnyn.json' ); +var cxpyn = require( './fixtures/column_major_xpyn.json' ); +var cxnyp = require( './fixtures/column_major_xnyp.json' ); +var cxpyp = require( './fixtures/column_major_xpyp.json' ); +var ru = require( './fixtures/row_major_u.json' ); +var rl = require( './fixtures/row_major_l.json' ); +var rx = require( './fixtures/row_major_x_zeros.json' ); +var rxb = require( './fixtures/row_major_x_zeros_beta_one.json' ); +var ra = require( './fixtures/row_major_alpha_zero.json' ); +var rxnyn = require( './fixtures/row_major_xnyn.json' ); +var rxpyn = require( './fixtures/row_major_xpyn.json' ); +var rxnyp = require( './fixtures/row_major_xnyp.json' ); +var rxpyp = require( './fixtures/row_major_xpyp.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof chbmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 12', function test( t ) { + t.strictEqual( chbmv.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 alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + 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() { + chbmv( value, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + 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() { + chbmv( data.order, value, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + 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() { + chbmv( data.order, data.uplo, value, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + 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() { + chbmv( data.order, data.uplo, data.N, value, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid seventh argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 0, + -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() { + chbmv( data.order, data.uplo, data.N, data.K, alpha, a, value, x, data.strideX, beta, y, data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid ninth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + 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() { + chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, value, beta, y, data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid twelfth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + 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() { + chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, value ); + }; + } +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (row-major, lower)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, lower)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (row-major, upper)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ru; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, upper)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (row-major)', function test( t ) { + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (column-major)', function test( t ) { + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `N` is `0`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = chbmv( data.order, data.uplo, 0, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is `0`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = chbmv( data.order, data.uplo, 0, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxb; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxb; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ra; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ca; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rx; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cx; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxpyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxpyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxnyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxnyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxpyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxpyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying negative strides for `x` and `y` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxnyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying negative strides for `x` and `y` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxnyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/test.js b/lib/node_modules/@stdlib/blas/base/chbmv/test/test.js new file mode 100644 index 000000000000..76a57e0a51e2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 isBrowser = require( '@stdlib/assert/is-browser' ); +var chbmv = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': isBrowser +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof chbmv, '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 chbmv.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 chbmv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( chbmv, mock, 'returns native implementation' ); + 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 chbmv; + var main; + + main = require( './../lib/chbmv.js' ); + + chbmv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( chbmv, main, 'returns JavaScript implementation' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/chbmv/test/test.ndarray.js new file mode 100644 index 000000000000..ce85bd321a76 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/test/test.ndarray.js @@ -0,0 +1,1329 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var chbmv = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var cu = require( './fixtures/column_major_u.json' ); +var cl = require( './fixtures/column_major_l.json' ); +var cx = require( './fixtures/column_major_x_zeros.json' ); +var cxb = require( './fixtures/column_major_x_zeros_beta_one.json' ); +var ca = require( './fixtures/column_major_alpha_zero.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 cxnyn = require( './fixtures/column_major_xnyn.json' ); +var cxpyn = require( './fixtures/column_major_xpyn.json' ); +var cxnyp = require( './fixtures/column_major_xnyp.json' ); +var cxpyp = require( './fixtures/column_major_xpyp.json' ); +var cap = require( './fixtures/column_major_complex_access_pattern.json' ); +var ru = require( './fixtures/row_major_u.json' ); +var rx = require( './fixtures/row_major_x_zeros.json' ); +var rxb = require( './fixtures/row_major_x_zeros_beta_one.json' ); +var ra = require( './fixtures/row_major_alpha_zero.json' ); +var roa = require( './fixtures/row_major_oa.json' ); +var rl = require( './fixtures/row_major_l.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 rxpyp = require( './fixtures/row_major_xpyp.json' ); +var rxnyn = require( './fixtures/row_major_xnyn.json' ); +var rxpyn = require( './fixtures/row_major_xpyn.json' ); +var rxnyp = require( './fixtures/row_major_xnyp.json' ); +var rap = require( './fixtures/row_major_complex_access_pattern.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof chbmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 15', function test( t ) { + t.strictEqual( chbmv.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 alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + 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() { + chbmv( value, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + 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() { + chbmv( data.uplo, value, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + 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() { + chbmv( data.uplo, data.N, value, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid sixth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + 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() { + chbmv( data.uplo, data.N, data.K, alpha, a, value, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid seventh argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + 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() { + chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, value, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid tenth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + 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() { + chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, value, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourteenth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + 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() { + chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, value, data.offsetY ); + }; + } +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (row-major, lower)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, lower)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (row-major, upper)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ru; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, upper)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (row-major)', function test( t ) { + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (column-major)', function test( t ) { + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `N` is `0`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = chbmv( data.uplo, 0, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is `0`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = chbmv( data.uplo, 0, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxb; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxb; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ra; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ca; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rx; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cx; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rsa1sa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = csa1sa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rsa1nsa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = csa1nsa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rsa1sa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = csa1sa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports negative strides for `A` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rsa1nsa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports negative strides for `A` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = csa1nsa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset parameter for `A` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = roa; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset parameter for `A` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = coa; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxpyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxpyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxnyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxnyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxpyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxpyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying negative strides for `x` and `y` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxnyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying negative strides for `x` and `y` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxnyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rap; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cap; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chbmv( data.uplo, data.N, data.K, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +});