From a3a3a5cf823d96bbe49f827501b57bff31cbbb2e Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 3 May 2026 12:00:30 +0000 Subject: [PATCH 1/9] feat: add lib --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/zhbmv/lib/base.js | 229 ++++++++++++++++++ .../@stdlib/blas/base/zhbmv/lib/index.js | 78 ++++++ .../@stdlib/blas/base/zhbmv/lib/main.js | 35 +++ .../@stdlib/blas/base/zhbmv/lib/ndarray.js | 94 +++++++ .../@stdlib/blas/base/zhbmv/lib/zhbmv.js | 116 +++++++++ .../@stdlib/blas/base/zhbmv/package.json | 75 ++++++ 6 files changed, 627 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/lib/base.js create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/lib/ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/lib/zhbmv.js create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/package.json diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/zhbmv/lib/base.js new file mode 100644 index 000000000000..104cd6f40aae --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/lib/base.js @@ -0,0 +1,229 @@ +/** +* @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 zfill = require( '@stdlib/blas/ext/base/zfill' ).ndarray; +var zscal = require( '@stdlib/blas/base/zscal' ).ndarray; +var realf = require( '@stdlib/complex/float64/real' ); +var imagf = require( '@stdlib/complex/float64/imag' ); +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); +var muladd = require( '@stdlib/complex/float64/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 scalars, `x` and `y` are vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` 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 {Complex128} alpha - scalar constant +* @param {Complex128Array} A - 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 {Complex128Array} x - first input vector +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {Complex128} beta - scalar constant +* @param {Complex128Array} y - second input vector +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting index for `y` +* @returns {Complex128Array} `y` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var A = new Complex128Array( [ 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 Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex128( 0.5, 0.5 ); +* var beta = new Complex128( 0.5, -0.5 ); +* +* zhbmv( '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 zhbmv( 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 i0start; + var rebeta; + var imbeta; + var retmp1; + var imtmp1; + var retmp2; + var imtmp2; + var i0end; + var viewA; + var viewX; + var viewY; + var isrm; + var cima; + var sign; + var sa0; + var sa1; + var oa2; + var rea; + var ima; + var rex; + var imx; + var ix0; + var ix1; + var iy0; + var iy1; + var oa; + var ox; + var oy; + var sx; + var sy; + var i0; + var i1; + var ia; + + // Note on variable naming convention: sa#, ix#, i# where # corresponds to the loop number, with `0` being the innermost loop... + + isrm = isRowMajor( [ strideA1, strideA2 ] ); + if ( isrm ) { + // For row-major matrices, the last dimension has the fastest changing index... + sa0 = strideA2 * 2; // stride for innermost loop + sa1 = strideA1 * 2; // stride for outermost loop + } else { // isColMajor + // For column-major matrices, the first dimension has the fastest changing index... + sa0 = strideA1 * 2; // stride for innermost loop + sa1 = strideA2 * 2; // stride for outermost loop + } + // Decompose scalars into real and imaginary components: + rebeta = realf( beta ); + imbeta = imagf( beta ); + realpha = realf( alpha ); + imalpha = imagf( alpha ); + + // y = beta*y + if ( rebeta === 0.0 && imbeta === 0.0 ) { + zfill( N, alpha, y, strideY, offsetY ); + } else if ( rebeta !== 1.0 || imbeta !== 0.0 ) { + zscal( N, beta, y, strideY, offsetY ); + } + if ( realpha === 0.0 && imalpha === 0.0 ) { + return y; + } + // Reinterpret arrays as real-valued views of interleaved real and imaginary components: + viewA = reinterpret( A, 0 ); + viewX = reinterpret( x, 0 ); + viewY = reinterpret( y, 0 ); + if ( isrm ) { + sign = -1; + } else { + sign = 1; + } + oa = offsetA * 2; + ox = offsetX * 2; + oy = offsetY * 2; + sx = strideX * 2; + sy = strideY * 2; + oa2 = oa; + ix1 = ox; + iy1 = oy; + + // Form: y = α*A*x + y + if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { + for ( i1 = 0; i1 < N; i1++ ) { + rex = viewX[ ix1 ]; + imx = viewX[ ix1+1 ]; + retmp1 = (realpha*rex) - (imalpha*imx); + imtmp1 = (realpha*imx) + (imalpha*rex); + retmp2 = 0.0; + imtmp2 = 0.0; + ia = oa2; + rea = viewA[ ia ]; + viewY[ iy1 ] += retmp1 * rea; + viewY[ iy1+1 ] += imtmp1 * rea; + ia = oa2 + sa0; + ix0 = ix1 + sx; + iy0 = iy1 + sy; + i0end = min(N, i1+K+1); + for ( i0 = i1 + 1; i0 < i0end; i0++ ) { + rea = viewA[ ia ]; + ima = viewA[ ia+1 ]; + cima = sign * ima; + muladd( retmp1, imtmp1, rea, cima, viewY[ iy0 ], viewY[ iy0+1 ], viewY, 1, iy0 ); // eslint-disable-line max-len + rex = viewX[ ix0 ]; + imx = viewX[ ix0+1 ]; + retmp2 += (rea*rex) + (cima*imx); + imtmp2 += (rea*imx) - (cima*rex); + ia += sa0; + ix0 += sx; + iy0 += sy; + } + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy1 ], viewY[ iy1+1 ], viewY, 1, iy1 ); // eslint-disable-line max-len + ix1 += sx; + iy1 += sy; + oa2 += sa1; + } + return y; + } + // ( isrm && uplo === 'lower' ) || ( !isrm && uplo === 'upper' ) + for ( i1 = 0; i1 < N; i1++ ) { + rex = viewX[ ix1 ]; + imx = viewX[ ix1+1 ]; + retmp1 = (realpha*rex) - (imalpha*imx); + imtmp1 = (realpha*imx) + (imalpha*rex); + retmp2 = 0.0; + imtmp2 = 0.0; + i0start = max(0, i1-K); + ia = oa2 + ((K-i1+i0start)*sa0); + ix0 = ox + (i0start*sx); + iy0 = oy + (i0start*sy); + for ( i0 = i0start; i0 < i1; i0++ ) { + rea = viewA[ ia ]; + ima = viewA[ ia+1 ]; + cima = sign * ima; + muladd( retmp1, imtmp1, rea, cima, viewY[ iy0 ], viewY[ iy0+1 ], viewY, 1, iy0 ); // eslint-disable-line max-len + rex = viewX[ ix0 ]; + imx = viewX[ ix0+1 ]; + retmp2 += (rea*rex) + (cima*imx); + imtmp2 += (rea*imx) - (cima*rex); + ia += sa0; + ix0 += sx; + iy0 += sy; + } + ia = oa2 + (K*sa0); + rea = viewA[ ia ]; + viewY[ iy1 ] += retmp1 * rea; + viewY[ iy1+1 ] += imtmp1 * rea; + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy1 ], viewY[ iy1+1 ], viewY, 1, iy1 ); // eslint-disable-line max-len + ix1 += sx; + iy1 += sy; + oa2 += sa1; + } + return y; +} + + +// EXPORTS // + +module.exports = zhbmv; diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/zhbmv/lib/index.js new file mode 100644 index 000000000000..9a6a3e5ae784 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/lib/index.js @@ -0,0 +1,78 @@ +/** +* @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 scalars, `x` and `y` are vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` super-diagonals. +* +* @module @stdlib/blas/base/zhbmv +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* var zhbmv = require( '@stdlib/blas/base/zhbmv' ); +* +* var A = new Complex128Array( [ 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 Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex128( 0.5, 0.5 ); +* var beta = new Complex128( 0.5, -0.5 ); +* +* zhbmv( '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 Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* var zhbmv = require( '@stdlib/blas/base/zhbmv' ); +* +* var A = new Complex128Array( [ 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 Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex128( 0.5, 0.5 ); +* var beta = new Complex128( 0.5, -0.5 ); +* +* zhbmv.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 zhbmv; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + zhbmv = main; +} else { + zhbmv = tmp; +} + + +// EXPORTS // + +module.exports = zhbmv; + +// exports: { "ndarray": "zhbmv.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/lib/main.js b/lib/node_modules/@stdlib/blas/base/zhbmv/lib/main.js new file mode 100644 index 000000000000..ea8e68de7022 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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 zhbmv = require( './zhbmv.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( zhbmv, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = zhbmv; diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/zhbmv/lib/ndarray.js new file mode 100644 index 000000000000..d04d66b3344c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/lib/ndarray.js @@ -0,0 +1,94 @@ +/** +* @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 base = require( './base.js' ); + + +// MAIN // + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` 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 {Complex128} alpha - complex scalar constant +* @param {Complex128Array} 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 {Complex128Array} x - first complex input vector +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {Complex128} beta - complex scalar constant +* @param {Complex128Array} 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} third argument must be a nonnegative integer +* @throws {RangeError} tenth argument must be non-zero +* @throws {RangeError} fourteenth argument must be non-zero +* @returns {Complex128Array} `y` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var A = new Complex128Array( [ 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 Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex128( 0.5, 0.5 ); +* var beta = new Complex128( 0.5, -0.5 ); +* +* zhbmv( '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 zhbmv( uplo, N, K, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( 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 ( 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 ) ); + } + // Check if we can early return... + if ( N === 0 ) { + return y; + } + return base( uplo, N, K, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ); +} + + +// EXPORTS // + +module.exports = zhbmv; diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/lib/zhbmv.js b/lib/node_modules/@stdlib/blas/base/zhbmv/lib/zhbmv.js new file mode 100644 index 000000000000..55a1dca95b8d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/lib/zhbmv.js @@ -0,0 +1,116 @@ +/** +* @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 format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` 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 {Complex128} alpha - scalar constant +* @param {Complex128Array} A - input matrix +* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Complex128Array} x - first input vector +* @param {integer} strideX - `x` stride length +* @param {Complex128} beta - scalar constant +* @param {Complex128Array} y - second 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} fourth 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 {Complex128Array} `y` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var A = new Complex128Array( [ 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 Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex128( 0.5, 0.5 ); +* var beta = new Complex128( 0.5, -0.5 ); +* +* zhbmv( '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 zhbmv( order, uplo, N, K, alpha, A, LDA, x, strideX, beta, y, strideY ) { // eslint-disable-line max-params + 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 ) ); + } + // Check if we can early return... + if ( N === 0 ) { + 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 = zhbmv; diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/package.json b/lib/node_modules/@stdlib/blas/base/zhbmv/package.json new file mode 100644 index 000000000000..df225912b6da --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/package.json @@ -0,0 +1,75 @@ +{ + "name": "@stdlib/blas/base/zhbmv", + "version": "0.0.0", + "description": "Performs the matrix-vector operation `y = α*A*x + β*y`.", + "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", + "zhbmv", + "hermitian", + "band", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "complex", + "complex128", + "complex128array", + "float", + "float64", + "single", + "float64array" + ] +} From fc1d51b0f02bb1d90f3edba100e7f759c8a9e212 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 3 May 2026 12:04:37 +0000 Subject: [PATCH 2/9] test: add test suites --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../fixtures/column_major_alpha_zero.json | 29 + .../column_major_complex_access_pattern.json | 29 + .../zhbmv/test/fixtures/column_major_l.json | 29 + .../zhbmv/test/fixtures/column_major_oa.json | 29 + .../test/fixtures/column_major_sa1_sa2.json | 28 + .../test/fixtures/column_major_sa1_sa2n.json | 28 + .../test/fixtures/column_major_sa1n_sa2.json | 28 + .../test/fixtures/column_major_sa1n_sa2n.json | 28 + .../zhbmv/test/fixtures/column_major_u.json | 29 + .../test/fixtures/column_major_x_zeros.json | 29 + .../column_major_x_zeros_beta_one.json | 29 + .../test/fixtures/column_major_xnyn.json | 31 + .../test/fixtures/column_major_xnyp.json | 31 + .../test/fixtures/column_major_xpyn.json | 31 + .../test/fixtures/column_major_xpyp.json | 31 + .../test/fixtures/row_major_alpha_zero.json | 30 + .../row_major_complex_access_pattern.json | 29 + .../base/zhbmv/test/fixtures/row_major_l.json | 30 + .../zhbmv/test/fixtures/row_major_oa.json | 29 + .../test/fixtures/row_major_sa1_sa2.json | 29 + .../test/fixtures/row_major_sa1_sa2n.json | 29 + .../test/fixtures/row_major_sa1n_sa2.json | 29 + .../test/fixtures/row_major_sa1n_sa2n.json | 29 + .../base/zhbmv/test/fixtures/row_major_u.json | 30 + .../test/fixtures/row_major_x_zeros.json | 30 + .../fixtures/row_major_x_zeros_beta_one.json | 30 + .../zhbmv/test/fixtures/row_major_xnyn.json | 32 + .../zhbmv/test/fixtures/row_major_xnyp.json | 32 + .../zhbmv/test/fixtures/row_major_xpyn.json | 32 + .../zhbmv/test/fixtures/row_major_xpyp.json | 32 + .../@stdlib/blas/base/zhbmv/test/test.js | 82 + .../blas/base/zhbmv/test/test.ndarray.js | 1313 +++++++++++++++++ .../blas/base/zhbmv/test/test.zhbmv.js | 1041 +++++++++++++ 33 files changed, 3327 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_alpha_zero.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_l.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_x_zeros.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_x_zeros_beta_one.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_xnyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_xnyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_xpyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_xpyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_alpha_zero.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_l.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_x_zeros.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_x_zeros_beta_one.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_xnyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_xnyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_xpyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_xpyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/test.js create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/test.ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/test/test.zhbmv.js diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_alpha_zero.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_alpha_zero.json new file mode 100644 index 000000000000..44856891862c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 000000000000..10383bb0f6ac --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/column_major_l.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_l.json new file mode 100644 index 000000000000..5cfab2abce43 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_oa.json new file mode 100644 index 000000000000..917668b2142c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_sa1_sa2.json new file mode 100644 index 000000000000..d7e7beb38c57 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_sa1_sa2n.json new file mode 100644 index 000000000000..b5b85f02d6f8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_sa1n_sa2.json new file mode 100644 index 000000000000..f2b504bd3a76 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_sa1n_sa2n.json new file mode 100644 index 000000000000..311a3945a608 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/column_major_u.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_u.json new file mode 100644 index 000000000000..0dcedb73fd33 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/column_major_x_zeros.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_x_zeros.json new file mode 100644 index 000000000000..d46d3fec7ec7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/column_major_x_zeros_beta_one.json b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/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/zhbmv/test/fixtures/column_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_xnyn.json new file mode 100644 index 000000000000..6c68b2c0b30e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/column_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_xnyp.json new file mode 100644 index 000000000000..61d06e9cb8ac --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/column_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_xpyn.json new file mode 100644 index 000000000000..19299f10b67b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/column_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/column_major_xpyp.json new file mode 100644 index 000000000000..531d06996920 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/row_major_alpha_zero.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_alpha_zero.json new file mode 100644 index 000000000000..d166f94ada81 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 000000000000..c6589df2a7e9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/row_major_l.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_l.json new file mode 100644 index 000000000000..f69dcf3c44f5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_oa.json new file mode 100644 index 000000000000..e7375ad58c46 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_sa1_sa2.json new file mode 100644 index 000000000000..0edb815d4aae --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_sa1_sa2n.json new file mode 100644 index 000000000000..b83b332a644a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_sa1n_sa2.json new file mode 100644 index 000000000000..3a187bb9ebf8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_sa1n_sa2n.json new file mode 100644 index 000000000000..6b4dc8fba5f2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/row_major_u.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_u.json new file mode 100644 index 000000000000..b06899c9051d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/row_major_x_zeros.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_x_zeros.json new file mode 100644 index 000000000000..e5dad3017830 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/row_major_x_zeros_beta_one.json b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/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/zhbmv/test/fixtures/row_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_xnyn.json new file mode 100644 index 000000000000..e98d0e06402d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/row_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_xnyp.json new file mode 100644 index 000000000000..a360935f192f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/row_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_xpyn.json new file mode 100644 index 000000000000..2528a96c4422 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/fixtures/row_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/zhbmv/test/fixtures/row_major_xpyp.json new file mode 100644 index 000000000000..1058da20ce7e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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/zhbmv/test/test.js b/lib/node_modules/@stdlib/blas/base/zhbmv/test/test.js new file mode 100644 index 000000000000..7a3419ea4aee --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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 zhbmv = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': isBrowser +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof zhbmv, '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 zhbmv.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 zhbmv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( zhbmv, 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 zhbmv; + var main; + + main = require( './../lib/zhbmv.js' ); + + zhbmv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( zhbmv, main, 'returns JavaScript implementation' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/zhbmv/test/test.ndarray.js new file mode 100644 index 000000000000..f77796e4cc1b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/test/test.ndarray.js @@ -0,0 +1,1313 @@ +/** +* @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 isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var zhbmv = 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 zhbmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 15', function test( t ) { + t.strictEqual( zhbmv.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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( 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() { + zhbmv( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( 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() { + zhbmv( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( 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() { + zhbmv( 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 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( 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() { + zhbmv( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( 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() { + zhbmv( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( 0.0, 0.0 ); + beta = new Complex128( 1.0, 0.0 ); + + expected = new Complex128Array( data.y ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( 0.0, 0.0 ); + beta = new Complex128( 1.0, 0.0 ); + + expected = new Complex128Array( data.y ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `0`, the function zeros the second input vector (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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( 0.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + expected = new Complex128Array( y.length ); + + out = zhbmv( 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( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `0`, the function zeros the second input vector (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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( 0.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + expected = new Complex128Array( y.length ); + + out = zhbmv( 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( isSameComplex128Array( 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 (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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( 0.0, 0.0 ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( 0.0, 0.0 ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( 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( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/test/test.zhbmv.js b/lib/node_modules/@stdlib/blas/base/zhbmv/test/test.zhbmv.js new file mode 100644 index 000000000000..099d4cc78793 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/test/test.zhbmv.js @@ -0,0 +1,1041 @@ +/** +* @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 isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var zhbmv = require( './../lib/zhbmv.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 zhbmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 12', function test( t ) { + t.strictEqual( zhbmv.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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( 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() { + zhbmv( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( 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() { + zhbmv( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( 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() { + zhbmv( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( 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() { + zhbmv( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( 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() { + zhbmv( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( 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() { + zhbmv( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( 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() { + zhbmv( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y ); + + out = zhbmv( data.order, data.uplo, 0, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y ); + + out = zhbmv( data.order, data.uplo, 0, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( 0.0, 0.0 ); + beta = new Complex128( 1.0, 0.0 ); + + expected = new Complex128Array( data.y ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( 0.0, 0.0 ); + beta = new Complex128( 1.0, 0.0 ); + + expected = new Complex128Array( data.y ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `0`, the function zeros the second input vector (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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( 0.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + expected = new Complex128Array( y.length ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `0`, the function zeros the second input vector (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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( 0.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + expected = new Complex128Array( y.length ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex128Array( 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 (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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( 0.0, 0.0 ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( 0.0, 0.0 ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( 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 Complex128Array( data.A ); + x = new Complex128Array( data.x ); + y = new Complex128Array( data.y ); + + alpha = new Complex128( data.alpha[0], data.alpha[1] ); + beta = new Complex128( data.beta[0], data.beta[1] ); + + expected = new Complex128Array( data.y_out ); + + out = zhbmv( data.order, data.uplo, data.N, data.K, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); From 485e8255deac1294cd8b334a14ca591a642092d8 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 3 May 2026 12:05:57 +0000 Subject: [PATCH 3/9] docs: add types and types tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../blas/base/zhbmv/docs/types/index.d.ts | 147 +++++ .../blas/base/zhbmv/docs/types/test.ts | 580 ++++++++++++++++++ 2 files changed, 727 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/docs/types/test.ts diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/zhbmv/docs/types/index.d.ts new file mode 100644 index 000000000000..34e6ea321e90 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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 { Complex128Array } from '@stdlib/types/array'; +import { Layout, MatrixTriangle } from '@stdlib/types/blas'; +import { Complex128 } from '@stdlib/types/complex'; + +/** +* Interface describing `zhbmv`. +*/ +interface Routine { + /** + * Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` 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 - scalar constant + * @param A - input matrix + * @param LDA - stride of the first dimension of `A` + * @param x - first input vector + * @param strideX - `x` stride length + * @param beta - scalar constant + * @param y - second input vector + * @param strideY - `y` stride length + * @returns `y` + * + * @example + * var Complex128Array = require( '@stdlib/array/complex128' ); + * var Complex128 = require( '@stdlib/complex/float64/ctor' ); + * + * var A = new Complex128Array( [ 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 Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); + * var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); + * var alpha = new Complex128( 0.5, 0.5 ); + * var beta = new Complex128( 0.5, -0.5 ); + * + * zhbmv( '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: Complex128, A: Complex128Array, LDA: number, x: Complex128Array, strideX: number, beta: Complex128, y: Complex128Array, strideY: number ): Complex128Array; + + /** + * Performs the matrix-vector operation `y = α*A*x + β*y`, using alternative indexing semantics and where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` super-diagonals. + * + * @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 - scalar constant + * @param A - 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 input vector + * @param strideX - `x` stride length + * @param offsetX - starting index for `x` + * @param beta - scalar constant + * @param y - second input vector + * @param strideY - `y` stride length + * @param offsetY - starting index for `y` + * @returns `y` + * + * @example + * var Complex128Array = require( '@stdlib/array/complex128' ); + * var Complex128 = require( '@stdlib/complex/float64/ctor' ); + * + * var A = new Complex128Array( [ 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 Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); + * var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); + * var alpha = new Complex128( 0.5, 0.5 ); + * var beta = new Complex128( 0.5, -0.5 ); + * + * zhbmv.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: Complex128, A: Complex128Array, strideA1: number, strideA2: number, offsetA: number, x: Complex128Array, strideX: number, offsetX: number, beta: Complex128, y: Complex128Array, strideY: number, offsetY: number ): Complex128Array; +} + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` 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 - scalar constant +* @param A - input matrix +* @param LDA - stride of the first dimension of `A` +* @param x - first input vector +* @param strideX - `x` stride length +* @param beta - scalar constant +* @param y - second input vector +* @param strideY - `y` stride length +* @returns `y` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var A = new Complex128Array( [ 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 Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex128( 0.5, 0.5 ); +* var beta = new Complex128( 0.5, -0.5 ); +* +* zhbmv( '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 Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var A = new Complex128Array( [ 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 Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex128( 0.5, 0.5 ); +* var beta = new Complex128( 0.5, -0.5 ); +* +* zhbmv.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 zhbmv: Routine; + + +// EXPORTS // + +export = zhbmv; diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/zhbmv/docs/types/test.ts new file mode 100644 index 000000000000..d2e78b79bde9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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 Complex128Array = require( '@stdlib/array/complex128' ); +import Complex128 = require( '@stdlib/complex/float64/ctor' ); +import zhbmv = require( './index' ); + + +// TESTS // + +// The function returns a Complex128Array... +{ + const x = new Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 1.0, 0.0 ); + const beta = new Complex128( 1.0, 0.0 ); + + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectType Complex128Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv( 10, 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( true, 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( false, 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( null, 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( undefined, 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( [], 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( {}, 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( ( 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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv( 'row-major', 10, 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', true, 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', false, 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', null, 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', undefined, 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', [], 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', {}, 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( '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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv( 'row-major', 'lower', '10', 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', true, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', false, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', null, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', undefined, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', [], 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', {}, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( '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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv( 'row-major', 'lower', 10, '10', alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, true, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, false, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, null, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, undefined, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, [], alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, {}, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( '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 Complex128... +{ + const x = new Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv( 'row-major', 'lower', 10, 10, '10', A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, true, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, false, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, null, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, undefined, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, [], A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, {}, A, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( '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 Complex128Array... +{ + const x = new Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv( 'row-major', 'lower', 10, 10, alpha, 10, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, '10', 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, true, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, false, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, null, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, undefined, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, [ '1' ], 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, {}, 10, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( '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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, '10', x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, true, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, false, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, null, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, undefined, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, [], x, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, {}, x, 1, beta, y, 1 ); // $ExpectError + zhbmv( '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 Complex128Array... +{ + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, 10, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, '10', 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, true, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, false, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, null, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, undefined, 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, [ '1' ], 1, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, {}, 1, beta, y, 1 ); // $ExpectError + zhbmv( '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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, '10', beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, true, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, false, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, null, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, undefined, beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, [], beta, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, {}, beta, y, 1 ); // $ExpectError + zhbmv( '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 Complex128... +{ + const x = new Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, '10', y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, true, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, false, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, null, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, undefined, y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, [], y, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, {}, y, 1 ); // $ExpectError + zhbmv( '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 Complex128Array... +{ + const x = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, 10, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, '10', 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, true, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, false, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, null, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, undefined, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, [], 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, {}, 1 ); // $ExpectError + zhbmv( '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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, '10' ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, true ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, false ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, null ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, undefined ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, [] ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y, {} ); // $ExpectError + zhbmv( '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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv(); // $ExpectError + zhbmv( 'row-major' ); // $ExpectError + zhbmv( 'row-major', 'lower' ); // $ExpectError + zhbmv( 'row-major', 'lower', 10 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1 ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta ); // $ExpectError + zhbmv( 'row-major', 'lower', 10, 10, alpha, A, 10, x, 1, beta, y ); // $ExpectError + zhbmv( '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 Complex128Array... +{ + const x = new Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectType Complex128Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 10, 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( true, 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( false, 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( null, 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( undefined, 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( [ '1' ], 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( {}, 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 'lower', '10', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', true, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', false, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', null, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', undefined, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', [], 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', {}, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 'lower', 10, '10', alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, true, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, false, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, null, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, undefined, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, [], alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, {}, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.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 Complex128... +{ + const x = new Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 'lower', 10, 10, '10', A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, 10, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, true, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, false, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, null, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, undefined, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, [], A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, {}, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.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 Complex128Array... +{ + const x = new Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 'lower', 10, 10, alpha, 10, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, '10', 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, true, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, false, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, null, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, undefined, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, [], 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, {}, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 'lower', 10, 10, alpha, A, '10', 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, true, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, false, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, null, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, undefined, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, [], 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, {}, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, '10', 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, true, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, false, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, null, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, undefined, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, [], 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, {}, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, '10', x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, true, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, false, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, null, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, undefined, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, [], x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, {}, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.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 Complex128Array... +{ + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, 10, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, '10', 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, true, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, false, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, null, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, undefined, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, [], 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, {}, 1, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, '10', 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, true, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, false, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, null, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, undefined, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, [], 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, {}, 0, beta, y, 1, 0 ); // $ExpectError + zhbmv.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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, '10', beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, true, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, false, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, null, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, undefined, beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, [], beta, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, {}, beta, y, 1, 0 ); // $ExpectError + zhbmv.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 Complex128... +{ + const x = new Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, '10', y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, 10, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, true, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, false, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, null, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, undefined, y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, [], y, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, {}, y, 1, 0 ); // $ExpectError + zhbmv.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 Complex128Array... +{ + const x = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, 10, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, '10', 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, true, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, false, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, null, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, undefined, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, [], 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, {}, 1, 0 ); // $ExpectError + zhbmv.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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, '10', 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, true, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, false, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, null, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, undefined, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, [], 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, {}, 0 ); // $ExpectError + zhbmv.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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, '10' ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, true ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, false ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, null ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, undefined ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, [] ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, {} ); // $ExpectError + zhbmv.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 Complex128Array( 10 ); + const y = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + const alpha = new Complex128( 0.5, 0.5 ); + const beta = new Complex128( 0.5, -0.5 ); + + zhbmv.ndarray(); // $ExpectError + zhbmv.ndarray( 'lower' ); // $ExpectError + zhbmv.ndarray( 'lower', 10 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1 ); // $ExpectError + zhbmv.ndarray( 'lower', 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0, 10 ); // $ExpectError +} From 837171fd467476ffd4987b4ee969de3385b46715 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 3 May 2026 12:06:25 +0000 Subject: [PATCH 4/9] docs: add repl file --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/zhbmv/docs/repl.txt | 189 ++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/docs/repl.txt diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/zhbmv/docs/repl.txt new file mode 100644 index 000000000000..ebd2fdfa7cf2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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 scalars, `x` and `y` are vectors, and `A` is an `N` by `N` Hermitian + band matrix with `K` super-diagonals. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `N` is equal to `0`, the function returns `y` unchanged. + + If `α` equals `0 + 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`. + + α: Complex128 + Scalar constant. + + A: Complex128Array + Input matrix. + + lda: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + x: Complex128Array + First input vector. + + sx: integer + Index increment for `x`. + + β: Complex128 + Scalar constant. + + y: Complex128Array + Second input vector. + + sy: integer + Index increment for `y`. + + Returns + ------- + y: Complex128Array + Second input vector. + + Examples + -------- + // Standard usage: + > var x = new {{alias:@stdlib/array/complex128}}([1.0,1.0,2.0,2.0,3.0,3.0]); + > var y = new {{alias:@stdlib/array/complex128}}([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/complex128}}( buf ); + > var alpha = new {{alias:@stdlib/complex/float64/ctor}}(0.5,0.5); + > var beta = new {{alias:@stdlib/complex/float64/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/complex128}}([3.0,3.0,2.0,2.0,1.0,1.0]); + > y = new {{alias:@stdlib/array/complex128}}([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/complex128}}( buf ); + > alpha = new {{alias:@stdlib/complex/float64/ctor}}(0.5,0.5); + > beta = new {{alias:@stdlib/complex/float64/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/complex128}}( 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/complex128}}( y0buf ); + > var x0bytes = x0.BYTES_PER_ELEMENT*1; + > var x1 = new {{alias:@stdlib/array/complex128}}( x0.buffer, x0bytes ); + > var y0bytes = y0.BYTES_PER_ELEMENT*1; + > var y1 = new {{alias:@stdlib/array/complex128}}( 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/complex128}}( buf ); + > alpha = new {{alias:@stdlib/complex/float64/ctor}}(0.5,0.5); + > beta = new {{alias:@stdlib/complex/float64/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 scalars, `x` and `y` are + vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` + super-diagonals. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameters support indexing semantics based on starting + indices. + + Parameters + ---------- + uplo: string + Specifies whether the upper or lower triangular matrix of `A` is + supplied. Must be either 'upper' or 'lower'. + + N: integer + Number of columns in `A`. + + K: integer + Number of super-diagonals or sub-diagonals of matrix `A`. + + α: Complex128 + Scalar constant. + + A: Complex128Array + 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: Complex128Array + First input vector. + + sx: integer + Index increment for `x`. + + ox: integer + Starting index (offset) for `x`. + + β: Complex128 + Scalar constant. + + y: Complex128Array + Second input vector. + + sy: integer + Index increment for `y`. + + oy: integer + Starting index (offset) for `y`. + + Returns + ------- + y: Complex128Array + Second input vector. + + Examples + -------- + > x = new {{alias:@stdlib/array/complex128}}([1.0,1.0,2.0,2.0,3.0,3.0]); + > y = new {{alias:@stdlib/array/complex128}}([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/complex128}}( buf ); + > alpha = new {{alias:@stdlib/complex/float64/ctor}}(0.5,0.5); + > beta = new {{alias:@stdlib/complex/float64/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 + -------- From c63a93be4db2a64630fb6e15733ba9cff35c19c0 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 3 May 2026 12:07:35 +0000 Subject: [PATCH 5/9] bench: add benchmarks --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/zhbmv/benchmark/benchmark.js | 127 ++++++++++++++++++ .../base/zhbmv/benchmark/benchmark.ndarray.js | 127 ++++++++++++++++++ 2 files changed, 254 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/benchmark/benchmark.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/zhbmv/benchmark/benchmark.js new file mode 100644 index 000000000000..23b7d59ee912 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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 Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var zhbmv = require( './../lib/zhbmv.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// 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 Complex128Array( xbuf.buffer ); + ybuf = uniform( N*2, -100.0, 100.0, options ); + y = new Complex128Array( ybuf.buffer ); + Abuf = uniform( (N*(K+1))*2, -100.0, 100.0, options ); + A = new Complex128Array( Abuf.buffer ); + + alpha = new Complex128( 0.5, 0.5 ); + beta = new Complex128( 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 = zhbmv( '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/zhbmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/zhbmv/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..ed99d70c9235 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/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 Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var chgmv = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// 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 Complex128Array( xbuf.buffer ); + ybuf = uniform( N*2, -100.0, 100.0, options ); + y = new Complex128Array( ybuf.buffer ); + Abuf = uniform( (N*(K+1))*2, -100.0, 100.0, options ); + A = new Complex128Array( Abuf.buffer ); + + alpha = new Complex128( 0.5, 0.5 ); + beta = new Complex128( 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(); From 5c845b14cb137e3a7a0cbdd5a9b1c2f0f6a7b0f1 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 3 May 2026 12:08:20 +0000 Subject: [PATCH 6/9] docs: add example --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/zhbmv/examples/index.js | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/examples/index.js diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/zhbmv/examples/index.js new file mode 100644 index 000000000000..f78c84202302 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/examples/index.js @@ -0,0 +1,49 @@ +/** +* @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 Complex128 = require( '@stdlib/complex/float64/ctor' ); +var logEach = require( '@stdlib/console/log-each' ); +var chgmv = require( './../lib' ); + +function rand() { + return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); +} + +var N = 3; +var K = 1; + +var x = filledarrayBy( N, 'complex128', rand ); +var y = filledarrayBy( N, 'complex128', rand ); +var A = filledarrayBy( N*(K+1), 'complex128', rand ); + +var alpha = new Complex128( 2.0, 3.0 ); +var beta = new Complex128( 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 ); From 90ce93649aba6a90ac823a1953a034d3375ddb21 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 3 May 2026 12:08:37 +0000 Subject: [PATCH 7/9] docs: add readme --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/zhbmv/README.md | 314 ++++++++++++++++++ 1 file changed, 314 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/zhbmv/README.md diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/README.md b/lib/node_modules/@stdlib/blas/base/zhbmv/README.md new file mode 100644 index 000000000000..e26e6cae5d07 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/README.md @@ -0,0 +1,314 @@ + + +# zhbmv + +> Performs the matrix-vector operation `y = α*A*x + β*y`. + +
+ +## Usage + +```javascript +var zhbmv = require( '@stdlib/blas/base/zhbmv' ); +``` + +#### zhbmv( order, uplo, N, K, α, A, LDA, x, sx, β, y, sy ) + +Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` super-diagonals. + + + +```javascript +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); + +var A = new Complex128Array( [ 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 Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); + +var alpha = new Complex128( 0.5, 0.5 ); +var beta = new Complex128( 0.5, -0.5 ); + +zhbmv( '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`. +- **α**: scalar constant. +- **A**: input matrix stored in linear memory as a [`Complex128Array`][@stdlib/array/complex128]. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **x**: input vector [`Complex128Array`][@stdlib/array/complex128]. +- **sx**: stride length for `x`. +- **β**: scalar constant. +- **y**: output [`Complex128Array`][@stdlib/array/complex128]. +- **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 Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); + +var A = new Complex128Array( [ 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 Complex128Array( [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0 ] ); +var y = new Complex128Array( [ 3.0, 3.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0 ] ); + +var alpha = new Complex128( 0.5, 0.5 ); +var beta = new Complex128( 0.5, -0.5 ); + +zhbmv( 'row-major', 'lower', 3, 1, alpha, A, 2, x, 2, 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 Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); + +// Initial arrays... +var x0 = new Complex128Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +var y0 = new Complex128Array( [ 0.0, 0.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +var A = new Complex128Array( [ 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 alpha = new Complex128( 0.5, 0.5 ); +var beta = new Complex128( 0.5, -0.5 ); + +// Create offset views... +var x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd complex element +var y1 = new Complex128Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd complex element + +zhbmv( '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 ] +``` + + + +#### zhbmv.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 scalars, `x` and `y` are vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` super-diagonals. + + + +```javascript +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); + +var A = new Complex128Array( [ 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 Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +var y = new Complex128Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); + +var alpha = new Complex128( 0.5, 0.5 ); +var beta = new Complex128( 0.5, -0.5 ); + +zhbmv.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 Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); + +var A = new Complex128Array( [ 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 Complex128Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +var y = new Complex128Array( [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0 ] ); + +var alpha = new Complex128( 0.5, 0.5 ); +var beta = new Complex128( 0.5, -0.5 ); + +zhbmv.ndarray( 'lower', 3, 1, alpha, A, 2, 1, 0, x, 1, 1, beta, y, -2, 4 ); +// y => [ 9.0, 23.0, 0.0, 0.0, -8.0, 20.0, 0.0, 0.0, -1.0, 5.0 ] +``` + +
+ + + +
+ +## Notes + +- `zhbmv()` corresponds to the [BLAS][blas] level 2 function [`zhbmv`][zhbmv]. + +
+ + + +
+ +## Examples + + + + + +```javascript +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var logEach = require( '@stdlib/console/log-each' ); +var zhbmv = require( '@stdlib/blas/base/zhbmv' ); + +function rand() { + return new Complex128( discreteUniform( 0, 255 ), discreteUniform( -128, 127 ) ); +} + +var N = 3; +var K = 1; + +var A = filledarrayBy( N*(K+1), 'complex128', rand ); +var x = filledarrayBy( N, 'complex128', rand ); +var y = filledarrayBy( N, 'complex128', rand ); + +var alpha = new Complex128( 0.5, 0.5 ); +var beta = new Complex128( 0.5, -0.5 ); + +zhbmv( 'row-major', 'lower', N, 1, alpha, A, (K+1), x, 1, beta, y, 1 ); + +// Print the results: +logEach( '%s', x ); + +zhbmv.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 +``` + +
+ + + +
+ + + + + + + + + + + + + + From 1fba17133481d6f1bace0816358f10f6cb65a537 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 3 May 2026 12:09:51 +0000 Subject: [PATCH 8/9] fix: update link --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/zhbmv/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/README.md b/lib/node_modules/@stdlib/blas/base/zhbmv/README.md index e26e6cae5d07..0b21121fdce5 100644 --- a/lib/node_modules/@stdlib/blas/base/zhbmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/README.md @@ -303,7 +303,7 @@ TODO [blas]: http://www.netlib.org/blas -[zhbmv]: https://www.netlib.org/lapack/explore-html/da/dd4/group__hbmv_gaf3753b609f411bbc719b8de9f9606e12.html#gaf3753b609f411bbc719b8de9f9606e12 +[zhbmv]: https://netlib.org/lapack/explore-html//da/dd4/group__hbmv_ga694b0528a7854e8d4a02fc5d2b646d2c.html [mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray From 7d4ee420b67f070bcd16f29cbf2284e196a33617 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 3 May 2026 12:12:22 +0000 Subject: [PATCH 9/9] chore: update keywords --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/zhbmv/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zhbmv/package.json b/lib/node_modules/@stdlib/blas/base/zhbmv/package.json index df225912b6da..067b0866a67d 100644 --- a/lib/node_modules/@stdlib/blas/base/zhbmv/package.json +++ b/lib/node_modules/@stdlib/blas/base/zhbmv/package.json @@ -69,7 +69,7 @@ "complex128array", "float", "float64", - "single", + "double", "float64array" ] }