From a820134c1ced08dd428d3003abbc0a673013a599 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 29 Mar 2026 14:13:34 +0000 Subject: [PATCH 01/33] feat: chpmv base setup --- .../@stdlib/blas/base/chpmv/lib/base.js | 177 ++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js new file mode 100644 index 000000000000..85ff2896afb7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js @@ -0,0 +1,177 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var cfill = require( '@stdlib/blas/ext/base/cfill' ).ndarray; +var cscal = require( '@stdlib/blas/base/cscal' ).ndarray; +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var muladd = require( '@stdlib/complex/float32/base/mul-add' ).assign; + + +// MAIN // + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix, supplied in packed form `AP`. +* +* @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 {Complex64} alpha - complex scalar constant +* @param {Complex64Array} AP - complex input matrix +* @param {integer} strideAP - `AP` stride length +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Complex64Array} x - first complex input vector +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {Complex64} beta - complex scalar constant +* @param {Complex64Array} y - second complex input vector +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting index for `y` +* @returns {Complex64Array} `y` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var A = new Complex64Array( [ ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chpmv( 'lower', 3, alpha, A, 0, 0, x, 1, 0, beta, y, 1, 0 ); +* // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +*/ +function chpmv( uplo, N, alpha, AP, strideAP, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len + var realpha; + var imalpha; + var rebeta; + var imbeta; + var retmp1; + var imtmp1; + var retmp2; + var imtmp2; + var viewAP; + var viewX; + var viewY; + var isrm; + var cima; + var sign; + var sap; + var oa2; + var reap; + var imap; + var rex; + var imx; + var kk; + var ix; + var iy; + var oa; + var ox; + var oy; + var sx; + var sy; + var i0; + var i1; + var iap; + var k; + + // Decompose scalars + rebeta = realf( beta ); + imbeta = imagf( beta ); + realpha = realf( alpha ); + imalpha = imagf( alpha ); + + // y = beta*y + if ( rebeta === 0.0 && imbeta === 0.0 ) { + cfill( N, 0.0, y, strideY, offsetY ); + } else if ( rebeta !== 1.0 || imbeta !== 0.0 ) { + cscal( N, beta, y, strideY, offsetY ); + } + + // If alpha is zero, early return y + if ( realpha === 0.0 && imalpha === 0.0 ) { + return y; + } + + // Reinterpret arrays to raw numeric views + viewAP = reinterpret( AP, 0 ); + viewX = reinterpret( x, 0 ); + viewY = reinterpret( y, 0 ); + + // Adjust sign to account for layout-dependent conjugation + if ( isrm ) { + sign = -1; + } else { + sign = 1; + } + + // Vector indexing base + oa = offsetA * 2; + ox = offsetX * 2; + oy = offsetY * 2; + + // Vector strides + sap = strideAP * 2; + sx = strideX * 2; + sy = strideY * 2; + + kk = 0; + + if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { + for ( i1 = 0; i1 < N; i1++ ) { + ix = ox + ( i1 * sx ); + rex = viewX[ ix ]; + imx = viewX[ ix + 1 ]; + retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); + imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); + retmp2 = 0.0; + imtmp2 = 0.0; + // oa2 = oa + ( i1 * sa1 ); + iap = oa + ( kk * sap ); + reap = viewAP[ iap ]; + iy = oy + ( i1 * sy ); + viewY[ iy ] += f32( retmp1 * reap ); + viewY[ iy + 1 ] += f32( imtmp1 * reap ); + k = kk + 1; + for ( i0 = i1 + 1; i0 < N; i0++ ) { + iap = oa + ( k * sap ); + reap = viewAP[ iap ]; + imap = viewAP[ iap + 1 ]; + iy = oy + ( i0 * sy ); + muladd( retmp1, imtmp1, reap, imap, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len + ix = ox + ( i0 * sx ); + rex = viewX[ ix ]; + imx = viewX[ ix + 1 ]; + retmp2 += f32( ( reap * rex ) + ( imap * imx ) ); + imtmp2 += f32( ( reap * imx ) - ( imap * rex ) ); + k += 1; + } + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len + kk += ( N - i1 ); + } + return y; + } +} \ No newline at end of file From c01c03409d38bad178f8910a0ff85296e1dbd38e Mon Sep 17 00:00:00 2001 From: Divit Date: Wed, 1 Apr 2026 13:38:58 +0000 Subject: [PATCH 02/33] update --- .../@stdlib/blas/base/chbmv/lib/base.js | 230 ++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js new file mode 100644 index 000000000000..4095ef27afda --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js @@ -0,0 +1,230 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var cfill = require( '@stdlib/blas/ext/base/cfill' ).ndarray; +var cscal = require( '@stdlib/blas/base/cscal' ).ndarray; +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var muladd = require( '@stdlib/complex/float32/base/mul-add' ).assign; +var max = require( '@stdlib/math/base/special/max' ); +var min = require( '@stdlib/math/base/special/min' ); + + +// MAIN // + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are complex vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` sub-diagonals or super-diagonals. +* +* @private +* @param {string} uplo - specifies whether `A` is an upper or lower triangular part of matrix is supplied. +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {NonNegativeInteger} K - number of super-diagonals or sub-diagonals of matrix `A`. +* @param {Complex64} alpha - complex scalar constant +* @param {Complex64Array} A - complex input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Complex64Array} x - first complex input vector +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {Complex64} beta - complex scalar constant +* @param {Complex64Array} y - second complex input vector +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting index for `y` +* @returns {Complex64Array} `y` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chbmv( 'lower', 3, 1, alpha, A, 2, 1, 0, x, 1, 0, beta, y, 1, 0 ); +* // y => [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +*/ +function chbmv( order, uplo, N, K, alpha, AP, strideAP, offsetAP, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len + var realpha; + var imalpha; + var rebeta; + var imbeta; + var retmp1; + var imtmp1; + var retmp2; + var imtmp2; + var viewA; + var viewX; + var viewY; + var isrm; + var cima; + var sign; + var sa0; + var sa1; + var oa2; + var rea; + var ima; + var rex; + var imx; + var ix; + var iy; + var oa; + var ox; + var oy; + var sx; + var sy; + var i0; + var i1; + var ia; + var m; + + // Layout + isrm = order === "row-major"; + + // Decompose scalars + rebeta = realf( beta ); + imbeta = imagf( beta ); + realpha = realf( alpha ); + imalpha = imagf( alpha ); + + // y = beta*y + if ( rebeta === 0.0 && imbeta === 0.0 ) { + cfill( N, 0.0, y, strideY, offsetY ); + } else if ( rebeta !== 1.0 || imbeta !== 0.0 ) { + cscal( N, beta, y, strideY, offsetY ); + } + + // If alpha is zero, early return y + if ( realpha === 0.0 && imalpha === 0.0 ) { + return y; + } + + // Reinterpret arrays to raw numeric views + viewA = reinterpret( A, 0 ); + viewX = reinterpret( x, 0 ); + viewY = reinterpret( y, 0 ); + + if ( isrm ) { + // For row-major matrices, the last dimension has the fastest changing index... + sa0 = strideA2 * 2; // offset increment for innermost loop + sa1 = strideA1 * 2; // offset increment for outermost loop + } else { // isColMajor + // For column-major matrices, the first dimension has the fastest changing index... + sa0 = strideA1 * 2; // offset increment for innermost loop + sa1 = strideA2 * 2; // offset increment for outermost loop + } + + // Adjust sign to account for layout-dependent conjugation + if ( isrm ) { + sign = -1; + } else { + sign = 1; + } + + // Vector indexing base + oa = offsetA * 2; + ox = offsetX * 2; + oy = offsetY * 2; + + // Vector strides + sx = strideX * 2; + sy = strideY * 2; + + if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { + for ( i1 = 0; i1 < N; i1++ ) { + ix = ox + ( i1 * sx ); + rex = viewX[ ix ]; + imx = viewX[ ix + 1 ]; + retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); + imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); + retmp2 = 0.0; + imtmp2 = 0.0; + oa2 = oa + ( i1 * sa1 ); + ia = oa2; + rea = viewA[ ia ]; + iy = oy + ( i1 * sy ); + viewY[ iy ] += f32( retmp1 * rea ); + viewY[ iy + 1 ] += f32( imtmp1 * rea ); + m = -i1; + oa2 = oa + ( i1 * sa1 ) + ( m * sa0 ); + for ( i0 = i1 + 1; i0 < min( N, i1 + K + 1 ); i0++ ) { + ia = oa2 + ( i0 * sa0 ); + rea = viewA[ ia ]; + ima = viewA[ ia + 1 ]; + cima = sign * ima; + iy = oy + ( i0 * sy ); + muladd( retmp1, imtmp1, rea, cima, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len + ix = ox + ( i0 * sx ); + rex = viewX[ ix ]; + imx = viewX[ ix + 1 ]; + retmp2 += f32( ( rea * rex ) + ( cima * imx ) ); + imtmp2 += f32( ( rea * imx ) - ( cima * rex ) ); + } + iy = oy + ( i1 * sy ); + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len + } + return y; + } + + // ( isrm && uplo === 'lower' ) || ( !isrm && uplo === 'upper' ) + for ( i1 = 0; i1 < N; i1++ ) { + ix = ox + ( i1 * sx ); + rex = viewX[ ix ]; + imx = viewX[ ix + 1 ]; + retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); + imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); + retmp2 = 0.0; + imtmp2 = 0.0; + m = K - i1; + oa2 = oa + ( i1 * sa1 ) + ( m * sa0 ); + for ( i0 = max( 0, i1 - K ); i0 < i1; i0++ ) { + ia = oa2 + ( i0 * sa0 ); + rea = viewA[ ia ]; + ima = viewA[ ia + 1 ]; + cima = sign * ima; + iy = oy + ( i0 * sy ); + muladd( retmp1, imtmp1, rea, cima, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len + ix = ox + ( i0 * sx ); + rex = viewX[ ix ]; + imx = viewX[ ix + 1 ]; + retmp2 += f32( ( rea * rex ) + ( cima * imx ) ); + imtmp2 += f32( ( rea * imx ) - ( cima * rex ) ); + } + ia = oa2 + ( i1 * sa0 ); + rea = viewA[ ia ]; + iy = oy + ( i1 * sy ); + viewY[ iy ] += f32( retmp1 * rea ); + viewY[ iy + 1 ] += f32( imtmp1 * rea ); + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len + } + return y; +} + + +// EXPORTS // + +module.exports = chbmv; From 85c048e3ac8c0c555e2f2e01ae99f0e8a386101f Mon Sep 17 00:00:00 2001 From: Divit Date: Wed, 1 Apr 2026 19:06:43 +0000 Subject: [PATCH 03/33] feat: base algorithm working --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/chbmv/lib/base.js | 168 ++++++++---------- 1 file changed, 79 insertions(+), 89 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js index 4095ef27afda..dbfda8389d8d 100644 --- a/lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js @@ -20,7 +20,7 @@ // MODULES // -var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); var cfill = require( '@stdlib/blas/ext/base/cfill' ).ndarray; var cscal = require( '@stdlib/blas/base/cscal' ).ndarray; var realf = require( '@stdlib/complex/float32/real' ); @@ -28,24 +28,21 @@ var imagf = require( '@stdlib/complex/float32/imag' ); var f32 = require( '@stdlib/number/float64/base/to-float32' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); var muladd = require( '@stdlib/complex/float32/base/mul-add' ).assign; -var max = require( '@stdlib/math/base/special/max' ); -var min = require( '@stdlib/math/base/special/min' ); // MAIN // /** -* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are complex vectors, and `A` is an `N` by `N` Hermitian band matrix with `K` sub-diagonals or super-diagonals. +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. * * @private +* @param {string} order - storage layout * @param {string} uplo - specifies whether `A` is an upper or lower triangular part of matrix is supplied. * @param {NonNegativeInteger} N - number of elements along each dimension of `A` -* @param {NonNegativeInteger} K - number of super-diagonals or sub-diagonals of matrix `A`. * @param {Complex64} alpha - complex scalar constant -* @param {Complex64Array} A - complex input matrix -* @param {integer} strideA1 - stride of the first dimension of `A` -* @param {integer} strideA2 - stride of the second dimension of `A` -* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Complex64Array} AP - complex input matrix in packed form +* @param {integer} strideAP - `AP` stride length +* @param {NonNegativeInteger} offsetAP - starting index for `AP` * @param {Complex64Array} x - first complex input vector * @param {integer} strideX - `x` stride length * @param {NonNegativeInteger} offsetX - starting index for `x` @@ -59,16 +56,16 @@ var min = require( '@stdlib/math/base/special/min' ); * var Complex64Array = require( '@stdlib/array/complex64' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * -* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 3.0, 0.0, 4.0, -4.0, 5.0, 0.0 ] ); +* var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); * var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); * var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); * var alpha = new Complex64( 0.5, 0.5 ); * var beta = new Complex64( 0.5, -0.5 ); * -* chbmv( 'lower', 3, 1, alpha, A, 2, 1, 0, x, 1, 0, beta, y, 1, 0 ); -* // y => [ -1.0, 5.0, -8.0, 20.0, 9.0, 23.0 ] +* chpmv( 'row-major', 'lower', 3, alpha, AP, 1, 0, x, 1, 0, beta, y, 1, 0 ); +* // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] */ -function chbmv( order, uplo, N, K, alpha, AP, strideAP, offsetAP, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len +function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len var realpha; var imalpha; var rebeta; @@ -77,33 +74,32 @@ function chbmv( order, uplo, N, K, alpha, AP, strideAP, offsetAP, x, strideX, of var imtmp1; var retmp2; var imtmp2; - var viewA; + var viewAP; var viewX; var viewY; + var cimap; var isrm; - var cima; var sign; - var sa0; - var sa1; - var oa2; - var rea; - var ima; + var reap; + var imap; + var iap; + var sap; var rex; var imx; var ix; + var jx; + var kx; var iy; - var oa; - var ox; - var oy; + var jy; + var ky; var sx; var sy; - var i0; - var i1; - var ia; - var m; + var kk; + var k; + var j; // Layout - isrm = order === "row-major"; + isrm = isRowMajor( order ); // Decompose scalars rebeta = realf( beta ); @@ -124,20 +120,10 @@ function chbmv( order, uplo, N, K, alpha, AP, strideAP, offsetAP, x, strideX, of } // Reinterpret arrays to raw numeric views - viewA = reinterpret( A, 0 ); + viewAP = reinterpret( AP, 0 ); viewX = reinterpret( x, 0 ); viewY = reinterpret( y, 0 ); - if ( isrm ) { - // For row-major matrices, the last dimension has the fastest changing index... - sa0 = strideA2 * 2; // offset increment for innermost loop - sa1 = strideA1 * 2; // offset increment for outermost loop - } else { // isColMajor - // For column-major matrices, the first dimension has the fastest changing index... - sa0 = strideA1 * 2; // offset increment for innermost loop - sa1 = strideA2 * 2; // offset increment for outermost loop - } - // Adjust sign to account for layout-dependent conjugation if ( isrm ) { sign = -1; @@ -146,80 +132,84 @@ function chbmv( order, uplo, N, K, alpha, AP, strideAP, offsetAP, x, strideX, of } // Vector indexing base - oa = offsetA * 2; - ox = offsetX * 2; - oy = offsetY * 2; + kk = offsetAP * 2; + kx = offsetX * 2; + ky = offsetY * 2; // Vector strides sx = strideX * 2; sy = strideY * 2; + sap = strideAP * 2; + + jx = kx; + jy = ky; if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { - for ( i1 = 0; i1 < N; i1++ ) { - ix = ox + ( i1 * sx ); - rex = viewX[ ix ]; - imx = viewX[ ix + 1 ]; + for ( j = 0; j < N; j++ ) { + rex = viewX[ jx ]; + imx = viewX[ jx + 1 ]; retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); retmp2 = 0.0; imtmp2 = 0.0; - oa2 = oa + ( i1 * sa1 ); - ia = oa2; - rea = viewA[ ia ]; - iy = oy + ( i1 * sy ); - viewY[ iy ] += f32( retmp1 * rea ); - viewY[ iy + 1 ] += f32( imtmp1 * rea ); - m = -i1; - oa2 = oa + ( i1 * sa1 ) + ( m * sa0 ); - for ( i0 = i1 + 1; i0 < min( N, i1 + K + 1 ); i0++ ) { - ia = oa2 + ( i0 * sa0 ); - rea = viewA[ ia ]; - ima = viewA[ ia + 1 ]; - cima = sign * ima; - iy = oy + ( i0 * sy ); - muladd( retmp1, imtmp1, rea, cima, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len - ix = ox + ( i0 * sx ); + reap = viewAP[ kk ]; + viewY[ jy ] += f32( retmp1 * reap ); + viewY[ jy + 1 ] += f32( imtmp1 * reap ); + ix = jx + sx; + iy = jy + sy; + iap = kk + sap; + for ( k = j + 1; k < N; k++ ) { + reap = viewAP[ iap ]; + imap = viewAP[ iap + 1 ]; + cimap = sign * imap; + muladd( retmp1, imtmp1, reap, cimap, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len rex = viewX[ ix ]; imx = viewX[ ix + 1 ]; - retmp2 += f32( ( rea * rex ) + ( cima * imx ) ); - imtmp2 += f32( ( rea * imx ) - ( cima * rex ) ); + retmp2 += f32( ( reap * rex ) + ( cimap * imx ) ); + imtmp2 += f32( ( reap * imx ) - ( cimap * rex ) ); + ix += sx; + iy += sy; + iap += sap; } - iy = oy + ( i1 * sy ); - muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ jy ], viewY[ jy + 1 ], viewY, 1, jy ); // eslint-disable-line max-len + jx += sx; + jy += sy; + kk += ( N - j ) * sap; } return y; } // ( isrm && uplo === 'lower' ) || ( !isrm && uplo === 'upper' ) - for ( i1 = 0; i1 < N; i1++ ) { - ix = ox + ( i1 * sx ); - rex = viewX[ ix ]; - imx = viewX[ ix + 1 ]; + for ( j = 0; j < N; j++ ) { + rex = viewX[ jx ]; + imx = viewX[ jx + 1 ]; retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); retmp2 = 0.0; imtmp2 = 0.0; - m = K - i1; - oa2 = oa + ( i1 * sa1 ) + ( m * sa0 ); - for ( i0 = max( 0, i1 - K ); i0 < i1; i0++ ) { - ia = oa2 + ( i0 * sa0 ); - rea = viewA[ ia ]; - ima = viewA[ ia + 1 ]; - cima = sign * ima; - iy = oy + ( i0 * sy ); - muladd( retmp1, imtmp1, rea, cima, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len - ix = ox + ( i0 * sx ); + ix = kx; + iy = ky; + iap = kk; + for ( k = 0; k < j; k++ ) { + reap = viewAP[ iap ]; + imap = viewAP[ iap + 1 ]; + cimap = sign * imap; + muladd( retmp1, imtmp1, reap, cimap, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len rex = viewX[ ix ]; imx = viewX[ ix + 1 ]; - retmp2 += f32( ( rea * rex ) + ( cima * imx ) ); - imtmp2 += f32( ( rea * imx ) - ( cima * rex ) ); + retmp2 += f32( ( reap * rex ) + ( cimap * imx ) ); + imtmp2 += f32( ( reap * imx ) - ( cimap * rex ) ); + ix += sx; + iy += sy; + iap += sap; } - ia = oa2 + ( i1 * sa0 ); - rea = viewA[ ia ]; - iy = oy + ( i1 * sy ); - viewY[ iy ] += f32( retmp1 * rea ); - viewY[ iy + 1 ] += f32( imtmp1 * rea ); - muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len + reap = viewAP[ iap ]; + viewY[ jy ] += f32( retmp1 * reap ); + viewY[ jy + 1 ] += f32( imtmp1 * reap ); + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ jy ], viewY[ jy + 1 ], viewY, 1, jy ); // eslint-disable-line max-len + jx += sx; + jy += sy; + kk += ( j + 1 ) * sap; } return y; } @@ -227,4 +217,4 @@ function chbmv( order, uplo, N, K, alpha, AP, strideAP, offsetAP, x, strideX, of // EXPORTS // -module.exports = chbmv; +module.exports = chpmv; From e6a82d8f65af4febc6ed67f40f3d2c342c0862b3 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 2 Apr 2026 16:59:33 +0000 Subject: [PATCH 04/33] feat: lib added --- 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/chpmv/lib/base.js | 131 ++++++++++++------ .../@stdlib/blas/base/chpmv/lib/chpmv.js | 107 ++++++++++++++ .../@stdlib/blas/base/chpmv/lib/index.js | 79 +++++++++++ .../@stdlib/blas/base/chpmv/lib/main.js | 35 +++++ .../@stdlib/blas/base/chpmv/lib/ndarray.js | 111 +++++++++++++++ .../@stdlib/blas/base/chpmv/package.json | 74 ++++++++++ 6 files changed, 493 insertions(+), 44 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/lib/chpmv.js create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/lib/ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/package.json diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js index 85ff2896afb7..dbfda8389d8d 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js @@ -20,7 +20,7 @@ // MODULES // -var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); var cfill = require( '@stdlib/blas/ext/base/cfill' ).ndarray; var cscal = require( '@stdlib/blas/base/cscal' ).ndarray; var realf = require( '@stdlib/complex/float32/real' ); @@ -33,15 +33,16 @@ var muladd = require( '@stdlib/complex/float32/base/mul-add' ).assign; // MAIN // /** -* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix, supplied in packed form `AP`. +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. * * @private +* @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 {Complex64} alpha - complex scalar constant -* @param {Complex64Array} AP - complex input matrix +* @param {Complex64Array} AP - complex input matrix in packed form * @param {integer} strideAP - `AP` stride length -* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {NonNegativeInteger} offsetAP - starting index for `AP` * @param {Complex64Array} x - first complex input vector * @param {integer} strideX - `x` stride length * @param {NonNegativeInteger} offsetX - starting index for `x` @@ -55,16 +56,16 @@ var muladd = require( '@stdlib/complex/float32/base/mul-add' ).assign; * var Complex64Array = require( '@stdlib/array/complex64' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); * -* var A = new Complex64Array( [ ] ); +* var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); * var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); * var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); * var alpha = new Complex64( 0.5, 0.5 ); * var beta = new Complex64( 0.5, -0.5 ); * -* chpmv( 'lower', 3, alpha, A, 0, 0, x, 1, 0, beta, y, 1, 0 ); +* chpmv( 'row-major', 'lower', 3, alpha, AP, 1, 0, x, 1, 0, beta, y, 1, 0 ); * // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] */ -function chpmv( uplo, N, alpha, AP, strideAP, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len +function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len var realpha; var imalpha; var rebeta; @@ -76,27 +77,29 @@ function chpmv( uplo, N, alpha, AP, strideAP, offsetA, x, strideX, offsetX, beta var viewAP; var viewX; var viewY; + var cimap; var isrm; - var cima; var sign; - var sap; - var oa2; var reap; var imap; + var iap; + var sap; var rex; var imx; - var kk; var ix; + var jx; + var kx; var iy; - var oa; - var ox; - var oy; + var jy; + var ky; var sx; var sy; - var i0; - var i1; - var iap; + var kk; var k; + var j; + + // Layout + isrm = isRowMajor( order ); // Decompose scalars rebeta = realf( beta ); @@ -129,49 +132,89 @@ function chpmv( uplo, N, alpha, AP, strideAP, offsetA, x, strideX, offsetX, beta } // Vector indexing base - oa = offsetA * 2; - ox = offsetX * 2; - oy = offsetY * 2; + kk = offsetAP * 2; + kx = offsetX * 2; + ky = offsetY * 2; // Vector strides - sap = strideAP * 2; sx = strideX * 2; sy = strideY * 2; + sap = strideAP * 2; - kk = 0; + jx = kx; + jy = ky; if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { - for ( i1 = 0; i1 < N; i1++ ) { - ix = ox + ( i1 * sx ); - rex = viewX[ ix ]; - imx = viewX[ ix + 1 ]; + for ( j = 0; j < N; j++ ) { + rex = viewX[ jx ]; + imx = viewX[ jx + 1 ]; retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); retmp2 = 0.0; imtmp2 = 0.0; - // oa2 = oa + ( i1 * sa1 ); - iap = oa + ( kk * sap ); - reap = viewAP[ iap ]; - iy = oy + ( i1 * sy ); - viewY[ iy ] += f32( retmp1 * reap ); - viewY[ iy + 1 ] += f32( imtmp1 * reap ); - k = kk + 1; - for ( i0 = i1 + 1; i0 < N; i0++ ) { - iap = oa + ( k * sap ); + reap = viewAP[ kk ]; + viewY[ jy ] += f32( retmp1 * reap ); + viewY[ jy + 1 ] += f32( imtmp1 * reap ); + ix = jx + sx; + iy = jy + sy; + iap = kk + sap; + for ( k = j + 1; k < N; k++ ) { reap = viewAP[ iap ]; imap = viewAP[ iap + 1 ]; - iy = oy + ( i0 * sy ); - muladd( retmp1, imtmp1, reap, imap, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len - ix = ox + ( i0 * sx ); + cimap = sign * imap; + muladd( retmp1, imtmp1, reap, cimap, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len rex = viewX[ ix ]; imx = viewX[ ix + 1 ]; - retmp2 += f32( ( reap * rex ) + ( imap * imx ) ); - imtmp2 += f32( ( reap * imx ) - ( imap * rex ) ); - k += 1; + retmp2 += f32( ( reap * rex ) + ( cimap * imx ) ); + imtmp2 += f32( ( reap * imx ) - ( cimap * rex ) ); + ix += sx; + iy += sy; + iap += sap; } - muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len - kk += ( N - i1 ); + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ jy ], viewY[ jy + 1 ], viewY, 1, jy ); // eslint-disable-line max-len + jx += sx; + jy += sy; + kk += ( N - j ) * sap; } return y; } -} \ No newline at end of file + + // ( isrm && uplo === 'lower' ) || ( !isrm && uplo === 'upper' ) + for ( j = 0; j < N; j++ ) { + rex = viewX[ jx ]; + imx = viewX[ jx + 1 ]; + retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); + imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); + retmp2 = 0.0; + imtmp2 = 0.0; + ix = kx; + iy = ky; + iap = kk; + for ( k = 0; k < j; k++ ) { + reap = viewAP[ iap ]; + imap = viewAP[ iap + 1 ]; + cimap = sign * imap; + muladd( retmp1, imtmp1, reap, cimap, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len + rex = viewX[ ix ]; + imx = viewX[ ix + 1 ]; + retmp2 += f32( ( reap * rex ) + ( cimap * imx ) ); + imtmp2 += f32( ( reap * imx ) - ( cimap * rex ) ); + ix += sx; + iy += sy; + iap += sap; + } + reap = viewAP[ iap ]; + viewY[ jy ] += f32( retmp1 * reap ); + viewY[ jy + 1 ] += f32( imtmp1 * reap ); + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ jy ], viewY[ jy + 1 ], viewY, 1, jy ); // eslint-disable-line max-len + jx += sx; + jy += sy; + kk += ( j + 1 ) * sap; + } + return y; +} + + +// EXPORTS // + +module.exports = chpmv; diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/lib/chpmv.js b/lib/node_modules/@stdlib/blas/base/chpmv/lib/chpmv.js new file mode 100644 index 000000000000..c5830a33e03f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/lib/chpmv.js @@ -0,0 +1,107 @@ +/** +* @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 stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. +* +* @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 {Complex64} alpha - complex scalar constant +* @param {Complex64Array} AP - complex input matrix in packed form +* @param {Complex64Array} x - first complex input vector +* @param {integer} strideX - `x` stride length +* @param {Complex64} beta - complex scalar constant +* @param {Complex64Array} y - second complex input vector +* @param {integer} strideY - `y` stride length +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must specify whether to reference the lower or upper triangular matrix +* @throws {RangeError} third argument must be a nonnegative integer +* @throws {RangeError} seventh argument must be non-zero +* @throws {RangeError} tenth argument must be non-zero +* @returns {Complex64Array} `y` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chpmv( 'row-major', 'lower', 3, alpha, AP, x, 1, beta, y, 1 ); +* // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +*/ +function chpmv( order, uplo, N, alpha, AP, x, strideX, beta, y, strideY ) { + var realpha; + var imalpha; + var rebeta; + var imbeta; + 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 ( strideX === 0 ) { + throw new RangeError( format( 'invalid argument. Seventh argument must be non-zero. Value: `%d`.', strideX ) ); + } + if ( strideY === 0 ) { + throw new RangeError( format( 'invalid argument. Tenth argument must be non-zero. Value: `%d`.', strideY ) ); + } + rebeta = realf( beta ); + imbeta = imagf( beta ); + realpha = realf( alpha ); + imalpha = imagf( alpha ); + + // Check if we can early return... + if ( N === 0 || ( realpha === 0.0 && imalpha === 0.0 && rebeta === 1.0 && imbeta === 0.0 ) ) { // eslint-disable-line max-len + return y; + } + ox = stride2offset( N, strideX ); + oy = stride2offset( N, strideY ); + return base( order, uplo, N, alpha, AP, 1, 0, x, strideX, ox, beta, y, strideY, oy ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = chpmv; diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/chpmv/lib/index.js new file mode 100644 index 000000000000..075acfea44af --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/lib/index.js @@ -0,0 +1,79 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* BLAS level 2 routine to performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. +* +* @module @stdlib/blas/base/chpmv +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* var chpmv = require( '@stdlib/blas/base/chpmv' ); +* +* var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chpmv( 'row-major', 'lower', 3, alpha, AP, x, 1, beta, y, 1 ); +* // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* var chpmv = require( '@stdlib/blas/base/chpmv' ); +* +* var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chpmv.ndarray( 'row-major', 'lower', 3, alpha, AP, 1, 0, x, 1, 0, beta, y, 1, 0 ); +* // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.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 chpmv; +var tmp = tryRequire( join( __dirname, './native.js' ) ); + +if ( isError( tmp ) ) { + chpmv = main; +} else { + chpmv = tmp; +} + + +// EXPORTS // + +module.exports = chpmv; + +// exports: { "ndarray": "chpmv.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/lib/main.js b/lib/node_modules/@stdlib/blas/base/chpmv/lib/main.js new file mode 100644 index 000000000000..df7fdcef5cd4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/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 chpmv = require( './chpmv.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( chpmv, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = chpmv; diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/chpmv/lib/ndarray.js new file mode 100644 index 000000000000..ef8183d95087 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/lib/ndarray.js @@ -0,0 +1,111 @@ +/** +* @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 format = require( '@stdlib/string/format' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. +* +* @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 {Complex64} alpha - complex scalar constant +* @param {Complex64Array} AP - complex input matrix in packed form +* @param {integer} strideAP - `AP` stride length +* @param {NonNegativeInteger} offsetAP - starting index for `AP` +* @param {Complex64Array} x - first complex input vector +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {Complex64} beta - complex scalar constant +* @param {Complex64Array} y - second complex input vector +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting index for `y` +* @throws {TypeError} first argument must 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} fifth argument must be non-zero +* @throws {RangeError} sixth argument must be non-zero +* @throws {RangeError} ninth argument must be non-zero +* @throws {RangeError} thirteenth argument must be non-zero +* @returns {Complex64Array} `y` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chpmv( 'row-major', 'lower', 3, alpha, AP, 1, 0, x, 1, 0, beta, y, 1, 0 ); +* // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +*/ +function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len + var realpha; + var imalpha; + var rebeta; + var imbeta; + + 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 ( strideAP === 0 ) { + throw new RangeError( format( 'invalid argument. Sixth argument must be non-zero. Value: `%d`.', strideAP ) ); + } + 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. Thirteenth argument must be non-zero. Value: `%d`.', strideY ) ); + } + rebeta = realf( beta ); + imbeta = imagf( beta ); + realpha = realf( alpha ); + imalpha = imagf( alpha ); + + // Check if we can early return... + if ( N === 0 || ( realpha === 0.0 && imalpha === 0.0 && rebeta === 1.0 && imbeta === 0.0 ) ) { // eslint-disable-line max-len + return y; + } + return base( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offsetX, beta, y, strideY, offsetY ); +} + + +// EXPORTS // + +module.exports = chpmv; diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/package.json b/lib/node_modules/@stdlib/blas/base/chpmv/package.json new file mode 100644 index 000000000000..12565866ef3d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/package.json @@ -0,0 +1,74 @@ +{ + "name": "@stdlib/blas/base/chpmv", + "version": "0.0.0", + "description": "Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form.", + "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", + "chemv", + "hermitian", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "complex", + "complex64", + "complex64array", + "float", + "float32", + "single", + "float32array" + ] +} From c02d159a7cb54ea11c5b9fab323b94ca4a1e09d1 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 2 Apr 2026 17:01:27 +0000 Subject: [PATCH 05/33] feat: incorrect file removed --- 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: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/chbmv/lib/base.js | 220 ------------------ 1 file changed, 220 deletions(-) delete mode 100644 lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js diff --git a/lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js deleted file mode 100644 index dbfda8389d8d..000000000000 --- a/lib/node_modules/@stdlib/blas/base/chbmv/lib/base.js +++ /dev/null @@ -1,220 +0,0 @@ -/** -* @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-string' ); -var cfill = require( '@stdlib/blas/ext/base/cfill' ).ndarray; -var cscal = require( '@stdlib/blas/base/cscal' ).ndarray; -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); -var f32 = require( '@stdlib/number/float64/base/to-float32' ); -var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); -var muladd = require( '@stdlib/complex/float32/base/mul-add' ).assign; - - -// MAIN // - -/** -* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. -* -* @private -* @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 {Complex64} alpha - complex scalar constant -* @param {Complex64Array} AP - complex input matrix in packed form -* @param {integer} strideAP - `AP` stride length -* @param {NonNegativeInteger} offsetAP - starting index for `AP` -* @param {Complex64Array} x - first complex input vector -* @param {integer} strideX - `x` stride length -* @param {NonNegativeInteger} offsetX - starting index for `x` -* @param {Complex64} beta - complex scalar constant -* @param {Complex64Array} y - second complex input vector -* @param {integer} strideY - `y` stride length -* @param {NonNegativeInteger} offsetY - starting index for `y` -* @returns {Complex64Array} `y` -* -* @example -* var Complex64Array = require( '@stdlib/array/complex64' ); -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); -* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); -* var alpha = new Complex64( 0.5, 0.5 ); -* var beta = new Complex64( 0.5, -0.5 ); -* -* chpmv( 'row-major', 'lower', 3, alpha, AP, 1, 0, x, 1, 0, beta, y, 1, 0 ); -* // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] -*/ -function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len - var realpha; - var imalpha; - var rebeta; - var imbeta; - var retmp1; - var imtmp1; - var retmp2; - var imtmp2; - var viewAP; - var viewX; - var viewY; - var cimap; - var isrm; - var sign; - var reap; - var imap; - var iap; - var sap; - var rex; - var imx; - var ix; - var jx; - var kx; - var iy; - var jy; - var ky; - var sx; - var sy; - var kk; - var k; - var j; - - // Layout - isrm = isRowMajor( order ); - - // Decompose scalars - rebeta = realf( beta ); - imbeta = imagf( beta ); - realpha = realf( alpha ); - imalpha = imagf( alpha ); - - // y = beta*y - if ( rebeta === 0.0 && imbeta === 0.0 ) { - cfill( N, 0.0, y, strideY, offsetY ); - } else if ( rebeta !== 1.0 || imbeta !== 0.0 ) { - cscal( N, beta, y, strideY, offsetY ); - } - - // If alpha is zero, early return y - if ( realpha === 0.0 && imalpha === 0.0 ) { - return y; - } - - // Reinterpret arrays to raw numeric views - viewAP = reinterpret( AP, 0 ); - viewX = reinterpret( x, 0 ); - viewY = reinterpret( y, 0 ); - - // Adjust sign to account for layout-dependent conjugation - if ( isrm ) { - sign = -1; - } else { - sign = 1; - } - - // Vector indexing base - kk = offsetAP * 2; - kx = offsetX * 2; - ky = offsetY * 2; - - // Vector strides - sx = strideX * 2; - sy = strideY * 2; - sap = strideAP * 2; - - jx = kx; - jy = ky; - - if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { - for ( j = 0; j < N; j++ ) { - rex = viewX[ jx ]; - imx = viewX[ jx + 1 ]; - retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); - imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); - retmp2 = 0.0; - imtmp2 = 0.0; - reap = viewAP[ kk ]; - viewY[ jy ] += f32( retmp1 * reap ); - viewY[ jy + 1 ] += f32( imtmp1 * reap ); - ix = jx + sx; - iy = jy + sy; - iap = kk + sap; - for ( k = j + 1; k < N; k++ ) { - reap = viewAP[ iap ]; - imap = viewAP[ iap + 1 ]; - cimap = sign * imap; - muladd( retmp1, imtmp1, reap, cimap, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len - rex = viewX[ ix ]; - imx = viewX[ ix + 1 ]; - retmp2 += f32( ( reap * rex ) + ( cimap * imx ) ); - imtmp2 += f32( ( reap * imx ) - ( cimap * rex ) ); - ix += sx; - iy += sy; - iap += sap; - } - muladd( realpha, imalpha, retmp2, imtmp2, viewY[ jy ], viewY[ jy + 1 ], viewY, 1, jy ); // eslint-disable-line max-len - jx += sx; - jy += sy; - kk += ( N - j ) * sap; - } - return y; - } - - // ( isrm && uplo === 'lower' ) || ( !isrm && uplo === 'upper' ) - for ( j = 0; j < N; j++ ) { - rex = viewX[ jx ]; - imx = viewX[ jx + 1 ]; - retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); - imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); - retmp2 = 0.0; - imtmp2 = 0.0; - ix = kx; - iy = ky; - iap = kk; - for ( k = 0; k < j; k++ ) { - reap = viewAP[ iap ]; - imap = viewAP[ iap + 1 ]; - cimap = sign * imap; - muladd( retmp1, imtmp1, reap, cimap, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len - rex = viewX[ ix ]; - imx = viewX[ ix + 1 ]; - retmp2 += f32( ( reap * rex ) + ( cimap * imx ) ); - imtmp2 += f32( ( reap * imx ) - ( cimap * rex ) ); - ix += sx; - iy += sy; - iap += sap; - } - reap = viewAP[ iap ]; - viewY[ jy ] += f32( retmp1 * reap ); - viewY[ jy + 1 ] += f32( imtmp1 * reap ); - muladd( realpha, imalpha, retmp2, imtmp2, viewY[ jy ], viewY[ jy + 1 ], viewY, 1, jy ); // eslint-disable-line max-len - jx += sx; - jy += sy; - kk += ( j + 1 ) * sap; - } - return y; -} - - -// EXPORTS // - -module.exports = chpmv; From 9fe122036b7f108f21424bfbdd81eb2bebda2d03 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 2 Apr 2026 17:54:30 +0000 Subject: [PATCH 06/33] test: test file added --- 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 --- --- .../@stdlib/blas/base/chpmv/test/test.js | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/test.js diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.js b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.js new file mode 100644 index 000000000000..da22743c6c6e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/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 chpmv = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': isBrowser +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof chpmv, '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 chpmv.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 chpmv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( chpmv, 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 chpmv; + var main; + + main = require( './../lib/chpmv.js' ); + + chpmv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( chpmv, main, 'returns JavaScript implementation' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); From dd124102e93a89af98163da61041f037eded5fa1 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 2 Apr 2026 17:56:14 +0000 Subject: [PATCH 07/33] test: test.chpmv file added --- .../blas/base/chpmv/test/test.chpmv.js | 910 ++++++++++++++++++ 1 file changed, 910 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/test.chpmv.js diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.chpmv.js b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.chpmv.js new file mode 100644 index 000000000000..42d3a1736f66 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.chpmv.js @@ -0,0 +1,910 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var chpmv = require( './../lib/chpmv.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 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 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 chpmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 10', function test( t ) { + t.strictEqual( chpmv.length, 10, '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 ap; + var i; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chpmv( value, data.uplo, data.N, alpha, ap, 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 ap; + var i; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chpmv( data.order, value, data.N, alpha, ap, 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 ap; + var i; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chpmv( data.order, data.uplo, value, alpha, ap, 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 ap; + var i; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chpmv( data.order, data.uplo, data.N, alpha, ap, x, value, beta, y, data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid tenth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var ap; + var i; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chpmv( data.order, data.uplo, data.N, alpha, ap, 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 ap; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, lower)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (row-major, upper)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = ru; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, upper)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cu; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (row-major)', function test( t ) { + var alpha; + var beta; + var data; + var out; + var ap; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (column-major)', function test( t ) { + var alpha; + var beta; + var data; + var out; + var ap; + var x; + var y; + + data = cl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `N` is `0`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = chpmv( data.order, data.uplo, 0, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is `0`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = chpmv( data.order, data.uplo, 0, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rx; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cx; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = ra; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = ca; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rx; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cx; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rxpyp; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cxpyp; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rxnyp; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cxnyp; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rxpyn; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cxpyn; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying negative strides for `x` and `y` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rxnyn; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying negative strides for `x` and `y` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cxnyn; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); From a5ad986718af3ffed8c1c507677105df53c683a4 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 2 Apr 2026 17:56:32 +0000 Subject: [PATCH 08/33] test: test.ndarray file added --- .../blas/base/chpmv/test/test.ndarray.js | 1293 +++++++++++++++++ 1 file changed, 1293 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js new file mode 100644 index 000000000000..38a6f72376e1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js @@ -0,0 +1,1293 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var chpmv = 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 ca = require( './fixtures/column_major_alpha_zero.json' ); +var cox = require( './fixtures/column_major_ox.json' ); +var coy = require( './fixtures/column_major_oy.json' ); +var coap = require( './fixtures/column_major_oap.json' ); +var csap = require( './fixtures/column_major_sap.json' ); +var csapn = require( './fixtures/column_major_sapn.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 ccap = 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 ra = require( './fixtures/row_major_alpha_zero.json' ); +var rox = require( './fixtures/row_major_ox.json' ); +var roy = require( './fixtures/row_major_oy.json' ); +var roap = require( './fixtures/row_major_oap.json' ); +var rl = require( './fixtures/row_major_l.json' ); +var rsap = require( './fixtures/row_major_sap.json' ); +var rsapn = require( './fixtures/row_major_sapn.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 rcap = 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 chpmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 14', function test( t ) { + t.strictEqual( chpmv.length, 14, '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 ap; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chpmv( value, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, 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 ap; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chpmv( data.order, value, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var ap; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chpmv( data.order, data.uplo, value, alpha, ap, data.strideAP, data.OffsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid sixth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var ap; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chpmv( data.order, data.uplo, data.N, alpha, ap, value, data.OffsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +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 ap; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, value, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid thirteenth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var ap; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, 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 ap; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, lower)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (row-major, upper)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = ru; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, upper)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cu; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (row-major)', function test( t ) { + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (column-major)', function test( t ) { + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `N` is `0`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = chpmv( data.order, data.uplo, 0, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is `0`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = chpmv( data.order, data.uplo, 0, alpha, a, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cl; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rx; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cx; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = ra; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = ca; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rx; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cx; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` offset (row-major', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rox; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` offset (column-major', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cox; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a `y` offset (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = roy; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a `y` offset (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = coy; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset for `AP` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = roap; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset for `AP` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = coap; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride for `AP` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rsap; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride for `AP` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = csap; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative stride for `AP` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rsapn; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative stride for `AP` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = csapn; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rxpyp; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cxpyp; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rxnyp; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cxnyp; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rxpyn; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cxpyn; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying negative strides for `x` and `y` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rxnyn; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying negative strides for `x` and `y` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = cxnyn; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = rcap; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var ap; + var x; + var y; + + data = ccap; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); From 2f158bdf25de4c5a19c6c654650cb7231efc06f4 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 2 Apr 2026 18:02:39 +0000 Subject: [PATCH 09/33] test: test.ndarray file added --- .../@stdlib/blas/base/chpmv/test/test.ndarray.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js index 38a6f72376e1..5dc265b65533 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js @@ -79,8 +79,8 @@ tape( 'the function throws an error if provided an invalid first argument', func var alpha; var data; var beta; - var i; var ap; + var i; var x; var y; @@ -117,8 +117,8 @@ tape( 'the function throws an error if provided an invalid second argument', fun var alpha; var data; var beta; - var i; var ap; + var i; var x; var y; @@ -155,8 +155,8 @@ tape( 'the function throws an error if provided an invalid fifth argument', func var alpha; var data; var beta; - var i; var ap; + var i; var x; var y; @@ -192,8 +192,8 @@ tape( 'the function throws an error if provided an invalid sixth argument', func var alpha; var data; var beta; - var i; var ap; + var i; var x; var y; @@ -227,8 +227,8 @@ tape( 'the function throws an error if provided an invalid ninth argument', func var alpha; var data; var beta; - var i; var ap; + var i; var x; var y; @@ -262,8 +262,8 @@ tape( 'the function throws an error if provided an invalid thirteenth argument', var alpha; var data; var beta; - var i; var ap; + var i; var x; var y; @@ -501,7 +501,7 @@ tape( 'if `N` is `0`, the function returns the second input vector unchanged (co expected = new Complex64Array( data.y ); - out = chpmv( data.order, data.uplo, 0, alpha, a, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + out = chpmv( data.order, data.uplo, 0, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); From a03bcf1bfec99c72ea9c2a78361e2e9f70955c1b Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 2 Apr 2026 18:19:22 +0000 Subject: [PATCH 10/33] test: layout, uplo combination fixtures added --- 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: na - task: lint_license_headers status: passed --- --- .../chpmv/test/fixtures/column_major_l.json | 22 +++++++++++++++++++ .../chpmv/test/fixtures/column_major_u.json | 22 +++++++++++++++++++ .../base/chpmv/test/fixtures/row_major_l.json | 22 +++++++++++++++++++ .../base/chpmv/test/fixtures/row_major_u.json | 22 +++++++++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_l.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_l.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_u.json diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_l.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_l.json new file mode 100644 index 000000000000..9ea14f186bbd --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_l.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, -2.0, 3.0, -3.0, 4.0, 0.0, 5.0, -5.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_u.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_u.json new file mode 100644 index 000000000000..eed87b1def69 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_u.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "uplo": "upper", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, 2.0, 4.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 2.0, 2.0, 3.0, 3.0 ], + [ 0.0, 0.0, 4.0, 0.0, 5.0, 5.0 ], + [ 0.0, 0.0, 0.0, 0.0, 6.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_l.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_l.json new file mode 100644 index 000000000000..1e9f38978bd8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_l.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_u.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_u.json new file mode 100644 index 000000000000..1c18a50efb92 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_u.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "uplo": "upper", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, 2.0, 3.0, 3.0, 4.0, 0.0, 5.0, 5.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 2.0, 2.0, 3.0, 3.0 ], + [ 0.0, 0.0, 4.0, 0.0, 5.0, 5.0 ], + [ 0.0, 0.0, 0.0, 0.0, 6.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} From ba9f54aedc480ec07fae7e6f2ea9a3c6aaf685d8 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 2 Apr 2026 18:26:41 +0000 Subject: [PATCH 11/33] test: beta scaled output fixtures added --- 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: na - task: lint_license_headers status: passed --- --- .../fixtures/column_major_alpha_zero.json | 22 +++++++++++++++++++ .../test/fixtures/column_major_x_zeros.json | 22 +++++++++++++++++++ .../test/fixtures/row_major_alpha_zero.json | 22 +++++++++++++++++++ .../test/fixtures/row_major_x_zeros.json | 22 +++++++++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_alpha_zero.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_x_zeros.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_alpha_zero.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_x_zeros.json diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_alpha_zero.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_alpha_zero.json new file mode 100644 index 000000000000..21a87999d879 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_alpha_zero.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.0, 0.0 ], + "AP": [ 1.0, 0.0, 2.0, -2.0, 3.0, -3.0, 4.0, 0.0, 5.0, -5.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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/chpmv/test/fixtures/column_major_x_zeros.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_x_zeros.json new file mode 100644 index 000000000000..2dfb7cbd80f8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_x_zeros.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, -2.0, 3.0, -3.0, 4.0, 0.0, 5.0, -5.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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/chpmv/test/fixtures/row_major_alpha_zero.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_alpha_zero.json new file mode 100644 index 000000000000..359ea4fef9df --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_alpha_zero.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.0, 0.0 ], + "AP": [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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/chpmv/test/fixtures/row_major_x_zeros.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_x_zeros.json new file mode 100644 index 000000000000..b9d229efe72f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_x_zeros.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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 ] +} From f6a8929b7e5a91d97801c05ea609ec6580ed47e8 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 2 Apr 2026 18:47:18 +0000 Subject: [PATCH 12/33] test: input vector strides fixtures added --- 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: na - task: lint_license_headers status: passed --- --- .../test/fixtures/column_major_xnyn.json | 23 +++++++++++++++++++ .../test/fixtures/column_major_xnyp.json | 23 +++++++++++++++++++ .../test/fixtures/column_major_xpyn.json | 23 +++++++++++++++++++ .../test/fixtures/column_major_xpyp.json | 23 +++++++++++++++++++ .../chpmv/test/fixtures/row_major_xnyn.json | 23 +++++++++++++++++++ .../chpmv/test/fixtures/row_major_xnyp.json | 23 +++++++++++++++++++ .../chpmv/test/fixtures/row_major_xpyn.json | 23 +++++++++++++++++++ .../chpmv/test/fixtures/row_major_xpyp.json | 23 +++++++++++++++++++ 8 files changed, 184 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xnyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xnyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xpyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xpyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xnyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xnyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xpyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xpyp.json diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xnyn.json new file mode 100644 index 000000000000..cbf71e88f52d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xnyn.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, 2.0, 3.0, -3.0, 4.0, 4.0, 5.0, 0.0, 6.0, 6.0, 7.0, -7.0, 8.0, 0.0, 9.0, 9.0, 10.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, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 6.0, 6.0, 8.0, 0.0, 0.0, 0.0 ], + [ 4.0, 4.0, 7.0, -7.0, 9.0, 9.0, 10.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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": [ -16.0, 85.0, 29.0, 75.0, -9.0, 58.0, 15.0, 30.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xnyp.json new file mode 100644 index 000000000000..f308b8b9f4eb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xnyp.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, 2.0, 3.0, -3.0, 4.0, 4.0, 5.0, 0.0, 6.0, 6.0, 7.0, -7.0, 8.0, 0.0, 9.0, 9.0, 10.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, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 6.0, 6.0, 8.0, 0.0, 0.0, 0.0 ], + [ 4.0, 4.0, 7.0, -7.0, 9.0, 9.0, 10.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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": [ 15.0, 30.0, -9.0, 58.0, 29.0, 75.0, -16.0, 85.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xpyn.json new file mode 100644 index 000000000000..f51c5e36133a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xpyn.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, 2.0, 3.0, -3.0, 4.0, 4.0, 5.0, 0.0, 6.0, 6.0, 7.0, -7.0, 8.0, 0.0, 9.0, 9.0, 10.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, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 6.0, 6.0, 8.0, 0.0, 0.0, 0.0 ], + [ 4.0, 4.0, 7.0, -7.0, 9.0, 9.0, 10.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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": [ -16.0, 85.0, 29.0, 75.0, -9.0, 58.0, 15.0, 30.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xpyp.json new file mode 100644 index 000000000000..ad9dcee4240f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_xpyp.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, 2.0, 3.0, -3.0, 4.0, 4.0, 5.0, 0.0, 6.0, 6.0, 7.0, -7.0, 8.0, 0.0, 9.0, 9.0, 10.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, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 6.0, 6.0, 8.0, 0.0, 0.0, 0.0 ], + [ 4.0, 4.0, 7.0, -7.0, 9.0, 9.0, 10.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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": [ 15.0, 30.0, -9.0, 58.0, 29.0, 75.0, -16.0, 85.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xnyn.json new file mode 100644 index 000000000000..f0437692ad83 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xnyn.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, 2.0, 5.0, 0.0, 3.0, -3.0, 6.0, 6.0, 8.0, 0.0, 4.0, 4.0, 7.0, -7.0, 9.0, 9.0, 10.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, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 6.0, 6.0, 8.0, 0.0, 0.0, 0.0 ], + [ 4.0, 4.0, 7.0, -7.0, 9.0, 9.0, 10.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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": [ -16.0, 85.0, 29.0, 75.0, -9.0, 58.0, 15.0, 30.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xnyp.json new file mode 100644 index 000000000000..e53de889a742 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xnyp.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, 2.0, 5.0, 0.0, 3.0, -3.0, 6.0, 6.0, 8.0, 0.0, 4.0, 4.0, 7.0, -7.0, 9.0, 9.0, 10.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, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 6.0, 6.0, 8.0, 0.0, 0.0, 0.0 ], + [ 4.0, 4.0, 7.0, -7.0, 9.0, 9.0, 10.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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": [ 15.0, 30.0, -9.0, 58.0, 29.0, 75.0, -16.0, 85.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xpyn.json new file mode 100644 index 000000000000..0d4fa46cc303 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xpyn.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, 2.0, 5.0, 0.0, 3.0, -3.0, 6.0, 6.0, 8.0, 0.0, 4.0, 4.0, 7.0, -7.0, 9.0, 9.0, 10.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, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 6.0, 6.0, 8.0, 0.0, 0.0, 0.0 ], + [ 4.0, 4.0, 7.0, -7.0, 9.0, 9.0, 10.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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": [ -16.0, 85.0, 29.0, 75.0, -9.0, 58.0, 15.0, 30.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xpyp.json new file mode 100644 index 000000000000..84c7da2de9e9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_xpyp.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, 2.0, 5.0, 0.0, 3.0, -3.0, 6.0, 6.0, 8.0, 0.0, 4.0, 4.0, 7.0, -7.0, 9.0, 9.0, 10.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, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 6.0, 6.0, 8.0, 0.0, 0.0, 0.0 ], + [ 4.0, 4.0, 7.0, -7.0, 9.0, 9.0, 10.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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": [ 15.0, 30.0, -9.0, 58.0, 29.0, 75.0, -16.0, 85.0 ] +} From e9117070aa74f2509a9490f6927291af5a5ab706 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 2 Apr 2026 18:58:43 +0000 Subject: [PATCH 13/33] test: offset fixtures added --- 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: na - task: lint_license_headers status: passed --- --- .../chpmv/test/fixtures/column_major_oap.json | 22 +++++++++++++++++++ .../chpmv/test/fixtures/column_major_ox.json | 22 +++++++++++++++++++ .../chpmv/test/fixtures/column_major_oy.json | 22 +++++++++++++++++++ .../chpmv/test/fixtures/row_major_oap.json | 22 +++++++++++++++++++ .../chpmv/test/fixtures/row_major_ox.json | 22 +++++++++++++++++++ .../chpmv/test/fixtures/row_major_oy.json | 22 +++++++++++++++++++ 6 files changed, 132 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_oap.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_ox.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_oy.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_oap.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_ox.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_oy.json diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_oap.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_oap.json new file mode 100644 index 000000000000..4e7fa2068520 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_oap.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 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, -3.0, 4.0, 0.0, 5.0, -5.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_ox.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_ox.json new file mode 100644 index 000000000000..6a0a69e20604 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_ox.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, -2.0, 3.0, -3.0, 4.0, 0.0, 5.0, -5.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 0, + "x": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 5, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_oy.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_oy.json new file mode 100644 index 000000000000..7c0141c4a3e1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_oy.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, -2.0, 3.0, -3.0, 4.0, 0.0, 5.0, -5.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 0.0, 0.0, 0.0, 0.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 2, + "y_out": [ 0.0, 0.0, 0.0, 0.0, -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_oap.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_oap.json new file mode 100644 index 000000000000..25c1b894af55 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_oap.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 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": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_ox.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_ox.json new file mode 100644 index 000000000000..2bd4d6559ebe --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_ox.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 0, + "x": [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 2, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_oy.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_oy.json new file mode 100644 index 000000000000..9054243f62eb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_oy.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": 1, + "offsetAP": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 0.0, 0.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 1, + "y_out": [ 0.0, 0.0, -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} From 064a5db68e1cb452bb124de96719a72a42b62f95 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 2 Apr 2026 19:27:27 +0000 Subject: [PATCH 14/33] test: ap stride fixtures added --- 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: na - task: lint_license_headers status: passed --- --- .../chpmv/test/fixtures/column_major_sap.json | 22 +++++++++++++++++++ .../test/fixtures/column_major_sapn.json | 22 +++++++++++++++++++ .../chpmv/test/fixtures/row_major_sap.json | 22 +++++++++++++++++++ .../chpmv/test/fixtures/row_major_sapn.json | 22 +++++++++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_sap.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_sapn.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_sap.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_sapn.json diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_sap.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_sap.json new file mode 100644 index 000000000000..c53404726ec9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_sap.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 2.0, -2.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 3.0, -3.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 4.0, 0.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 5.0, -5.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": 4, + "offsetAP": 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": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_sapn.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_sapn.json new file mode 100644 index 000000000000..006a0a5f570f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_sapn.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 6.0, 0.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 5.0, -5.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 4.0, 0.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 3.0, -3.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 2.0, -2.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 1.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": -5, + "offsetAP": 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": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_sap.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_sap.json new file mode 100644 index 000000000000..00801a978ea7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_sap.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 1.0, 0.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 2.0, -2.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 4.0, 0.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 3.0, -3.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 5.0, -5.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 6.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": 5, + "offsetAP": 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": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_sapn.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_sapn.json new file mode 100644 index 000000000000..6848db13ec0b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_sapn.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 6.0, 0.0, 999.9, 999.9, 999.9, 999.9, 5.0, -5.0, 999.9, 999.9, 999.9, 999.9, 3.0, -3.0, 999.9, 999.9, 999.9, 999.9, 4.0, 0.0, 999.9, 999.9, 999.9, 999.9, 2.0, -2.0, 999.9, 999.9, 999.9, 999.9, 1.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": -3, + "offsetAP": 15, + "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": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} From 6df3f4608d58c41d1d7637b94cb00debb0bbe4ef Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 2 Apr 2026 19:35:00 +0000 Subject: [PATCH 15/33] test: complex access pattern fixtures added --- 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: na - task: lint_license_headers status: passed --- --- .../column_major_complex_access_pattern.json | 22 +++++++++++++++++++ .../row_major_complex_access_pattern.json | 22 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_complex_access_pattern.json diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 000000000000..c4a425379868 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/column_major_complex_access_pattern.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 6.0, 0.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 5.0, -5.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 4.0, 0.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 3.0, -3.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 2.0, -2.0, 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 1.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": -4, + "offsetAP": 24, + "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": [ 14.0, 31.0, -11.0, 25.0, -10.0, 14.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 000000000000..40711866b825 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/fixtures/row_major_complex_access_pattern.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "AP": [ 999.9, 999.9, 999.9, 999.9, 999.9, 999.9, 6.0, 0.0, 999.9, 999.9, 5.0, -5.0, 999.9, 999.9, 3.0, -3.0, 999.9, 999.9, 4.0, 0.0, 999.9, 999.9, 2.0, -2.0, 999.9, 999.9, 1.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, -2.0, 4.0, 0.0, 0.0, 0.0 ], + [ 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] + ], + "strideAP": -2, + "offsetAP": 13, + "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": [ 14.0, 31.0, -11.0, 25.0, -10.0, 14.0 ] +} From 976c529be588053b0416478f6ed8f9ed5cdf828b Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 3 Apr 2026 05:30:24 +0000 Subject: [PATCH 16/33] docs: types added --- 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: na - task: lint_license_headers status: passed --- --- .../blas/base/chpmv/docs/types/index.d.ts | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/docs/types/index.d.ts diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/chpmv/docs/types/index.d.ts new file mode 100644 index 000000000000..cd3aae4cce12 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/docs/types/index.d.ts @@ -0,0 +1,142 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Complex64Array } from '@stdlib/types/array'; +import { Layout, MatrixTriangle } from '@stdlib/types/blas'; +import { Complex64 } from '@stdlib/types/complex'; + +/** +* Interface describing `chpmv`. +*/ +interface Routine { + /** + * Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. + * + * @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 alpha - complex scalar constant + * @param AP - complex input matrix in packed form + * @param x - first complex input vector + * @param strideX - `x` stride length + * @param beta - complex scalar constant + * @param y - second complex input vector + * @param strideY - `y` stride length + * @returns `y` + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); + * var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); + * var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); + * var alpha = new Complex64( 0.5, 0.5 ); + * var beta = new Complex64( 0.5, -0.5 ); + * + * chpmv( 'row-major', 'lower', 3, alpha, AP, x, 1, beta, y, 1 ); + * // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] + */ + ( order: Layout, uplo: MatrixTriangle, N: number, alpha: Complex64, AP: Complex64Array, x: Complex64Array, strideX: number, beta: Complex64, y: Complex64Array, strideY: number ): Complex64Array; + + /** + * Performs the matrix-vector operation `y = α*A*x + β*y`, using alternative indexing semantics. + * + * @param 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 alpha - complex scalar constant + * @param AP - complex input matrix in packed form + * @param strideAP - `AP` stride length + * @param offsetAP - starting index for `AP` + * @param x - first complex input vector + * @param strideX - `x` stride length + * @param offsetX - starting index for `x` + * @param beta - complex scalar constant + * @param y - second complex input vector + * @param strideY - `y` stride length + * @param offsetY - starting index for `y` + * @returns `y` + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); + * var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); + * var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); + * var alpha = new Complex64( 0.5, 0.5 ); + * var beta = new Complex64( 0.5, -0.5 ); + * + * chpmv.ndarray( 'row-major', 'lower', 3, alpha, AP, 1, 0, x, 1, 0, beta, y, 1, 0 ); + * // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] + */ + ndarray( order: Layout, uplo: MatrixTriangle, N: number, alpha: Complex64, AP: Complex64Array, strideAP: number, offsetAP: number, x: Complex64Array, strideX: number, offsetX: number, beta: Complex64, y: Complex64Array, strideY: number, offsetY: number ): Complex64Array; +} + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. +* +* @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 alpha - complex scalar constant +* @param AP - complex input matrix in packed form +* @param x - first complex input vector +* @param strideX - `x` stride length +* @param beta - complex scalar constant +* @param y - second complex input vector +* @param strideY - `y` stride length +* @returns `y` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var A = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chpmv( 'row-major', 'lower', 3, alpha, AP, x, 1, beta, y, 1 ); +* // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var A = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +* var alpha = new Complex64( 0.5, 0.5 ); +* var beta = new Complex64( 0.5, -0.5 ); +* +* chpmv.ndarray( 'row-major', 'lower', 3, alpha, AP, 1, 0, x, 1, 0, beta, y, 1, 0 ); +* // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +*/ +declare var chpmv: Routine; + + +// EXPORTS // + +export = chpmv; From bf8d3376c22617ca5929996d3440d1c32bd7c759 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 3 Apr 2026 05:57:00 +0000 Subject: [PATCH 17/33] docs: types tests added --- 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/chpmv/docs/types/test.ts | 521 ++++++++++++++++++ 1 file changed, 521 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/docs/types/test.ts diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/chpmv/docs/types/test.ts new file mode 100644 index 000000000000..0d20b258d3a0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/docs/types/test.ts @@ -0,0 +1,521 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import Complex64Array = require( '@stdlib/array/complex64' ); +import Complex64 = require( '@stdlib/complex/float32/ctor' ); +import chpmv = require( './index' ); + + +// TESTS // + +// The function returns a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 1.0, 0.0 ); + const beta = new Complex64( 1.0, 0.0 ); + + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectType Complex64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv( 10, 'lower', 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( true, 'lower', 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( false, 'lower', 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( null, 'lower', 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( undefined, 'lower', 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( [], 'lower', 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( {}, 'lower', 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( ( x: number ): number => x, 'lower', 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv( 'row-major', 10, 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', true, 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', false, 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', null, 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', undefined, 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', [], 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', {}, 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', ( x: number ): number => x, 10, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv( 'row-major', 'lower', '10', alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', true, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', false, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', null, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', undefined, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', [], alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', {}, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', ( x: number ): number => x, alpha, AP, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a forth argument which is not a Complex64... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv( 'row-major', 'lower', 10, '10', AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, true, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, false, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, null, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, undefined, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, [], AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, {}, AP, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, ( x: number ): number => x, AP, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv( 'row-major', 'lower', 10, alpha, 10, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, '10', x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, true, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, false, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, null, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, undefined, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, [ '1' ], x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, {}, x, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, ( x: number ): number => x, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an sixth argument which is not a Complex64Array... +{ + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv( 'row-major', 'lower', 10, alpha, AP, 10, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, '10', 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, true, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, false, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, null, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, undefined, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, [ '1' ], 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, {}, 1, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, ( x: number ): number => x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv( 'row-major', 'lower', 10, alpha, AP, x, '10', beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, true, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, false, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, null, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, undefined, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, [], beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, {}, beta, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, ( x: number ): number => x, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eighth argument which is not a Complex64... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, '10', y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, 1.0, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, true, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, false, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, null, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, undefined, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, [], y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, {}, y, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, ( x: number ): number => x, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an ninth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, 10, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, '10', 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, true, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, false, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, null, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, undefined, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, [], 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, {}, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, y, '10' ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, y, true ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, y, false ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, y, null ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, y, undefined ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, y, [] ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, y, {} ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, y, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv(); // $ExpectError + chpmv( 'row-major' ); // $ExpectError + chpmv( 'row-major', 'lower' ); // $ExpectError + chpmv( 'row-major', 'lower', 10 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1 ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, y ); // $ExpectError + chpmv( 'row-major', 'lower', 10, alpha, AP, x, 1, beta, y, 1, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns aP Complex64Array... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectType Complex64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray( 10, 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( true, 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( false, 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( null, 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( undefined, 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( [ '1' ], 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( {}, 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( ( x: number ): number => x, 'lower', 10, alpha, AP, 10, 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 string... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray( 'row-major', '10', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', true, 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', false, 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', null, 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', undefined, 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', [], 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', {}, 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', ( x: number ): number => x, 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray( 'row-major', 'lower', '10', alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', true, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', false, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', null, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', undefined, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', [], alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', {}, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', ( x: number ): number => x, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a forth argument which is not a Complex64... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray( 'row-major', 'lower', 10, 10, AP, 0, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, '10', AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, true, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, false, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, null, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, undefined, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, [], AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, {}, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, ( x: number ): number => x, AP, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray( 'row-major', 'lower', 10, alpha, '10', 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, true, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, false, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, null, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, undefined, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, [], 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, {}, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, ( x: number ): number => x, 10, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, '10', 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, true, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, false, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, null, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, undefined, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, [], 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, {}, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, ( x: number ): number => x, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, '10', x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, true, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, false, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, null, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, undefined, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, [], x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, {}, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, ( x: number ): number => x, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eighth argument which is not a Complex64Array... +{ + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, 10, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, '10', 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, true, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, false, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, null, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, undefined, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, [], 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, {}, 1, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, ( x: number ): number => 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 number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, '10', 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, true, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, false, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, null, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, undefined, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, [], 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, {}, 0, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, ( x: number ): number => x, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, '10', beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, true, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, false, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, null, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, undefined, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, [], beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, {}, beta, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, ( x: number ): number => x, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eleventh argument which is not a Complex64... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, '10', y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, 10, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, true, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, false, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, null, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, undefined, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, [], y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, {}, y, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, ( x: number ): number => x, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a twelfth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, 10, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, '10', 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, true, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, false, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, null, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, undefined, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, [], 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, {}, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a thirteenth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, '10', 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, true, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, false, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, null, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, undefined, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, [], 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, {}, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourteenth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, '10' ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, true ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, false ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, null ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, undefined ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, [] ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, {} ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const AP = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chpmv.ndarray(); // $ExpectError + chpmv.ndarray( 'row-major', 'lower' ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1 ); // $ExpectError + chpmv.ndarray( 'row-major', 'lower', 10, alpha, AP, 10, 0, x, 1, 0, beta, y, 1, 0, 10 ); // $ExpectError +} From 33b932ef75f01fa709b0fba504732e8d60efa4f5 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 3 Apr 2026 06:24:19 +0000 Subject: [PATCH 18/33] docs: repl.txt added --- 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/chpmv/docs/repl.txt | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/docs/repl.txt diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/chpmv/docs/repl.txt new file mode 100644 index 000000000000..2f14136778ef --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/docs/repl.txt @@ -0,0 +1,172 @@ + +{{alias}}( order, uplo, N, α, AP, x, sx, β, y, sy ) + Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` + are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is + an `N` by `N` Hermitian matrix supplied in packed form. + + 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`. + + α: Complex64 + Complex scalar constant. + + AP: Complex64Array + Complex input matrix in packed form. + + x: Complex64Array + First complex input vector. + + sx: integer + Index increment for `x`. + + β: Complex64 + Complex scalar constant. + + y: Complex64Array + Second complex input vector. + + sy: integer + Index increment for `y`. + + Returns + ------- + y: Complex64Array + Second complex input vector. + + Examples + -------- + // Standard usage: + > var x = new {{alias:@stdlib/array/complex64}}([1.0,1.0,2.0,2.0,3.0,3.0]); + > var y = new {{alias:@stdlib/array/complex64}}([3.0,3.0,2.0,2.0,1.0,1.0]); + > var buf = [1.0,0.0,2.0,-2.0,4.0,0.0,3.0,-3.0,5.0,-5.0,6.0,0.0]; + > var AP = new {{alias:@stdlib/array/complex64}}(buf); + > var alpha = new {{alias:@stdlib/complex/float32/ctor}}(0.5,0.5); + > var beta = new {{alias:@stdlib/complex/float32/ctor}}(0.5,-0.5); + > var ord = 'row-major'; + > var uplo = 'lower'; + > {{alias}}( ord, uplo, 3, alpha, AP, x, 1, beta, y, 1 ) + [-10.0,14.0,-11.0,25.0,14.0,31.0] + + // Advanced indexing: + > x = new {{alias:@stdlib/array/complex64}}([3.0,3.0,2.0,2.0,1.0,1.0]); + > y = new {{alias:@stdlib/array/complex64}}([1.0,1.0,2.0,2.0,3.0,3.0]); + > buf = [1.0,0.0,2.0,-2.0,4.0,0.0,3.0,-3.0,5.0,-5.0,6.0,0.0]; + > AP = new {{alias:@stdlib/array/complex64}}(buf); + > alpha = new {{alias:@stdlib/complex/float32/ctor}}(0.5,0.5); + > beta = new {{alias:@stdlib/complex/float32/ctor}}(0.5,-0.5); + > ord = 'row-major'; + > uplo = 'lower'; + > {{alias}}( ord, uplo, 3, alpha, AP, x, -1, beta, y, -1 ) + [14.0,31.0,-11.0,25.0,-10.0,14.0] + + // Using typed array views: + > var x0buf = [0.0,0.0,3.0,3.0,2.0,2.0,1.0,1.0]; + > var x0 = new {{alias:@stdlib/array/complex64}}( x0buf ); + > var y0buf = [0.0,0.0,1.0,1.0,2.0,2.0,3.0,3.0]; + > var y0 = new {{alias:@stdlib/array/complex64}}( y0buf ); + > var x0bytes = x0.BYTES_PER_ELEMENT*1; + > var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, x0bytes ); + > var y0bytes = y0.BYTES_PER_ELEMENT*1; + > var y1 = new {{alias:@stdlib/array/complex64}}( y0.buffer, y0bytes ); + > buf = [1.0,0.0,2.0,-2.0,4.0,0.0,3.0,-3.0,5.0,-5.0,6.0,0.0]; + > AP = new {{alias:@stdlib/array/complex64}}( buf ); + > alpha = new {{alias:@stdlib/complex/float32/ctor}}(0.5,0.5); + > beta = new {{alias:@stdlib/complex/float32/ctor}}(0.5,-0.5); + > ord = 'row-major'; + > uplo = 'lower'; + > {{alias}}( ord, uplo, 3, alpha, AP, x1, -1, beta, y1, -1 ) + [14.0,31.0,-11.0,25.0,-10.0,14.0] + + +{{alias}}.ndarray( order, uplo, N, α, AP, sap, oap, x, sx, ox, β, y, sy, oy ) + Performs the matrix-vector operation `y = α*A*x + β*y`, using alternative + indexing semantics and, where `α` and `β` are complex scalars, `x` and `y` + are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix + supplied in packed form. + + While typed array views mandate a view offset based on the underlying buffer + , the offset parameters support indexing semantics based on starting + indices. + + 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 columns in `A`. + + α: Complex64 + Complex scalar constant. + + AP: Complex64Array + Complex input matrix. + + sap: integer + Stride of `AP`. + + oap: integer + Starting index (offset) for `AP`. + + x: Complex64Array + First complex input vector. + + sx: integer + Index increment for `x`. + + ox: integer + Starting index (offset) for `x`. + + β: Complex64 + Complex scalar constant. + + y: Complex64Array + Second complex input vector. + + sy: integer + Index increment for `y`. + + oy: integer + Starting index (offset) for `y`. + + Returns + ------- + y: Complex64Array + Second complex input vector. + + Examples + -------- + > x = new {{alias:@stdlib/array/complex64}}([1.0,1.0,2.0,2.0,3.0,3.0]); + > y = new {{alias:@stdlib/array/complex64}}([3.0,3.0,2.0,2.0,1.0,1.0]); + > buf = [1.0,0.0,2.0,-2.0,4.0,0.0,3.0,-3.0,5.0,-5.0,6.0,0.0]; + > AP = new {{alias:@stdlib/array/complex64}}( buf ); + > alpha = new {{alias:@stdlib/complex/float32/ctor}}(0.5,0.5); + > beta = new {{alias:@stdlib/complex/float32/ctor}}(0.5,-0.5); + > ord = 'row-major'; + > uplo = 'lower'; + > {{alias}}.ndarray(ord,uplo,3,alpha,AP,1,0,x,1,0,beta,y,1,0) + [-10.0,14.0,-11.0,25.0,14.0,31.0] + + See Also + -------- From 9330147fac84e34def70416801f3463ff88b2b17 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 3 Apr 2026 07:34:40 +0000 Subject: [PATCH 19/33] bench: add bechmarks --- 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/chpmv/benchmark/benchmark.js | 124 ++++++++++++++++++ .../base/chpmv/benchmark/benchmark.ndarray.js | 124 ++++++++++++++++++ 2 files changed, 248 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.js new file mode 100644 index 000000000000..d1e434965a85 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.js @@ -0,0 +1,124 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var chpmv = require( './../lib/chpmv.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var APbuf; + var beta; + var xbuf; + var ybuf; + var AP; + var x; + var y; + + xbuf = uniform( N*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + ybuf = uniform( N*2, -100.0, 100.0, options ); + y = new Complex64Array( ybuf.buffer ); + APbuf = uniform( (N*(N+1)/2)*2, -100.0, 100.0, options ); + AP = new Complex64Array( APbuf.buffer ); + + alpha = new Complex64( 0.5, 0.5 ); + beta = new Complex64( 0.5, -0.5 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + var z; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = chpmv( 'row-major', 'lower', N, alpha, AP, 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 len; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s:size=%d', pkg, ( len * ( len + 1 ) / 2 ) ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..f59240289de9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.ndarray.js @@ -0,0 +1,124 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var chpmv = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var APbuf; + var beta; + var xbuf; + var ybuf; + var AP; + var x; + var y; + + xbuf = uniform( N*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + ybuf = uniform( N*2, -100.0, 100.0, options ); + y = new Complex64Array( ybuf.buffer ); + APbuf = uniform( (N*(N+1)/2)*2, -100.0, 100.0, options ); + AP = new Complex64Array( APbuf.buffer ); + + alpha = new Complex64( 0.5, 0.5 ); + beta = new Complex64( 0.5, -0.5 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + var z; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = chpmv( 'row-major', 'lower', N, alpha, AP, 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 len; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s:ndarray:size=%d', pkg, ( len * ( len + 1 ) / 2 ) ), f ); + } +} + +main(); From 9e89ed6cf6719efd06c54e9d8a0ddf9bab015f66 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 3 Apr 2026 07:39:15 +0000 Subject: [PATCH 20/33] bench: 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/chpmv/examples/index.js | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js new file mode 100644 index 000000000000..cc13f5321614 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js @@ -0,0 +1,56 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var logEach = require( '@stdlib/console/log-each' ); +var chpmv = require( './../lib' ); + +function rand() { + return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); +} + +var N = 3; + +var x = filledarrayBy( N, 'complex64', rand ); +console.log( x.get( 0 ).toString() ); + +var y = filledarrayBy( N, 'complex64', rand ); +console.log( y.get( 0 ).toString() ); + +var AP = filledarrayBy( ( N * ( N + 1 ) / 2 ), 'complex64', rand ); +console.log( AP.get( 0 ).toString() ); + +var alpha = new Complex64( 2.0, 3.0 ); +console.log( alpha.toString() ); + +var beta = new Complex64( 3.0, -2.0 ); +console.log( beta.toString() ); + +chpmv( 'row-major', 'lower', N, alpha, AP, x, 1, beta, y, 1 ); + +// Print the results: +logEach( '(%s)', y ); + +chpmv.ndarray( 'row-major', 'lower', N, alpha, AP, 1, 0, x, 1, 0, beta, y, 1, 0 ); + +// Print the results: +logEach( '(%s)', y ); From 23ead7124812e3448e4164da3c4743a3196504e2 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 3 Apr 2026 07:55:21 +0000 Subject: [PATCH 21/33] docs: add readme 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: 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: 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/chpmv/README.md | 294 ++++++++++++++++++ .../@stdlib/blas/base/chpmv/examples/index.js | 2 +- 2 files changed, 295 insertions(+), 1 deletion(-) create mode 100644 lib/node_modules/@stdlib/blas/base/chpmv/README.md diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/README.md b/lib/node_modules/@stdlib/blas/base/chpmv/README.md new file mode 100644 index 000000000000..01c622e2d2f7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chpmv/README.md @@ -0,0 +1,294 @@ + + +# chpmv + +> Performs the matrix-vector operation `y = α*A*x + β*y` for complex-valued data. + +
+ +## Usage + +```javascript +var chpmv = require( '@stdlib/blas/base/chpmv' ); +``` + +#### chpmv( order, uplo, N, α, AP, x, sx, β, y, sy ) + +Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); // eslint-disable-line max-params, max-len +var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +var alpha = new Complex64( 0.5, 0.5 ); +var beta = new Complex64( 0.5, -0.5 ); + +chpmv( 'row-major', 'lower', 3, alpha, AP, x, 1, beta, y, 1 ); +// y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.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`. +- **α**: complex scalar constant. +- **AP**: Complex input matrix in packed form stored in linear memory as a [`Complex64Array`][@stdlib/array/complex64]. +- **x**: complex input vector [`Complex64Array`][@stdlib/array/complex64]. +- **sx**: stride length for `x`. +- **β**: complex scalar constant. +- **y**: output [`Complex64Array`][@stdlib/array/complex64]. +- **sy**: stride length for `y`. + +The stride parameters determine how elements are accessed. For example, to iterate over every other element in `x` and `y`, + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); // eslint-disable-line max-params, max-len +var x = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 0.0, 0.0, 3.0, 3.0 ] ); // eslint-disable-line max-params, max-len +var y = new Complex64Array( [ 3.0, 3.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0 ] ); // eslint-disable-line max-params, max-len +var alpha = new Complex64( 0.5, 0.5 ); +var beta = new Complex64( 0.5, -0.5 ); + +chpmv( 'row-major', 'lower', 3, alpha, AP, x, 3, beta, y, 2 ); +// y => [ -10.0, 14.0, 0.0, 0.0, -11.0, 25.0, 0.0, 0.0, 14.0, 31.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +// Initial arrays... +var x0 = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +var y0 = new Complex64Array( [ 0.0, 0.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); // eslint-disable-line max-params, max-len +var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); // eslint-disable-line max-params, max-len +var alpha = new Complex64( 0.5, 0.5 ); +var beta = new Complex64( 0.5, -0.5 ); + +// Create offset views... +var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd complex element +var y1 = new Complex64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd complex element + +chpmv( 'row-major', 'lower', 3, alpha, AP, x1, 1, beta, y1, 1 ); +// y1 => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +``` + + + +#### chpmv.ndarray( order, uplo, N, α, A, sap, oap, x, sx, ox, β, y, sy, oy ) + +Performs the matrix-vector operation `y = α*A*x + β*y` using alternative indexing semantics, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); // eslint-disable-line max-params, max-len +var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +var alpha = new Complex64( 0.5, 0.5 ); +var beta = new Complex64( 0.5, -0.5 ); + +chpmv.ndarray( 'row-major', 'lower', 3, alpha, AP, 1, 0, x, 1, 0, beta, y, 1, 0 ); +// y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +``` + +The function has the following additional parameters: + +- **sap**: stride of `AP`.. +- **oap**: starting index for `AP`. +- **ox**: starting index for `x`. +- **oy**: starting index for `y`. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); // eslint-disable-line max-params, max-len +var x = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +var y = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0 ] ); // eslint-disable-line max-params, max-len + +var alpha = new Complex64( 0.5, 0.5 ); +var beta = new Complex64( 0.5, -0.5 ); + +chpmv.ndarray( 'row-major', 'lower', 3, alpha, AP, 1, 0, x, 1, 1, beta, y, -2, 4 ); +// y => [ 14.0, 31.0, 0.0, 0.0, -11.0, 25.0, 0.0, 0.0, -10.0, 14.0 ] +``` + +
+ + + +
+ +## Notes + +- `chpmv()` corresponds to the [BLAS][blas] level 2 function [`chpmv`][chpmv]. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var logEach = require( '@stdlib/console/log-each' ); +var chpmv = require( '@stdlib/blas/base/chpmv' ); + +function rand() { + return new Complex64( discreteUniform( 0, 255 ), discreteUniform( -128, 127 ) ); // eslint-disable-line max-params, max-len +} + +var N = 5; + +var AP = filledarrayBy( N * ( N + 1 ) / 2, 'complex64', rand ); +var x = filledarrayBy( N, 'complex64', rand ); +var y = filledarrayBy( N, 'complex64', rand ); + +var alpha = new Complex64( 0.5, 0.5 ); +var beta = new Complex64( 0.5, -0.5 ); + +chpmv( 'row-major', 'lower', N, alpha, AP, x, 1, beta, y, 1 ); + +// Print the results: +logEach( '(%s)', x ); + +chpmv.ndarray( 'row-major', 'lower', N, alpha, AP, 1, 0, x, 1, 0, beta, y, 1, 0 ); + +// Print the results: +logEach( '(%s)', x ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js index cc13f5321614..f493fc7fed14 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js @@ -42,7 +42,7 @@ console.log( AP.get( 0 ).toString() ); var alpha = new Complex64( 2.0, 3.0 ); console.log( alpha.toString() ); -var beta = new Complex64( 3.0, -2.0 ); +var beta = new Complex64( 0.0, 0.0 ); console.log( beta.toString() ); chpmv( 'row-major', 'lower', N, alpha, AP, x, 1, beta, y, 1 ); From af7ca6ae308cb36cb3524db7ccc1b0ca12752e68 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 3 Apr 2026 07:56:00 +0000 Subject: [PATCH 22/33] docs: add readme 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: 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 --- --- lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js index f493fc7fed14..cc13f5321614 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js @@ -42,7 +42,7 @@ console.log( AP.get( 0 ).toString() ); var alpha = new Complex64( 2.0, 3.0 ); console.log( alpha.toString() ); -var beta = new Complex64( 0.0, 0.0 ); +var beta = new Complex64( 3.0, -2.0 ); console.log( beta.toString() ); chpmv( 'row-major', 'lower', N, alpha, AP, x, 1, beta, y, 1 ); From b97c3cfe270c1166bf5ac3a0fe6fd9737d6cbd6e Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 9 Apr 2026 14:20:44 +0000 Subject: [PATCH 23/33] docs: update link to chpmv --- 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/chpmv/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/README.md b/lib/node_modules/@stdlib/blas/base/chpmv/README.md index 01c622e2d2f7..c86934dd7774 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/chpmv/README.md @@ -283,7 +283,7 @@ TODO [blas]: http://www.netlib.org/blas -[chpmv]: https://www.netlib.org/lapack/explore-html/d7/dda/group__gemv_ga44c85a0d7ecd60a6bc8ca27b222d7792.html#ga44c85a0d7ecd60a6bc8ca27b222d7792 +[chpmv]: https://www.netlib.org/lapack/explore-html/d0/d4b/group__hpmv_ga8615e798761db472ab0abb8f67594287.html#ga8615e798761db472ab0abb8f67594287 [mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray From c9c769c14edbd70a97ae50b288c36eb9b11677e2 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 9 Apr 2026 14:25:48 +0000 Subject: [PATCH 24/33] test: cover zero-beta branch --- 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 --- --- .../blas/base/chpmv/test/test.chpmv.js | 54 +++++++++++++++++++ .../blas/base/chpmv/test/test.ndarray.js | 54 +++++++++++++++++++ 2 files changed, 108 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.chpmv.js b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.chpmv.js index 42d3a1736f66..4dba315136fd 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.chpmv.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.chpmv.js @@ -517,6 +517,60 @@ tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vec 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 ap; + var x; + var y; + + data = ra; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 0.0, 0.0 ); + + expected = new Complex64Array( data.y.length ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.deepEqual( 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 ap; + var x; + var y; + + data = ca; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 0.0, 0.0 ); + + expected = new Complex64Array( data.y.length ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); + t.deepEqual( 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; diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js index 5dc265b65533..cff98bba371a 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js @@ -564,6 +564,60 @@ tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vec 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 ap; + var x; + var y; + + data = ra; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 0.0, 0.0 ); + + expected = new Complex64Array( data.y.length ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.deepEqual( 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 ap; + var x; + var y; + + data = ca; + + ap = new Complex64Array( data.AP ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 0.0, 0.0 ); + + expected = new Complex64Array( data.y.length ); + + out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.deepEqual( 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; From a096f9411033193a399686884a5003a0e17a22fa Mon Sep 17 00:00:00 2001 From: Divit Date: Wed, 15 Apr 2026 06:33:26 +0000 Subject: [PATCH 25/33] test: update validation --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: 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 --- --- lib/node_modules/@stdlib/blas/base/chpmv/lib/ndarray.js | 1 - lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/chpmv/lib/ndarray.js index ef8183d95087..64e053835fc9 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/lib/ndarray.js @@ -50,7 +50,6 @@ var base = require( './base.js' ); * @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} fifth argument must be non-zero * @throws {RangeError} sixth argument must be non-zero * @throws {RangeError} ninth argument must be non-zero * @throws {RangeError} thirteenth argument must be non-zero diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js index cff98bba371a..040b96f664f5 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js @@ -150,7 +150,7 @@ tape( 'the function throws an error if provided an invalid second argument', fun } }); -tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { +tape( 'the function throws an error if provided an invalid third argument', function test( t ) { var values; var alpha; var data; From c918c8e8fa83f74960805174782d99fdf4df8485 Mon Sep 17 00:00:00 2001 From: Divit Date: Wed, 15 Apr 2026 19:22:52 +0000 Subject: [PATCH 26/33] refactor: improve float32 precision for addition assignment --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/chpmv/lib/base.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js index dbfda8389d8d..30c503216654 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js @@ -153,8 +153,8 @@ function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offse retmp2 = 0.0; imtmp2 = 0.0; reap = viewAP[ kk ]; - viewY[ jy ] += f32( retmp1 * reap ); - viewY[ jy + 1 ] += f32( imtmp1 * reap ); + viewY[ jy ] = f32( viewY[ jy ] + ( retmp1 * reap ) ); + viewY[ jy + 1 ] = f32( viewY[ jy + 1 ] + ( imtmp1 * reap ) ); ix = jx + sx; iy = jy + sy; iap = kk + sap; @@ -165,8 +165,8 @@ function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offse muladd( retmp1, imtmp1, reap, cimap, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len rex = viewX[ ix ]; imx = viewX[ ix + 1 ]; - retmp2 += f32( ( reap * rex ) + ( cimap * imx ) ); - imtmp2 += f32( ( reap * imx ) - ( cimap * rex ) ); + retmp2 = f32( retmp2 + f32( ( reap * rex ) + ( cimap * imx ) ) ); + imtmp2 = f32( imtmp2 + f32( ( reap * imx ) - ( cimap * rex ) ) ); ix += sx; iy += sy; iap += sap; @@ -197,15 +197,15 @@ function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offse muladd( retmp1, imtmp1, reap, cimap, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len rex = viewX[ ix ]; imx = viewX[ ix + 1 ]; - retmp2 += f32( ( reap * rex ) + ( cimap * imx ) ); - imtmp2 += f32( ( reap * imx ) - ( cimap * rex ) ); + retmp2 = f32( retmp2 + f32( ( reap * rex ) + ( cimap * imx ) ) ); + imtmp2 = f32( imtmp2 + f32( ( reap * imx ) - ( cimap * rex ) ) ); ix += sx; iy += sy; iap += sap; } reap = viewAP[ iap ]; - viewY[ jy ] += f32( retmp1 * reap ); - viewY[ jy + 1 ] += f32( imtmp1 * reap ); + viewY[ jy ] = f32( viewY[ jy ] + ( retmp1 * reap ) ); + viewY[ jy + 1 ] = f32( viewY[ jy + 1 ] + ( imtmp1 * reap ) ); muladd( realpha, imalpha, retmp2, imtmp2, viewY[ jy ], viewY[ jy + 1 ], viewY, 1, jy ); // eslint-disable-line max-len jx += sx; jy += sy; From e6335114ad76129e36b30c22563d5655a45aab27 Mon Sep 17 00:00:00 2001 From: Divit Date: Wed, 15 Apr 2026 19:33:29 +0000 Subject: [PATCH 27/33] refactor: update variable names --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/chpmv/lib/base.js | 96 ++++++++++--------- 1 file changed, 49 insertions(+), 47 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js index 30c503216654..150c2e5b89e4 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js @@ -86,17 +86,18 @@ function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offse var sap; var rex; var imx; - var ix; - var jx; - var kx; - var iy; - var jy; - var ky; + var ix0; + var ix1; + var iy0; + var iy1; + var i0; + var i1; + var oa; + var ox; + var oy; var sx; var sy; var kk; - var k; - var j; // Layout isrm = isRowMajor( order ); @@ -132,84 +133,85 @@ function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offse } // Vector indexing base - kk = offsetAP * 2; - kx = offsetX * 2; - ky = offsetY * 2; + oa = offsetAP * 2; + ox = offsetX * 2; + oy = offsetY * 2; // Vector strides sx = strideX * 2; sy = strideY * 2; sap = strideAP * 2; - jx = kx; - jy = ky; + kk = oa; + ix1 = ox; + iy1 = oy; if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { - for ( j = 0; j < N; j++ ) { - rex = viewX[ jx ]; - imx = viewX[ jx + 1 ]; + for ( i1 = 0; i1 < N; i1++ ) { + rex = viewX[ ix1 ]; + imx = viewX[ ix1 + 1 ]; retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); retmp2 = 0.0; imtmp2 = 0.0; reap = viewAP[ kk ]; - viewY[ jy ] = f32( viewY[ jy ] + ( retmp1 * reap ) ); - viewY[ jy + 1 ] = f32( viewY[ jy + 1 ] + ( imtmp1 * reap ) ); - ix = jx + sx; - iy = jy + sy; + viewY[ iy1 ] = f32( viewY[ iy1 ] + ( retmp1 * reap ) ); + viewY[ iy1 + 1 ] = f32( viewY[ iy1 + 1 ] + ( imtmp1 * reap ) ); + ix0 = ix1 + sx; + iy0 = iy1 + sy; iap = kk + sap; - for ( k = j + 1; k < N; k++ ) { + for ( i0 = i1 + 1; i0 < N; i0++ ) { reap = viewAP[ iap ]; imap = viewAP[ iap + 1 ]; cimap = sign * imap; - muladd( retmp1, imtmp1, reap, cimap, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len - rex = viewX[ ix ]; - imx = viewX[ ix + 1 ]; + muladd( retmp1, imtmp1, reap, cimap, viewY[ iy0 ], viewY[ iy0 + 1 ], viewY, 1, iy0 ); // eslint-disable-line max-len + rex = viewX[ ix0 ]; + imx = viewX[ ix0 + 1 ]; retmp2 = f32( retmp2 + f32( ( reap * rex ) + ( cimap * imx ) ) ); imtmp2 = f32( imtmp2 + f32( ( reap * imx ) - ( cimap * rex ) ) ); - ix += sx; - iy += sy; + ix0 += sx; + iy0 += sy; iap += sap; } - muladd( realpha, imalpha, retmp2, imtmp2, viewY[ jy ], viewY[ jy + 1 ], viewY, 1, jy ); // eslint-disable-line max-len - jx += sx; - jy += sy; - kk += ( N - j ) * sap; + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy1 ], viewY[ iy1 + 1 ], viewY, 1, iy1 ); // eslint-disable-line max-len + ix1 += sx; + iy1 += sy; + kk += ( N - i1 ) * sap; } return y; } // ( isrm && uplo === 'lower' ) || ( !isrm && uplo === 'upper' ) - for ( j = 0; j < N; j++ ) { - rex = viewX[ jx ]; - imx = viewX[ jx + 1 ]; + for ( i1 = 0; i1 < N; i1++ ) { + rex = viewX[ ix1 ]; + imx = viewX[ ix1 + 1 ]; retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); retmp2 = 0.0; imtmp2 = 0.0; - ix = kx; - iy = ky; + ix0 = ox; + iy0 = oy; iap = kk; - for ( k = 0; k < j; k++ ) { + for ( i0 = 0; i0 < i1; i0++ ) { reap = viewAP[ iap ]; imap = viewAP[ iap + 1 ]; cimap = sign * imap; - muladd( retmp1, imtmp1, reap, cimap, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len - rex = viewX[ ix ]; - imx = viewX[ ix + 1 ]; + muladd( retmp1, imtmp1, reap, cimap, viewY[ iy0 ], viewY[ iy0 + 1 ], viewY, 1, iy0 ); // eslint-disable-line max-len + rex = viewX[ ix0 ]; + imx = viewX[ ix0 + 1 ]; retmp2 = f32( retmp2 + f32( ( reap * rex ) + ( cimap * imx ) ) ); imtmp2 = f32( imtmp2 + f32( ( reap * imx ) - ( cimap * rex ) ) ); - ix += sx; - iy += sy; + ix0 += sx; + iy0 += sy; iap += sap; } reap = viewAP[ iap ]; - viewY[ jy ] = f32( viewY[ jy ] + ( retmp1 * reap ) ); - viewY[ jy + 1 ] = f32( viewY[ jy + 1 ] + ( imtmp1 * reap ) ); - muladd( realpha, imalpha, retmp2, imtmp2, viewY[ jy ], viewY[ jy + 1 ], viewY, 1, jy ); // eslint-disable-line max-len - jx += sx; - jy += sy; - kk += ( j + 1 ) * sap; + viewY[ iy1 ] = f32( viewY[ iy1 ] + ( retmp1 * reap ) ); + viewY[ iy1 + 1 ] = f32( viewY[ iy1 + 1 ] + ( imtmp1 * reap ) ); + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy1 ], viewY[ iy1 + 1 ], viewY, 1, iy1 ); // eslint-disable-line max-len + ix1 += sx; + iy1 += sy; + kk += ( i1 + 1 ) * sap; } return y; } From 3bfab67090767d3c63ebeafcb579f0d5898f5735 Mon Sep 17 00:00:00 2001 From: Divit Date: Sat, 18 Apr 2026 16:55:45 +0000 Subject: [PATCH 28/33] chore: clean up in 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 --- --- .../@stdlib/blas/base/chpmv/benchmark/benchmark.js | 4 ++-- .../@stdlib/blas/base/chpmv/benchmark/benchmark.ndarray.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.js index d1e434965a85..31ded3035e12 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.js @@ -83,12 +83,12 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { z = chpmv( 'row-major', 'lower', N, alpha, AP, x, 1, beta, y, 1 ); - if ( isnanf( z[ i% ( z.length ) ] ) ) { + if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnanf( z[ i % ( z.length ) ] ) ) { + if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.ndarray.js index f59240289de9..49bca7d17b70 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/benchmark/benchmark.ndarray.js @@ -83,12 +83,12 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { z = chpmv( 'row-major', 'lower', N, alpha, AP, 1, 0, x, 1, 0, beta, y, 1, 0 ); - if ( isnanf( z[ i % ( z.length ) ] ) ) { + if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnanf( z[ i % ( z.length ) ] ) ) { + if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); From 3c582396102654eedfc351faa250e13853872678 Mon Sep 17 00:00:00 2001 From: Divit Date: Sat, 18 Apr 2026 16:59:13 +0000 Subject: [PATCH 29/33] chore: clean up in docs --- 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: passed - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/chpmv/docs/repl.txt | 40 +++++++++---------- .../blas/base/chpmv/docs/types/index.d.ts | 36 ++++++++--------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/chpmv/docs/repl.txt index 2f14136778ef..2bab1a6c4f4c 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/chpmv/docs/repl.txt @@ -1,13 +1,13 @@ {{alias}}( order, uplo, N, α, AP, x, sx, β, y, sy ) Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` - are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is - an `N` by `N` Hermitian matrix supplied in packed form. + are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` + Hermitian matrix supplied in packed form. 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 `N` is equal to `0`, the function returns `y` unchanged. If `α` equals `0 + 0i` and `β` equals `1 + 0i`, the function returns `y` unchanged. @@ -25,22 +25,22 @@ Number of elements along each dimension of `A`. α: Complex64 - Complex scalar constant. + Scalar constant. AP: Complex64Array - Complex input matrix in packed form. + Input matrix in packed form. x: Complex64Array - First complex input vector. + First input vector. sx: integer Index increment for `x`. β: Complex64 - Complex scalar constant. + Scalar constant. y: Complex64Array - Second complex input vector. + Second input vector. sy: integer Index increment for `y`. @@ -48,7 +48,7 @@ Returns ------- y: Complex64Array - Second complex input vector. + Second input vector. Examples -------- @@ -97,12 +97,12 @@ {{alias}}.ndarray( order, uplo, N, α, AP, sap, oap, x, sx, ox, β, y, sy, oy ) Performs the matrix-vector operation `y = α*A*x + β*y`, using alternative - indexing semantics and, where `α` and `β` are complex scalars, `x` and `y` - are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix - supplied in packed form. + indexing semantics and, where `α` and `β` are scalars, `x` and `y` are `N` + element vectors, and `A` is an `N` by `N` Hermitian matrix supplied in + packed form. - While typed array views mandate a view offset based on the underlying buffer - , the offset parameters support indexing semantics based on starting + While typed array views mandate a view offset based on the underlying + buffer, the offset parameters support indexing semantics based on starting indices. Parameters @@ -118,10 +118,10 @@ Number of columns in `A`. α: Complex64 - Complex scalar constant. + Scalar constant. AP: Complex64Array - Complex input matrix. + Input matrix. sap: integer Stride of `AP`. @@ -130,7 +130,7 @@ Starting index (offset) for `AP`. x: Complex64Array - First complex input vector. + First input vector. sx: integer Index increment for `x`. @@ -139,10 +139,10 @@ Starting index (offset) for `x`. β: Complex64 - Complex scalar constant. + Scalar constant. y: Complex64Array - Second complex input vector. + Second input vector. sy: integer Index increment for `y`. @@ -153,7 +153,7 @@ Returns ------- y: Complex64Array - Second complex input vector. + Second input vector. Examples -------- diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/chpmv/docs/types/index.d.ts index cd3aae4cce12..93fec4d8f982 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/chpmv/docs/types/index.d.ts @@ -29,17 +29,17 @@ import { Complex64 } from '@stdlib/types/complex'; */ interface Routine { /** - * Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. + * Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. * * @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 alpha - complex scalar constant - * @param AP - complex input matrix in packed form - * @param x - first complex input vector + * @param alpha - scalar constant + * @param AP - input matrix in packed form + * @param x - first input vector * @param strideX - `x` stride length - * @param beta - complex scalar constant - * @param y - second complex input vector + * @param beta - scalar constant + * @param y - second input vector * @param strideY - `y` stride length * @returns `y` * @@ -59,20 +59,20 @@ interface Routine { ( order: Layout, uplo: MatrixTriangle, N: number, alpha: Complex64, AP: Complex64Array, x: Complex64Array, strideX: number, beta: Complex64, y: Complex64Array, strideY: number ): Complex64Array; /** - * Performs the matrix-vector operation `y = α*A*x + β*y`, using alternative indexing semantics. + * Performs the matrix-vector operation `y = α*A*x + β*y`, using alternative indexing semantics and where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. * * @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 alpha - complex scalar constant - * @param AP - complex input matrix in packed form + * @param alpha - scalar constant + * @param AP - input matrix in packed form * @param strideAP - `AP` stride length * @param offsetAP - starting index for `AP` - * @param x - first complex input vector + * @param x - first input vector * @param strideX - `x` stride length * @param offsetX - starting index for `x` - * @param beta - complex scalar constant - * @param y - second complex input vector + * @param beta - scalar constant + * @param y - second input vector * @param strideY - `y` stride length * @param offsetY - starting index for `y` * @returns `y` @@ -94,17 +94,17 @@ interface Routine { } /** -* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. * * @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 alpha - complex scalar constant -* @param AP - complex input matrix in packed form -* @param x - first complex input vector +* @param alpha - scalar constant +* @param AP - input matrix in packed form +* @param x - first input vector * @param strideX - `x` stride length -* @param beta - complex scalar constant -* @param y - second complex input vector +* @param beta - scalar constant +* @param y - second input vector * @param strideY - `y` stride length * @returns `y` * From 45b492b27a0fd7ce3ac22f3211c9c5eaf5c200db Mon Sep 17 00:00:00 2001 From: Divit Date: Sat, 18 Apr 2026 17:00:19 +0000 Subject: [PATCH 30/33] chore: clean up in 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/chpmv/examples/index.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js index cc13f5321614..6b6d413f3537 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/examples/index.js @@ -31,26 +31,18 @@ function rand() { var N = 3; var x = filledarrayBy( N, 'complex64', rand ); -console.log( x.get( 0 ).toString() ); - var y = filledarrayBy( N, 'complex64', rand ); -console.log( y.get( 0 ).toString() ); - var AP = filledarrayBy( ( N * ( N + 1 ) / 2 ), 'complex64', rand ); -console.log( AP.get( 0 ).toString() ); var alpha = new Complex64( 2.0, 3.0 ); -console.log( alpha.toString() ); - var beta = new Complex64( 3.0, -2.0 ); -console.log( beta.toString() ); chpmv( 'row-major', 'lower', N, alpha, AP, x, 1, beta, y, 1 ); // Print the results: -logEach( '(%s)', y ); +logEach( '%s', y ); chpmv.ndarray( 'row-major', 'lower', N, alpha, AP, 1, 0, x, 1, 0, beta, y, 1, 0 ); // Print the results: -logEach( '(%s)', y ); +logEach( '%s', y ); From 7002bc3af7f0ba1f0f42bbe8904c988a237ac9e2 Mon Sep 17 00:00:00 2001 From: Divit Date: Sat, 18 Apr 2026 17:14:29 +0000 Subject: [PATCH 31/33] chore: clean up in 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: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/chpmv/lib/base.js | 77 ++++++++----------- .../@stdlib/blas/base/chpmv/lib/chpmv.js | 25 ++---- .../@stdlib/blas/base/chpmv/lib/index.js | 3 +- .../@stdlib/blas/base/chpmv/lib/ndarray.js | 26 ++----- 4 files changed, 49 insertions(+), 82 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js index 150c2e5b89e4..f23e34eab1ac 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js @@ -33,21 +33,21 @@ var muladd = require( '@stdlib/complex/float32/base/mul-add' ).assign; // MAIN // /** -* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. * * @private * @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 {Complex64} alpha - complex scalar constant -* @param {Complex64Array} AP - complex input matrix in packed form +* @param {Complex64} alpha - scalar constant +* @param {Complex64Array} AP - input matrix in packed form * @param {integer} strideAP - `AP` stride length * @param {NonNegativeInteger} offsetAP - starting index for `AP` -* @param {Complex64Array} x - first complex input vector +* @param {Complex64Array} x - first input vector * @param {integer} strideX - `x` stride length * @param {NonNegativeInteger} offsetX - starting index for `x` -* @param {Complex64} beta - complex scalar constant -* @param {Complex64Array} y - second complex input vector +* @param {Complex64} beta - scalar constant +* @param {Complex64Array} y - second input vector * @param {integer} strideY - `y` stride length * @param {NonNegativeInteger} offsetY - starting index for `y` * @returns {Complex64Array} `y` @@ -99,7 +99,8 @@ function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offse var sy; var kk; - // Layout + // Note on variable naming convention: sa#, ix#, i# where # corresponds to the loop number, with `0` being the innermost loop... + isrm = isRowMajor( order ); // Decompose scalars @@ -114,79 +115,69 @@ function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offse } else if ( rebeta !== 1.0 || imbeta !== 0.0 ) { cscal( N, beta, y, strideY, offsetY ); } - - // If alpha is zero, early return y if ( realpha === 0.0 && imalpha === 0.0 ) { return y; } - - // Reinterpret arrays to raw numeric views + // Reinterpret arrays to real-valued views viewAP = reinterpret( AP, 0 ); viewX = reinterpret( x, 0 ); viewY = reinterpret( y, 0 ); - - // Adjust sign to account for layout-dependent conjugation if ( isrm ) { sign = -1; } else { sign = 1; } - - // Vector indexing base oa = offsetAP * 2; ox = offsetX * 2; oy = offsetY * 2; - - // Vector strides sx = strideX * 2; sy = strideY * 2; sap = strideAP * 2; + // Form: y = alpha*A*x + y kk = oa; ix1 = ox; iy1 = oy; - if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { for ( i1 = 0; i1 < N; i1++ ) { rex = viewX[ ix1 ]; - imx = viewX[ ix1 + 1 ]; - retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); - imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); + imx = viewX[ ix1+1 ]; + retmp1 = f32(f32(realpha*rex) - f32(imalpha*imx)); + imtmp1 = f32(f32(realpha*imx) + f32(imalpha*rex)); retmp2 = 0.0; imtmp2 = 0.0; reap = viewAP[ kk ]; - viewY[ iy1 ] = f32( viewY[ iy1 ] + ( retmp1 * reap ) ); - viewY[ iy1 + 1 ] = f32( viewY[ iy1 + 1 ] + ( imtmp1 * reap ) ); + viewY[ iy1 ] = f32(viewY[ iy1 ] + (retmp1*reap)); + viewY[ iy1+1 ] = f32(viewY[ iy1+1 ] + (imtmp1*reap)); ix0 = ix1 + sx; iy0 = iy1 + sy; iap = kk + sap; for ( i0 = i1 + 1; i0 < N; i0++ ) { reap = viewAP[ iap ]; - imap = viewAP[ iap + 1 ]; + imap = viewAP[ iap+1 ]; cimap = sign * imap; - muladd( retmp1, imtmp1, reap, cimap, viewY[ iy0 ], viewY[ iy0 + 1 ], viewY, 1, iy0 ); // eslint-disable-line max-len + muladd( retmp1, imtmp1, reap, cimap, viewY[ iy0 ], viewY[ iy0+1 ], viewY, 1, iy0 ); // eslint-disable-line max-len rex = viewX[ ix0 ]; - imx = viewX[ ix0 + 1 ]; - retmp2 = f32( retmp2 + f32( ( reap * rex ) + ( cimap * imx ) ) ); - imtmp2 = f32( imtmp2 + f32( ( reap * imx ) - ( cimap * rex ) ) ); + imx = viewX[ ix0+1 ]; + retmp2 = f32(retmp2 + f32(reap*rex) + f32(cimap*imx)); + imtmp2 = f32(imtmp2 + f32(reap*imx) - f32(cimap*rex)); ix0 += sx; iy0 += sy; iap += sap; } - muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy1 ], viewY[ iy1 + 1 ], viewY, 1, iy1 ); // eslint-disable-line max-len + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy1 ], viewY[ iy1+1 ], viewY, 1, iy1 ); // eslint-disable-line max-len ix1 += sx; iy1 += sy; - kk += ( N - i1 ) * sap; + kk += (N-i1) * sap; } return y; } - // ( isrm && uplo === 'lower' ) || ( !isrm && uplo === 'upper' ) for ( i1 = 0; i1 < N; i1++ ) { rex = viewX[ ix1 ]; - imx = viewX[ ix1 + 1 ]; - retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); - imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); + imx = viewX[ ix1+1 ]; + retmp1 = f32(f32(realpha*rex) - f32(imalpha*imx)); + imtmp1 = f32(f32(realpha*imx) + f32(imalpha*rex)); retmp2 = 0.0; imtmp2 = 0.0; ix0 = ox; @@ -194,24 +185,24 @@ function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offse iap = kk; for ( i0 = 0; i0 < i1; i0++ ) { reap = viewAP[ iap ]; - imap = viewAP[ iap + 1 ]; + imap = viewAP[ iap+1 ]; cimap = sign * imap; - muladd( retmp1, imtmp1, reap, cimap, viewY[ iy0 ], viewY[ iy0 + 1 ], viewY, 1, iy0 ); // eslint-disable-line max-len + muladd( retmp1, imtmp1, reap, cimap, viewY[ iy0 ], viewY[ iy0+1 ], viewY, 1, iy0 ); // eslint-disable-line max-len rex = viewX[ ix0 ]; - imx = viewX[ ix0 + 1 ]; - retmp2 = f32( retmp2 + f32( ( reap * rex ) + ( cimap * imx ) ) ); - imtmp2 = f32( imtmp2 + f32( ( reap * imx ) - ( cimap * rex ) ) ); + imx = viewX[ ix0+1 ]; + retmp2 = f32(retmp2 + f32(reap*rex) + f32(cimap*imx)); + imtmp2 = f32(imtmp2 + f32(reap*imx) - f32(cimap*rex)); ix0 += sx; iy0 += sy; iap += sap; } reap = viewAP[ iap ]; - viewY[ iy1 ] = f32( viewY[ iy1 ] + ( retmp1 * reap ) ); - viewY[ iy1 + 1 ] = f32( viewY[ iy1 + 1 ] + ( imtmp1 * reap ) ); - muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy1 ], viewY[ iy1 + 1 ], viewY, 1, iy1 ); // eslint-disable-line max-len + viewY[ iy1 ] = f32(viewY[ iy1 ] + (retmp1*reap)); + viewY[ iy1+1 ] = f32(viewY[ iy1+1 ] + (imtmp1*reap)); + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy1 ], viewY[ iy1+1 ], viewY, 1, iy1 ); // eslint-disable-line max-len ix1 += sx; iy1 += sy; - kk += ( i1 + 1 ) * sap; + kk += (i1+1) * sap; } return y; } diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/lib/chpmv.js b/lib/node_modules/@stdlib/blas/base/chpmv/lib/chpmv.js index c5830a33e03f..071f0d7dfdb6 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/lib/chpmv.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/lib/chpmv.js @@ -23,8 +23,6 @@ var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); var stride2offset = require( '@stdlib/strided/base/stride2offset' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); var format = require( '@stdlib/string/format' ); var base = require( './base.js' ); @@ -32,17 +30,17 @@ var base = require( './base.js' ); // MAIN // /** -* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. * * @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 {Complex64} alpha - complex scalar constant -* @param {Complex64Array} AP - complex input matrix in packed form -* @param {Complex64Array} x - first complex input vector +* @param {Complex64} alpha - scalar constant +* @param {Complex64Array} AP - input matrix in packed form +* @param {Complex64Array} x - first input vector * @param {integer} strideX - `x` stride length -* @param {Complex64} beta - complex scalar constant -* @param {Complex64Array} y - second complex input vector +* @param {Complex64} beta - scalar constant +* @param {Complex64Array} 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 @@ -65,10 +63,6 @@ var base = require( './base.js' ); * // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] */ function chpmv( order, uplo, N, alpha, AP, x, strideX, beta, y, strideY ) { - var realpha; - var imalpha; - var rebeta; - var imbeta; var ox; var oy; @@ -87,13 +81,8 @@ function chpmv( order, uplo, N, alpha, AP, x, strideX, beta, y, strideY ) { if ( strideY === 0 ) { throw new RangeError( format( 'invalid argument. Tenth argument must be non-zero. Value: `%d`.', strideY ) ); } - rebeta = realf( beta ); - imbeta = imagf( beta ); - realpha = realf( alpha ); - imalpha = imagf( alpha ); - // Check if we can early return... - if ( N === 0 || ( realpha === 0.0 && imalpha === 0.0 && rebeta === 1.0 && imbeta === 0.0 ) ) { // eslint-disable-line max-len + if ( N === 0 ) { return y; } ox = stride2offset( N, strideX ); diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/chpmv/lib/index.js index 075acfea44af..0285f8e2a1ab 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* BLAS level 2 routine to performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. +* BLAS level 2 routine to performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. * * @module @stdlib/blas/base/chpmv * @@ -64,7 +64,6 @@ var main = require( './main.js' ); var chpmv; var tmp = tryRequire( join( __dirname, './native.js' ) ); - if ( isError( tmp ) ) { chpmv = main; } else { diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/chpmv/lib/ndarray.js index 64e053835fc9..24943bb61a99 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/lib/ndarray.js @@ -23,28 +23,26 @@ var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); var format = require( '@stdlib/string/format' ); -var realf = require( '@stdlib/complex/float32/real' ); -var imagf = require( '@stdlib/complex/float32/imag' ); var base = require( './base.js' ); // MAIN // /** -* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. * * @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 {Complex64} alpha - complex scalar constant -* @param {Complex64Array} AP - complex input matrix in packed form +* @param {Complex64} alpha - scalar constant +* @param {Complex64Array} AP - input matrix in packed form * @param {integer} strideAP - `AP` stride length * @param {NonNegativeInteger} offsetAP - starting index for `AP` -* @param {Complex64Array} x - first complex input vector +* @param {Complex64Array} x - first input vector * @param {integer} strideX - `x` stride length * @param {NonNegativeInteger} offsetX - starting index for `x` -* @param {Complex64} beta - complex scalar constant -* @param {Complex64Array} y - second complex input vector +* @param {Complex64} beta - scalar constant +* @param {Complex64Array} y - second input vector * @param {integer} strideY - `y` stride length * @param {NonNegativeInteger} offsetY - starting index for `y` * @throws {TypeError} first argument must be a valid order @@ -69,11 +67,6 @@ var base = require( './base.js' ); * // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] */ function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len - var realpha; - var imalpha; - var rebeta; - var imbeta; - if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } @@ -92,13 +85,8 @@ function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offse if ( strideY === 0 ) { throw new RangeError( format( 'invalid argument. Thirteenth argument must be non-zero. Value: `%d`.', strideY ) ); } - rebeta = realf( beta ); - imbeta = imagf( beta ); - realpha = realf( alpha ); - imalpha = imagf( alpha ); - // Check if we can early return... - if ( N === 0 || ( realpha === 0.0 && imalpha === 0.0 && rebeta === 1.0 && imbeta === 0.0 ) ) { // eslint-disable-line max-len + if ( N === 0 ) { return y; } return base( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offsetX, beta, y, strideY, offsetY ); From b72e23b78da3b6e92005359e63c1b38c20eed9a6 Mon Sep 17 00:00:00 2001 From: Divit Date: Sat, 18 Apr 2026 17:18:06 +0000 Subject: [PATCH 32/33] chore: clean up in 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: 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 --- --- .../@stdlib/blas/base/chpmv/README.md | 50 ++++++++++++------- .../@stdlib/blas/base/chpmv/package.json | 2 +- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/README.md b/lib/node_modules/@stdlib/blas/base/chpmv/README.md index c86934dd7774..56d15ef32cb3 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/chpmv/README.md @@ -32,13 +32,15 @@ var chpmv = require( '@stdlib/blas/base/chpmv' ); #### chpmv( order, uplo, N, α, AP, x, sx, β, y, sy ) -Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. +Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. + + ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); // eslint-disable-line max-params, max-len +var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); var alpha = new Complex64( 0.5, 0.5 ); @@ -53,23 +55,25 @@ 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`. -- **α**: complex scalar constant. -- **AP**: Complex input matrix in packed form stored in linear memory as a [`Complex64Array`][@stdlib/array/complex64]. -- **x**: complex input vector [`Complex64Array`][@stdlib/array/complex64]. +- **α**: scalar constant. +- **AP**: input matrix in packed form stored in linear memory as a [`Complex64Array`][@stdlib/array/complex64]. +- **x**: input vector [`Complex64Array`][@stdlib/array/complex64]. - **sx**: stride length for `x`. -- **β**: complex scalar constant. +- **β**: scalar constant. - **y**: output [`Complex64Array`][@stdlib/array/complex64]. - **sy**: stride length for `y`. The stride parameters determine how elements are accessed. For example, to iterate over every other element in `x` and `y`, + + ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); // eslint-disable-line max-params, max-len -var x = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 0.0, 0.0, 3.0, 3.0 ] ); // eslint-disable-line max-params, max-len -var y = new Complex64Array( [ 3.0, 3.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0 ] ); // eslint-disable-line max-params, max-len +var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); +var x = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 0.0, 0.0, 3.0, 3.0 ] ); +var y = new Complex64Array( [ 3.0, 3.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0 ] ); var alpha = new Complex64( 0.5, 0.5 ); var beta = new Complex64( 0.5, -0.5 ); @@ -81,14 +85,16 @@ Note that indexing is relative to the first index. To introduce an offset, use [ + + ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); // Initial arrays... var x0 = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var y0 = new Complex64Array( [ 0.0, 0.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); // eslint-disable-line max-params, max-len -var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); // eslint-disable-line max-params, max-len +var y0 = new Complex64Array( [ 0.0, 0.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); var alpha = new Complex64( 0.5, 0.5 ); var beta = new Complex64( 0.5, -0.5 ); @@ -104,13 +110,15 @@ chpmv( 'row-major', 'lower', 3, alpha, AP, x1, 1, beta, y1, 1 ); #### chpmv.ndarray( order, uplo, N, α, A, sap, oap, x, sx, ox, β, y, sy, oy ) -Performs the matrix-vector operation `y = α*A*x + β*y` using alternative indexing semantics, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. +Performs the matrix-vector operation `y = α*A*x + β*y` using alternative indexing semantics, where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form. + + ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); // eslint-disable-line max-params, max-len +var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); var y = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); var alpha = new Complex64( 0.5, 0.5 ); @@ -129,13 +137,15 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, + + ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); // eslint-disable-line max-params, max-len +var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); var x = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); -var y = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0 ] ); // eslint-disable-line max-params, max-len +var y = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0 ] ); var alpha = new Complex64( 0.5, 0.5 ); var beta = new Complex64( 0.5, -0.5 ); @@ -164,6 +174,8 @@ chpmv.ndarray( 'row-major', 'lower', 3, alpha, AP, 1, 0, x, 1, 1, beta, y, -2, 4 + + ```javascript var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); @@ -172,12 +184,12 @@ var logEach = require( '@stdlib/console/log-each' ); var chpmv = require( '@stdlib/blas/base/chpmv' ); function rand() { - return new Complex64( discreteUniform( 0, 255 ), discreteUniform( -128, 127 ) ); // eslint-disable-line max-params, max-len + return new Complex64( discreteUniform( 0, 255 ), discreteUniform( -128, 127 ) ); } var N = 5; -var AP = filledarrayBy( N * ( N + 1 ) / 2, 'complex64', rand ); +var AP = filledarrayBy( N*(N+1)/2, 'complex64', rand ); var x = filledarrayBy( N, 'complex64', rand ); var y = filledarrayBy( N, 'complex64', rand ); @@ -187,12 +199,12 @@ var beta = new Complex64( 0.5, -0.5 ); chpmv( 'row-major', 'lower', N, alpha, AP, x, 1, beta, y, 1 ); // Print the results: -logEach( '(%s)', x ); +logEach( '%s', x ); chpmv.ndarray( 'row-major', 'lower', N, alpha, AP, 1, 0, x, 1, 0, beta, y, 1, 0 ); // Print the results: -logEach( '(%s)', x ); +logEach( '%s', x ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/package.json b/lib/node_modules/@stdlib/blas/base/chpmv/package.json index 12565866ef3d..817930a2a457 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/package.json +++ b/lib/node_modules/@stdlib/blas/base/chpmv/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/chpmv", "version": "0.0.0", - "description": "Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix supplied in packed form.", + "description": "Performs the matrix-vector operation `y = α*A*x + β*y`.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", From 382d08078011802583bfb742cbb2fd3090661583 Mon Sep 17 00:00:00 2001 From: Divit Date: Tue, 21 Apr 2026 17:02:39 +0000 Subject: [PATCH 33/33] chore: clean up --- 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: passed - 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 --- --- .../@stdlib/blas/base/chpmv/README.md | 6 +- .../@stdlib/blas/base/chpmv/lib/base.js | 6 +- .../blas/base/chpmv/test/test.chpmv.js | 100 ++++++------ .../blas/base/chpmv/test/test.ndarray.js | 148 +++++++++--------- 4 files changed, 130 insertions(+), 130 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/README.md b/lib/node_modules/@stdlib/blas/base/chpmv/README.md index 56d15ef32cb3..ba341815fb78 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/chpmv/README.md @@ -20,7 +20,7 @@ limitations under the License. # chpmv -> Performs the matrix-vector operation `y = α*A*x + β*y` for complex-valued data. +> Performs the matrix-vector operation `y = α*A*x + β*y`.
@@ -72,12 +72,12 @@ var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); var AP = new Complex64Array( [ 1.0, 0.0, 2.0, -2.0, 4.0, 0.0, 3.0, -3.0, 5.0, -5.0, 6.0, 0.0 ] ); -var x = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 0.0, 0.0, 3.0, 3.0 ] ); +var x = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0 ] ); var y = new Complex64Array( [ 3.0, 3.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0 ] ); var alpha = new Complex64( 0.5, 0.5 ); var beta = new Complex64( 0.5, -0.5 ); -chpmv( 'row-major', 'lower', 3, alpha, AP, x, 3, beta, y, 2 ); +chpmv( 'row-major', 'lower', 3, alpha, AP, x, 2, beta, y, 2 ); // y => [ -10.0, 14.0, 0.0, 0.0, -11.0, 25.0, 0.0, 0.0, 14.0, 31.0 ] ``` diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js index f23e34eab1ac..f397d7b21e41 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/lib/base.js @@ -103,7 +103,7 @@ function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offse isrm = isRowMajor( order ); - // Decompose scalars + // Decompose scalars into real and imaginary components: rebeta = realf( beta ); imbeta = imagf( beta ); realpha = realf( alpha ); @@ -111,14 +111,14 @@ function chpmv( order, uplo, N, alpha, AP, strideAP, offsetAP, x, strideX, offse // y = beta*y if ( rebeta === 0.0 && imbeta === 0.0 ) { - cfill( N, 0.0, y, strideY, offsetY ); + cfill( N, alpha, y, strideY, offsetY ); } else if ( rebeta !== 1.0 || imbeta !== 0.0 ) { cscal( N, beta, y, strideY, offsetY ); } if ( realpha === 0.0 && imalpha === 0.0 ) { return y; } - // Reinterpret arrays to real-valued views + // Reinterpret arrays as real-valued views of interleaved real and imaginary components: viewAP = reinterpret( AP, 0 ); viewX = reinterpret( x, 0 ); viewY = reinterpret( y, 0 ); diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.chpmv.js b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.chpmv.js index 4dba315136fd..98c798d796c8 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.chpmv.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.chpmv.js @@ -267,8 +267,8 @@ tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (ro expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -295,8 +295,8 @@ tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (co expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -323,8 +323,8 @@ tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (ro expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -351,8 +351,8 @@ tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (co expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -376,7 +376,7 @@ tape( 'the function returns a reference to the second input vector (row-major)', beta = new Complex64( data.beta[0], data.beta[1] ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); t.end(); }); @@ -400,7 +400,7 @@ tape( 'the function returns a reference to the second input vector (column-major beta = new Complex64( data.beta[0], data.beta[1] ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); t.end(); }); @@ -427,8 +427,8 @@ tape( 'if `N` is `0`, the function returns the second input vector unchanged (ro expected = new Complex64Array( data.y ); out = chpmv( data.order, data.uplo, 0, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -455,8 +455,8 @@ tape( 'if `N` is `0`, the function returns the second input vector unchanged (co expected = new Complex64Array( data.y ); out = chpmv( data.order, data.uplo, 0, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -483,8 +483,8 @@ tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vec expected = new Complex64Array( data.y ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -511,8 +511,8 @@ tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vec expected = new Complex64Array( data.y ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -536,10 +536,10 @@ tape( 'if `α` is `0` and `β` is `0`, the function zeros the second input vecto alpha = new Complex64( 0.0, 0.0 ); beta = new Complex64( 0.0, 0.0 ); - expected = new Complex64Array( data.y.length ); + expected = new Complex64Array( y.length ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.deepEqual( out, expected, true, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -563,10 +563,10 @@ tape( 'if `α` is `0` and `β` is `0`, the function zeros the second input vecto alpha = new Complex64( 0.0, 0.0 ); beta = new Complex64( 0.0, 0.0 ); - expected = new Complex64Array( data.y.length ); + expected = new Complex64Array( y.length ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.deepEqual( out, expected, true, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -593,8 +593,8 @@ tape( 'if `x` contains only zeros and `β` is `1`, the function returns the seco expected = new Complex64Array( data.y ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -621,8 +621,8 @@ tape( 'if `x` contains only zeros and `β` is `1`, the function returns the seco expected = new Complex64Array( data.y ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -649,8 +649,8 @@ tape( 'if `α` is `0`, the function scales the second input vector by `β` (row- expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -677,8 +677,8 @@ tape( 'if `α` is `0`, the function scales the second input vector by `β` (colu expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -705,8 +705,8 @@ tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the s expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -733,8 +733,8 @@ tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the s expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -761,8 +761,8 @@ tape( 'the function supports specifying `x` and `y` strides (row-major)', functi expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -789,8 +789,8 @@ tape( 'the function supports specifying `x` and `y` strides (column-major)', fun expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -817,8 +817,8 @@ tape( 'the function supports specifying a negative `x` stride (row-major)', func expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -845,8 +845,8 @@ tape( 'the function supports specifying a negative `x` stride (column-major)', f expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -873,8 +873,8 @@ tape( 'the function supports specifying a negative `y` stride (row-major)', func expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -901,8 +901,8 @@ tape( 'the function supports specifying a negative `y` stride (column-major)', f expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -929,8 +929,8 @@ tape( 'the function supports specifying negative strides for `x` and `y` (row-ma expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -957,8 +957,8 @@ tape( 'the function supports specifying negative strides for `x` and `y` (column expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, x, data.strideX, beta, y, data.strideY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js index 040b96f664f5..fd3065b35ced 100644 --- a/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/chpmv/test/test.ndarray.js @@ -314,8 +314,8 @@ tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (ro expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -342,8 +342,8 @@ tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (co expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -370,8 +370,8 @@ tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (ro expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -398,8 +398,8 @@ tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (co expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -423,7 +423,7 @@ tape( 'the function returns a reference to the second input vector (row-major)', beta = new Complex64( data.beta[0], data.beta[1] ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); t.end(); }); @@ -447,7 +447,7 @@ tape( 'the function returns a reference to the second input vector (column-major beta = new Complex64( data.beta[0], data.beta[1] ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); t.end(); }); @@ -474,8 +474,8 @@ tape( 'if `N` is `0`, the function returns the second input vector unchanged (ro expected = new Complex64Array( data.y ); out = chpmv( data.order, data.uplo, 0, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -502,8 +502,8 @@ tape( 'if `N` is `0`, the function returns the second input vector unchanged (co expected = new Complex64Array( data.y ); out = chpmv( data.order, data.uplo, 0, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -530,8 +530,8 @@ tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vec expected = new Complex64Array( data.y ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -558,8 +558,8 @@ tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vec expected = new Complex64Array( data.y ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -583,10 +583,10 @@ tape( 'if `α` is `0` and `β` is `0`, the function zeros the second input vecto alpha = new Complex64( 0.0, 0.0 ); beta = new Complex64( 0.0, 0.0 ); - expected = new Complex64Array( data.y.length ); + expected = new Complex64Array( y.length ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.deepEqual( out, expected, true, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -610,10 +610,10 @@ tape( 'if `α` is `0` and `β` is `0`, the function zeros the second input vecto alpha = new Complex64( 0.0, 0.0 ); beta = new Complex64( 0.0, 0.0 ); - expected = new Complex64Array( data.y.length ); + expected = new Complex64Array( y.length ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.deepEqual( out, expected, true, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -640,8 +640,8 @@ tape( 'if `x` contains only zeros and `β` is `1`, the function returns the seco expected = new Complex64Array( data.y ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -668,8 +668,8 @@ tape( 'if `x` contains only zeros and `β` is `1`, the function returns the seco expected = new Complex64Array( data.y ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -696,8 +696,8 @@ tape( 'if `α` is `0`, the function scales the second input vector by `β` (row- expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -724,8 +724,8 @@ tape( 'if `α` is `0`, the function scales the second input vector by `β` (colu expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -752,8 +752,8 @@ tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the s expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -780,8 +780,8 @@ tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the s expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -808,8 +808,8 @@ tape( 'the function supports specifying an `x` offset (row-major', function test expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -836,8 +836,8 @@ tape( 'the function supports specifying an `x` offset (column-major', function t expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -864,8 +864,8 @@ tape( 'the function supports specifying a `y` offset (row-major)', function test expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -892,8 +892,8 @@ tape( 'the function supports specifying a `y` offset (column-major)', function t expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -920,8 +920,8 @@ tape( 'the function supports specifying an offset for `AP` (row-major)', functio expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -948,8 +948,8 @@ tape( 'the function supports specifying an offset for `AP` (column-major)', func expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -976,8 +976,8 @@ tape( 'the function supports specifying a stride for `AP` (row-major)', function expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1004,8 +1004,8 @@ tape( 'the function supports specifying a stride for `AP` (column-major)', funct expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1032,8 +1032,8 @@ tape( 'the function supports specifying a negative stride for `AP` (row-major)', expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1060,8 +1060,8 @@ tape( 'the function supports specifying a negative stride for `AP` (column-major expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1088,8 +1088,8 @@ tape( 'the function supports specifying `x` and `y` strides (row-major)', functi expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1116,8 +1116,8 @@ tape( 'the function supports specifying `x` and `y` strides (column-major)', fun expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1144,8 +1144,8 @@ tape( 'the function supports specifying a negative `x` stride (row-major)', func expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1172,8 +1172,8 @@ tape( 'the function supports specifying a negative `x` stride (column-major)', f expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1200,8 +1200,8 @@ tape( 'the function supports specifying a negative `y` stride (row-major)', func expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1228,8 +1228,8 @@ tape( 'the function supports specifying a negative `y` stride (column-major)', f expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1256,8 +1256,8 @@ tape( 'the function supports specifying negative strides for `x` and `y` (row-ma expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1284,8 +1284,8 @@ tape( 'the function supports specifying negative strides for `x` and `y` (column expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1312,8 +1312,8 @@ tape( 'the function supports complex access patterns (row-major)', function test expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1340,8 +1340,8 @@ tape( 'the function supports complex access patterns (column-major)', function t expected = new Complex64Array( data.y_out ); out = chpmv( data.order, data.uplo, data.N, alpha, ap, data.strideAP, data.offsetAP, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); - t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, y, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); });