From 76f6a985c8b56bc1bd2718141671820deaa4fa4d Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 13 Mar 2026 08:53:17 +0000 Subject: [PATCH 01/26] feat: base set up --- .../@stdlib/blas/base/chemv/lib/base.js | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/lib/base.js diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js new file mode 100644 index 000000000000..7aea826eb814 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js @@ -0,0 +1,157 @@ +/** +* @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. +* +* @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} 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( [ ] ); +* 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 ); +* +* chemv( ); +* // y => [ ] +*/ +function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len + var realpha; + var imalpha; + var rebeta; + var imbeta; + var viewA; + var viewX; + var viewY; + var retmp; + var imtmp; + var isrm; + var xlen; + var ylen; + 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; + + // Layout + isrm = isRowMajor( [ strideA1, strideA2 ] ); + + // Decompose scalars + rebeta = realf( beta ); + imbeta = imagf( beta ); + realpha = realf( alpha ); + imalpha = imagf( alpha ); + + // y = beta*y + if ( rebeta === 0.0 && imbeta === 0.0 ) { + cfill( N, 0.0, y, strideY, offsetY ); + } else if ( rebeta !== 1.0 || imbeta !== 0.0 ) { + cscal( N, beta, y, strideY, offsetY ); + } + + // If alpha is zero, early return y + if ( realpha === 0.0 && imalpha === 0.0 ) { + return y; + } + + // Reinterpret arrays to raw numeric views + viewA = reinterpret( A, 0 ); + viewX = reinterpret( x, 0 ); + viewY = reinterpret( y, 0 ); + + if ( isrm ) { + // For row-major matrices, the last dimension has the fastest changing index... + sa0 = strideA2 * 2; // offset increment for innermost loop + sa1 = strideA1 * 2; // offset increment for outermost loop + } else { // isColMajor + // For column-major matrices, the first dimension has the fastest changing index... + sa0 = strideA1 * 2; // offset increment for innermost loop + sa1 = strideA2 * 2; // offset increment for outermost loop + } + + // 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 ); + oa2 = oa + ( i1 * sa1 ); + rex = viewX[ ix ]; + imx = viewX[ ix + 1 ]; + retmp = f32( ( realpha * rex ) - ( imalpha * imx ) ); + imtmp = f32( ( realpha * imx ) + ( imalpha * rex ) ); + for ( i0 = 0; i0 < N; i0++ ) { + + } + } + } +} \ No newline at end of file From 6f150733d9728ee9840fe9c12a108615be195fc1 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 13 Mar 2026 16:25:33 +0000 Subject: [PATCH 02/26] feat: base.js loop logic --- .../@stdlib/blas/base/chemv/lib/base.js | 89 ++++++++++++++++--- 1 file changed, 78 insertions(+), 11 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js index 7aea826eb814..bd2380542e15 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js @@ -72,12 +72,11 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs var viewA; var viewX; var viewY; - var retmp; - var imtmp; + var retmp1; + var imtmp1; + var retmp2; + var imtmp2; var isrm; - var xlen; - var ylen; - var sign; var sa0; var sa1; var oa2; @@ -144,14 +143,82 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { for ( i1 = 0; i1 < N; i1++ ) { ix = ox + ( i1 * sx ); - oa2 = oa + ( i1 * sa1 ); rex = viewX[ ix ]; imx = viewX[ ix + 1 ]; - retmp = f32( ( realpha * rex ) - ( imalpha * imx ) ); - imtmp = f32( ( realpha * imx ) + ( imalpha * rex ) ); - for ( i0 = 0; i0 < N; i0++ ) { - + retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); + imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); + retmp2 = 0.0; + imtmp2 = 0.0; + ia = oa + ( i1 * sa1 ) + ( i1 * sa0 ); + rea = viewA[ ia ]; + iy = oy + ( i1 * sy ); + viewY[ iy ] += f32( retmp1 * rea ); + viewY[ iy + 1 ] += f32( imtmp1 * rea ); + for ( i0 = i1 + 1; i0 < N; i0++ ) { + ia = oa + ( i1 * sa1 ) + ( i0 * sa0 ); + rea = viewA[ ia ]; + ima = viewA[ ia + 1 ]; + iy = oy + ( i0 * sy ); + viewY[ iy ] += f32( ( retmp1 * rea ) - ( imtmp1 * ima ) ); + viewY[ iy + 1 ] += f32( ( retmp1 * ima ) + ( imtmp1 * rea ) ); + ix = ox + ( i0 * sx ); + rex = viewX[ ix ]; + imx = viewX[ ix + 1 ]; + retmp2 += f32( ( rea * rex ) + ( ima * imx ) ); + imtmp2 += f32( ( rea * imx ) - ( ima * rex ) ); } + viewY[ iy ] += f32( ( realpha * retmp2 ) - ( imalpha * imtmp2 ) ); + viewY[ iy + 1 ] += f32( ( realpha * imtmp2 ) + ( imalpha * retmp2 ) ); } + 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; + for ( i0 = 0; i0 < i1; i0++ ) { + ia = oa + ( i1 * sa1 ) + ( i0 * sa0 ); + rea = viewA[ ia ]; + ima = viewA[ ia + 1 ]; + iy = oy + ( i0 * sy ); + viewY[ iy ] += f32( ( retmp1 * rea ) - ( imtmp1 * ima ) ); + viewY[ iy + 1 ] += f32( ( retmp1 * ima ) + ( imtmp1 * rea ) ); + ix = ox + ( i0 * sx ); + rex = viewX[ ix ]; + imx = viewX[ ix + 1 ]; + retmp2 += f32( ( rea * rex ) + ( ima * imx ) ); + imtmp2 += f32( ( rea * imx ) - ( ima * rex ) ); + } + ia = oa + ( i1 * sa1 ) + ( i1 * sa0 ); + rea = viewA[ ia ]; + iy = oy + ( i1 * sy ); + ima = viewA[ ia + 1 ]; + viewY[ iy ] += f32( ( retmp1 * rea ) + ( realpha * retmp2 ) - ( imalpha * imtmp2 ) ); + viewY[ iy + 1 ] += f32( ( retmp1 * ima ) + ( realpha * imtmp2 ) + ( imalpha * retmp2 ) ); } -} \ No newline at end of file + return y; +} + + +// EXPORTS // + +module.exports = chemv; + +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var A = new Complex64Array( [ 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 ] ); +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 ); + +chemv( 'lower', 3, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 ); +console.log( y.toString() ); +// y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] \ No newline at end of file From a98f64ee9fb15f8906ec0e541c08859b7789e2e6 Mon Sep 17 00:00:00 2001 From: Divit Date: Tue, 17 Mar 2026 14:20:04 +0000 Subject: [PATCH 03/26] branch 1 corrected --- .../@stdlib/blas/base/chemv/lib/base.js | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js index bd2380542e15..b13c585359eb 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js @@ -141,34 +141,45 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs sy = strideY * 2; if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { + console.log('1st branch') for ( i1 = 0; i1 < N; i1++ ) { + console.log(`i1: ${i1}`) ix = ox + ( i1 * sx ); rex = viewX[ ix ]; imx = viewX[ ix + 1 ]; + console.log(`ix: ${ix}, x: ${rex} ${imx}i`) retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); retmp2 = 0.0; imtmp2 = 0.0; ia = oa + ( i1 * sa1 ) + ( i1 * sa0 ); rea = viewA[ ia ]; + console.log(`ia = ${i1} * ${sa1} + ${i1} * ${sa0} = ${ia}, A[ia]: ${rea}`) iy = oy + ( i1 * sy ); viewY[ iy ] += f32( retmp1 * rea ); viewY[ iy + 1 ] += f32( imtmp1 * rea ); + console.log(`iy: ${iy}, y: ${viewY[iy]} ${viewY[iy+1]}i`) for ( i0 = i1 + 1; i0 < N; i0++ ) { + console.log(`i0: ${i0}`) ia = oa + ( i1 * sa1 ) + ( i0 * sa0 ); rea = viewA[ ia ]; ima = viewA[ ia + 1 ]; + console.log(`ia = ${i1} * ${sa1} + ${i0} * ${sa0} = ${ia}, A[ia]: ${rea} ${ima}i`) iy = oy + ( i0 * sy ); - viewY[ iy ] += f32( ( retmp1 * rea ) - ( imtmp1 * ima ) ); - viewY[ iy + 1 ] += f32( ( retmp1 * ima ) + ( imtmp1 * rea ) ); + viewY[ iy ] += f32( ( retmp1 * rea ) + ( imtmp1 * ima ) ); + viewY[ iy + 1 ] += f32( ( -retmp1 * ima ) + ( imtmp1 * rea ) ); + console.log(`iy: ${iy}, y: ${viewY[iy]} ${viewY[iy+1]}i`) ix = ox + ( i0 * sx ); rex = viewX[ ix ]; imx = viewX[ ix + 1 ]; - retmp2 += f32( ( rea * rex ) + ( ima * imx ) ); - imtmp2 += f32( ( rea * imx ) - ( ima * rex ) ); + console.log(`ix: ${ix}, x: ${rex} ${imx}i`) + retmp2 += f32( ( rea * rex ) - ( ima * imx ) ); + imtmp2 += f32( ( rea * imx ) + ( ima * rex ) ); } + iy = oy + ( i1 * sy ); viewY[ iy ] += f32( ( realpha * retmp2 ) - ( imalpha * imtmp2 ) ); viewY[ iy + 1 ] += f32( ( realpha * imtmp2 ) + ( imalpha * retmp2 ) ); + console.log(`iy: ${iy}, y: ${viewY[iy]} ${viewY[iy+1]}i`) } return y; } @@ -199,8 +210,8 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs rea = viewA[ ia ]; iy = oy + ( i1 * sy ); ima = viewA[ ia + 1 ]; - viewY[ iy ] += f32( ( retmp1 * rea ) + ( realpha * retmp2 ) - ( imalpha * imtmp2 ) ); - viewY[ iy + 1 ] += f32( ( retmp1 * ima ) + ( realpha * imtmp2 ) + ( imalpha * retmp2 ) ); + viewY[ iy ] += f32( ( retmp1 * rea ) + ( realpha * retmp2 ) + ( imalpha * imtmp2 ) ); + viewY[ iy + 1 ] += f32( ( imtmp1 * rea ) + ( realpha * imtmp2 ) - ( imalpha * retmp2 ) ); } return y; } @@ -213,12 +224,16 @@ module.exports = chemv; var Complex64Array = require( '@stdlib/array/complex64' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var A = new Complex64Array( [ 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 ] ); 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 ); -chemv( 'lower', 3, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 ); +var A = new Complex64Array( [ 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 ] ); +chemv( 'upper', 3, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 ); + +// var A = new Complex64Array( [ 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 ] ); +// chemv( 'lower', 3, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 ); + console.log( y.toString() ); // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] \ No newline at end of file From 01ce0b2202af0433badd5cebc3bcbcd05151895c Mon Sep 17 00:00:00 2001 From: Divit Date: Tue, 17 Mar 2026 18:10:53 +0000 Subject: [PATCH 04/26] branch 1 updated --- lib/node_modules/@stdlib/blas/base/chemv/lib/base.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js index b13c585359eb..5768c1507454 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js @@ -77,6 +77,7 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs var retmp2; var imtmp2; var isrm; + var cima; var sa0; var sa1; var oa2; @@ -152,7 +153,8 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); retmp2 = 0.0; imtmp2 = 0.0; - ia = oa + ( i1 * sa1 ) + ( i1 * sa0 ); + oa2 = oa + ( i1 * sa1 ); + ia = oa2 + ( i1 * sa0 ); rea = viewA[ ia ]; console.log(`ia = ${i1} * ${sa1} + ${i1} * ${sa0} = ${ia}, A[ia]: ${rea}`) iy = oy + ( i1 * sy ); @@ -161,13 +163,14 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs console.log(`iy: ${iy}, y: ${viewY[iy]} ${viewY[iy+1]}i`) for ( i0 = i1 + 1; i0 < N; i0++ ) { console.log(`i0: ${i0}`) - ia = oa + ( i1 * sa1 ) + ( i0 * sa0 ); + ia = oa2 + ( i0 * sa0 ); rea = viewA[ ia ]; ima = viewA[ ia + 1 ]; + cima = -ima; console.log(`ia = ${i1} * ${sa1} + ${i0} * ${sa0} = ${ia}, A[ia]: ${rea} ${ima}i`) iy = oy + ( i0 * sy ); - viewY[ iy ] += f32( ( retmp1 * rea ) + ( imtmp1 * ima ) ); - viewY[ iy + 1 ] += f32( ( -retmp1 * ima ) + ( imtmp1 * rea ) ); + viewY[ iy ] += f32( ( retmp1 * rea ) - ( imtmp1 * cima ) ); + viewY[ iy + 1 ] += f32( ( retmp1 * cima ) + ( imtmp1 * rea ) ); console.log(`iy: ${iy}, y: ${viewY[iy]} ${viewY[iy+1]}i`) ix = ox + ( i0 * sx ); rex = viewX[ ix ]; From 31fd8eacb9b227d18502f7a2c7d05791ff09d943 Mon Sep 17 00:00:00 2001 From: Divit Date: Tue, 17 Mar 2026 18:20:25 +0000 Subject: [PATCH 05/26] example added --- .../@stdlib/blas/base/chemv/lib/base.js | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js index 5768c1507454..db108de117e5 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js @@ -55,27 +55,27 @@ 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 A = new Complex64Array( [ 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 ] ); * 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 ); * -* chemv( ); -* // y => [ ] +* chemv( 'lower', 3, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 ); +* // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] */ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len var realpha; var imalpha; var rebeta; var imbeta; - var viewA; - var viewX; - var viewY; var retmp1; var imtmp1; var retmp2; var imtmp2; + var viewA; + var viewX; + var viewY; var isrm; var cima; var sa0; @@ -142,13 +142,10 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs sy = strideY * 2; if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { - console.log('1st branch') for ( i1 = 0; i1 < N; i1++ ) { - console.log(`i1: ${i1}`) ix = ox + ( i1 * sx ); rex = viewX[ ix ]; imx = viewX[ ix + 1 ]; - console.log(`ix: ${ix}, x: ${rex} ${imx}i`) retmp1 = f32( ( realpha * rex ) - ( imalpha * imx ) ); imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); retmp2 = 0.0; @@ -156,33 +153,26 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs oa2 = oa + ( i1 * sa1 ); ia = oa2 + ( i1 * sa0 ); rea = viewA[ ia ]; - console.log(`ia = ${i1} * ${sa1} + ${i1} * ${sa0} = ${ia}, A[ia]: ${rea}`) iy = oy + ( i1 * sy ); viewY[ iy ] += f32( retmp1 * rea ); viewY[ iy + 1 ] += f32( imtmp1 * rea ); - console.log(`iy: ${iy}, y: ${viewY[iy]} ${viewY[iy+1]}i`) for ( i0 = i1 + 1; i0 < N; i0++ ) { - console.log(`i0: ${i0}`) ia = oa2 + ( i0 * sa0 ); rea = viewA[ ia ]; ima = viewA[ ia + 1 ]; cima = -ima; - console.log(`ia = ${i1} * ${sa1} + ${i0} * ${sa0} = ${ia}, A[ia]: ${rea} ${ima}i`) iy = oy + ( i0 * sy ); viewY[ iy ] += f32( ( retmp1 * rea ) - ( imtmp1 * cima ) ); viewY[ iy + 1 ] += f32( ( retmp1 * cima ) + ( imtmp1 * rea ) ); - console.log(`iy: ${iy}, y: ${viewY[iy]} ${viewY[iy+1]}i`) ix = ox + ( i0 * sx ); rex = viewX[ ix ]; imx = viewX[ ix + 1 ]; - console.log(`ix: ${ix}, x: ${rex} ${imx}i`) retmp2 += f32( ( rea * rex ) - ( ima * imx ) ); imtmp2 += f32( ( rea * imx ) + ( ima * rex ) ); } iy = oy + ( i1 * sy ); viewY[ iy ] += f32( ( realpha * retmp2 ) - ( imalpha * imtmp2 ) ); viewY[ iy + 1 ] += f32( ( realpha * imtmp2 ) + ( imalpha * retmp2 ) ); - console.log(`iy: ${iy}, y: ${viewY[iy]} ${viewY[iy+1]}i`) } return y; } @@ -196,23 +186,24 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs imtmp1 = f32( ( realpha * imx ) + ( imalpha * rex ) ); retmp2 = 0.0; imtmp2 = 0.0; + oa2 = oa + ( i1 * sa1 ); for ( i0 = 0; i0 < i1; i0++ ) { - ia = oa + ( i1 * sa1 ) + ( i0 * sa0 ); + ia = oa2 + ( i0 * sa0 ); rea = viewA[ ia ]; ima = viewA[ ia + 1 ]; + cima = -ima; iy = oy + ( i0 * sy ); - viewY[ iy ] += f32( ( retmp1 * rea ) - ( imtmp1 * ima ) ); - viewY[ iy + 1 ] += f32( ( retmp1 * ima ) + ( imtmp1 * rea ) ); + viewY[ iy ] += f32( ( retmp1 * rea ) - ( imtmp1 * cima ) ); + viewY[ iy + 1 ] += f32( ( retmp1 * cima ) + ( imtmp1 * rea ) ); ix = ox + ( i0 * sx ); rex = viewX[ ix ]; imx = viewX[ ix + 1 ]; retmp2 += f32( ( rea * rex ) + ( ima * imx ) ); imtmp2 += f32( ( rea * imx ) - ( ima * rex ) ); } - ia = oa + ( i1 * sa1 ) + ( i1 * sa0 ); + ia = oa2 + ( i1 * sa0 ); rea = viewA[ ia ]; iy = oy + ( i1 * sy ); - ima = viewA[ ia + 1 ]; viewY[ iy ] += f32( ( retmp1 * rea ) + ( realpha * retmp2 ) + ( imalpha * imtmp2 ) ); viewY[ iy + 1 ] += f32( ( imtmp1 * rea ) + ( realpha * imtmp2 ) - ( imalpha * retmp2 ) ); } From 5da95dddd15b05867965568b2379e1d91aaa626b Mon Sep 17 00:00:00 2001 From: Divit Date: Tue, 17 Mar 2026 18:45:28 +0000 Subject: [PATCH 06/26] muladd used --- .../@stdlib/blas/base/chemv/lib/base.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js index db108de117e5..6a1ebd877613 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js @@ -162,8 +162,7 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs ima = viewA[ ia + 1 ]; cima = -ima; iy = oy + ( i0 * sy ); - viewY[ iy ] += f32( ( retmp1 * rea ) - ( imtmp1 * cima ) ); - viewY[ iy + 1 ] += f32( ( retmp1 * cima ) + ( imtmp1 * rea ) ); + 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 ]; @@ -171,8 +170,7 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs imtmp2 += f32( ( rea * imx ) + ( ima * rex ) ); } iy = oy + ( i1 * sy ); - viewY[ iy ] += f32( ( realpha * retmp2 ) - ( imalpha * imtmp2 ) ); - viewY[ iy + 1 ] += f32( ( realpha * imtmp2 ) + ( imalpha * retmp2 ) ); + muladd( realpha, imalpha, retmp2, imtmp2, viewY[ iy ], viewY[ iy + 1 ], viewY, 1, iy ); // eslint-disable-line max-len } return y; } @@ -193,19 +191,19 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs ima = viewA[ ia + 1 ]; cima = -ima; iy = oy + ( i0 * sy ); - viewY[ iy ] += f32( ( retmp1 * rea ) - ( imtmp1 * cima ) ); - viewY[ iy + 1 ] += f32( ( retmp1 * cima ) + ( imtmp1 * rea ) ); + 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 ) + ( ima * imx ) ); - imtmp2 += f32( ( rea * imx ) - ( ima * rex ) ); + retmp2 += f32( ( rea * rex ) - ( ima * imx ) ); + imtmp2 += f32( ( rea * imx ) + ( ima * rex ) ); } ia = oa2 + ( i1 * sa0 ); rea = viewA[ ia ]; iy = oy + ( i1 * sy ); - viewY[ iy ] += f32( ( retmp1 * rea ) + ( realpha * retmp2 ) + ( imalpha * imtmp2 ) ); - viewY[ iy + 1 ] += f32( ( imtmp1 * rea ) + ( realpha * imtmp2 ) - ( imalpha * retmp2 ) ); + 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; } From c404abee089f8ab7d522d0a07ff3f4a9589498b1 Mon Sep 17 00:00:00 2001 From: Divit Date: Wed, 18 Mar 2026 12:59:10 +0000 Subject: [PATCH 07/26] chore: package.json 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: 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/chemv/package.json | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/package.json diff --git a/lib/node_modules/@stdlib/blas/base/chemv/package.json b/lib/node_modules/@stdlib/blas/base/chemv/package.json new file mode 100644 index 000000000000..2db9da220344 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/package.json @@ -0,0 +1,74 @@ +{ + "name": "@stdlib/blas/base/chemv", + "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.", + "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 a7b7817c7d862f6f9d3ffa454480e3d506d2e47c Mon Sep 17 00:00:00 2001 From: Divit Date: Wed, 18 Mar 2026 13:57:45 +0000 Subject: [PATCH 08/26] feat: base implementation 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: 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/chemv/lib/base.js | 22 +--- .../@stdlib/blas/base/chemv/lib/chemv.js | 123 ++++++++++++++++++ .../@stdlib/blas/base/chemv/lib/index.js | 79 +++++++++++ .../@stdlib/blas/base/chemv/lib/main.js | 35 +++++ .../@stdlib/blas/base/chemv/lib/ndarray.js | 108 +++++++++++++++ 5 files changed, 348 insertions(+), 19 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/lib/chemv.js create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/lib/ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js index 6a1ebd877613..688cff75ac3d 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js @@ -29,6 +29,7 @@ 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 // /** @@ -162,7 +163,7 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs ima = viewA[ ia + 1 ]; cima = -ima; iy = oy + ( i0 * sy ); - muladd( retmp1, imtmp1, rea, cima, viewY[ iy ], viewY[ iy+ 1 ], viewY, 1, iy ); // eslint-disable-line max-len + 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 ]; @@ -191,7 +192,7 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs ima = viewA[ ia + 1 ]; cima = -ima; iy = oy + ( i0 * sy ); - muladd( retmp1, imtmp1, rea, cima, viewY[ iy ], viewY[ iy+ 1 ], viewY, 1, iy ); // eslint-disable-line max-len + 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 ]; @@ -212,20 +213,3 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs // EXPORTS // module.exports = chemv; - -var Complex64Array = require( '@stdlib/array/complex64' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -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 ); - -var A = new Complex64Array( [ 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 ] ); -chemv( 'upper', 3, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 ); - -// var A = new Complex64Array( [ 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 ] ); -// chemv( 'lower', 3, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 ); - -console.log( y.toString() ); -// y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] \ No newline at end of file diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/chemv.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/chemv.js new file mode 100644 index 000000000000..51a3fecd416a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/lib/chemv.js @@ -0,0 +1,123 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var max = require( '@stdlib/math/base/special/fast/max' ); +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. +* +* @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} A - complex input matrix +* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Complex64Array} x - first complex input vector +* @param {integer} strideX - `x` stride length +* @param {Complex64} beta - complex scalar constant +* @param {Complex64Array} y - second complex input vector +* @param {integer} strideY - `y` stride length +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must specify whether to reference the lower or upper triangular matrix +* @throws {RangeError} third argument must be a nonnegative integer +* @throws {RangeError} sixth argument must be a valid stride +* @throws {RangeError} eighth argument must be non-zero +* @throws {RangeError} eleventh argument must be non-zero +* @returns {Complex64Array} `y` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var A = new Complex64Array( [ 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 ] ); +* 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 ); +* +* chemv( 'row-major', 'lower', 3, alpha, A, 3, x, 1, beta, y, 1 ); +* // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +*/ +function chemv( order, uplo, N, alpha, A, LDA, x, strideX, beta, y, strideY ) { // eslint-disable-line max-params + var realpha; + var imalpha; + var rebeta; + var imbeta; + var sa1; + var sa2; + var ox; + var oy; + + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( format( 'invalid argument. Second argument must specify whether to reference the lower or upper triangular matrix. Value: `%s`.', uplo ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( strideX === 0 ) { + throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideX ) ); + } + if ( strideY === 0 ) { + throw new RangeError( format( 'invalid argument. Eleventh argument must be non-zero. Value: `%d`.', strideY ) ); + } + if ( LDA < max( 1, N ) ) { + throw new RangeError( format( 'invalid argument. Sixth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); + } + rebeta = realf( beta ); + imbeta = imagf( beta ); + realpha = realf( alpha ); + imalpha = imagf( alpha ); + + // Check if we can early return... + if ( N === 0 || ( realpha === 0.0 && imalpha === 0.0 && rebeta === 1.0 && imbeta === 0.0 ) ) { // eslint-disable-line max-len + return y; + } + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + } + ox = stride2offset( N, strideX ); + oy = stride2offset( N, strideY ); + return base( uplo, N, alpha, A, sa1, sa2, 0, x, strideX, ox, beta, y, strideY, oy ); +} + + +// EXPORTS // + +module.exports = chemv; diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/index.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/index.js new file mode 100644 index 000000000000..9e33b69bbadc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/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. +* +* @module @stdlib/blas/base/chemv +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* var chemv = require( '@stdlib/blas/base/chemv' ); +* +* var A = new Complex64Array( [ 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 ] ); +* 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 ); +* +* chemv( 'row-major', 'lower', 3, alpha, A, 3, 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 chemv = require( '@stdlib/blas/base/chemv' ); +* +* var A = new Complex64Array( [ 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 ] ); +* 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 ); +* +* chemv.ndarray( 'lower', 3, alpha, A, 3, 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 chemv; +var tmp = tryRequire( join( __dirname, './native.js' ) ); + +if ( isError( tmp ) ) { + chemv = main; +} else { + chemv = tmp; +} + + +// EXPORTS // + +module.exports = chemv; + +// exports: { "ndarray": "chemv.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/main.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/main.js new file mode 100644 index 000000000000..8421ee39ac40 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/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 chemv = require( './chemv.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( chemv, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = chemv; diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/ndarray.js new file mode 100644 index 000000000000..9f3ca0da6cf0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/lib/ndarray.js @@ -0,0 +1,108 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var format = require( '@stdlib/string/format' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are N element complex vectors, and `A` is an `N` by `N` Hermitian matrix. +* +* @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} A - complex input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Complex64Array} x - first complex input vector +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {Complex64} beta - complex scalar constant +* @param {Complex64Array} y - second complex input vector +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting index for `y` +* @throws {TypeError} first argument must specify whether to reference the lower or upper triangular matrix +* @throws {RangeError} second argument must be a nonnegative integer +* @throws {RangeError} 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 A = new Complex64Array( [ 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 ] ); +* 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 ); +* +* chemv( 'lower', 3, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 ); +* // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +*/ +function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len + var realpha; + var imalpha; + var rebeta; + var imbeta; + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( format( 'invalid argument. First argument must specify whether to reference the lower or upper triangular matrix. Value: `%s`.', uplo ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( 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 ) ); + } + if ( strideA1 === 0 ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be non-zero. Value: `%d`.', strideA1 ) ); + } + if ( strideA2 === 0 ) { + throw new RangeError( format( 'invalid argument. Sixth argument must be non-zero. Value: `%d`.', strideA2 ) ); + } + rebeta = realf( beta ); + imbeta = imagf( beta ); + realpha = realf( alpha ); + imalpha = imagf( alpha ); + + // Check if we can early return... + if ( N === 0 || ( realpha === 0.0 && imalpha === 0.0 && rebeta === 1.0 && imbeta === 0.0 ) ) { // eslint-disable-line max-len + return y; + } + return base( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ); +} + + +// EXPORTS // + +module.exports = chemv; From 31ddab81f416304ad2d69bfa20e3aa752c993ff4 Mon Sep 17 00:00:00 2001 From: Divit Date: Wed, 18 Mar 2026 16:35:48 +0000 Subject: [PATCH 09/26] test: test.js 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/chemv/test/test.js | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/test.js diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/test.js b/lib/node_modules/@stdlib/blas/base/chemv/test/test.js new file mode 100644 index 000000000000..bae95bef4d2b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/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 chemv = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': isBrowser +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof chemv, '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 chemv.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 chemv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( chemv, 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 chemv; + var main; + + main = require( './../lib/chemv.js' ); + + chemv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( chemv, main, 'returns JavaScript implementation' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); From d63d659e2fb525cb6fa1ba21b3ca9b7bced67bf4 Mon Sep 17 00:00:00 2001 From: Divit Date: Wed, 18 Mar 2026 16:46:38 +0000 Subject: [PATCH 10/26] test: test.chemv.js added --- .../blas/base/chemv/test/test.chemv.js | 896 ++++++++++++++++++ 1 file changed, 896 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js b/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js new file mode 100644 index 000000000000..eac3be6c971e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js @@ -0,0 +1,896 @@ +/** +* @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 chemv = require( './../lib/chemv.js' ); + + +// FIXTURES // + +var cu = require( './fixtures/column_major_u.json' ); +var cl = require( './fixtures/column_major_l.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 cx = require( './fixtures/column_major_x_zeros.json' ); +var cxb = require( './fixtures/column_major_x_zeros_beta_one.json' ); +var ca = require( './fixtures/column_major_alpha_zero.json' ); +var ru = require( './fixtures/row_major_u.json' ); +var rl = require( './fixtures/row_major_l.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' ); +var rx = require( './fixtures/row_major_x_zeros.json' ); +var rxb = require( './fixtures/row_major_x_zeros_beta_one.json' ); +var ra = require( './fixtures/row_major_alpha_zero.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof chemv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 11', function test( t ) { + t.strictEqual( chemv.length, 11, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chemv( value, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chemv( data.order, value, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chemv( data.order, data.uplo, value, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid sixth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 2, + 1, + 0, + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chemv( data.order, data.uplo, data.N, alpha, a, value, x, data.strideX, beta, y, data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid eighth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, value, beta, y, data.strideY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid eleventh argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, value ); + }; + } +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (row-major, lower)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, lower)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (row-major, upper)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ru; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, upper)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (row-major)', function test( t ) { + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (column-major)', function test( t ) { + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxb; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxb; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ra; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ca; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rx; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cx; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxpyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxpyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxnyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxnyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxpyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxpyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxnyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxnyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); From 82291ac8d593215202b82a2b1ee2fe49ca0d05a2 Mon Sep 17 00:00:00 2001 From: Divit Date: Wed, 18 Mar 2026 18:17:38 +0000 Subject: [PATCH 11/26] test: test.ndarray.js added --- .../blas/base/chemv/test/test.chemv.js | 68 +- .../blas/base/chemv/test/test.ndarray.js | 1291 +++++++++++++++++ 2 files changed, 1353 insertions(+), 6 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/test.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js b/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js index eac3be6c971e..85697716ac08 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js @@ -33,22 +33,22 @@ var chemv = require( './../lib/chemv.js' ); var cu = require( './fixtures/column_major_u.json' ); var cl = require( './fixtures/column_major_l.json' ); +var cx = require( './fixtures/column_major_x_zeros.json' ); +var cxb = require( './fixtures/column_major_x_zeros_beta_one.json' ); +var ca = require( './fixtures/column_major_alpha_zero.json' ); var cxnyn = require( './fixtures/column_major_xnyn.json' ); var cxpyn = require( './fixtures/column_major_xpyn.json' ); var cxnyp = require( './fixtures/column_major_xnyp.json' ); var cxpyp = require( './fixtures/column_major_xpyp.json' ); -var cx = require( './fixtures/column_major_x_zeros.json' ); -var cxb = require( './fixtures/column_major_x_zeros_beta_one.json' ); -var ca = require( './fixtures/column_major_alpha_zero.json' ); var ru = require( './fixtures/row_major_u.json' ); var rl = require( './fixtures/row_major_l.json' ); +var rx = require( './fixtures/row_major_x_zeros.json' ); +var rxb = require( './fixtures/row_major_x_zeros_beta_one.json' ); +var ra = require( './fixtures/row_major_alpha_zero.json' ); var rxnyn = require( './fixtures/row_major_xnyn.json' ); var rxpyn = require( './fixtures/row_major_xpyn.json' ); var rxnyp = require( './fixtures/row_major_xnyp.json' ); var rxpyp = require( './fixtures/row_major_xpyp.json' ); -var rx = require( './fixtures/row_major_x_zeros.json' ); -var rxb = require( './fixtures/row_major_x_zeros_beta_one.json' ); -var ra = require( './fixtures/row_major_alpha_zero.json' ); // TESTS // @@ -447,6 +447,62 @@ tape( 'the function returns a reference to the second input vector (column-major t.end(); }); +tape( 'if `N` is `0`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = chemv( data.order, data.uplo, 0, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is `0`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = chemv( data.order, data.uplo, 0, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) { var expected; var alpha; diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/chemv/test/test.ndarray.js new file mode 100644 index 000000000000..cf48e12551a7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/test.ndarray.js @@ -0,0 +1,1291 @@ +/** +* @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 chemv = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var cu = require( './fixtures/column_major_u.json' ); +var cl = require( './fixtures/column_major_l.json' ); +var cx = require( './fixtures/column_major_x_zeros.json' ); +var cxb = require( './fixtures/column_major_x_zeros_beta_one.json' ); +var ca = require( './fixtures/column_major_alpha_zero.json' ); +var csa1sa2 = require( './fixtures/column_major_sa1_sa2.json' ); +var csa1nsa2 = require( './fixtures/column_major_sa1n_sa2.json' ); +var csa1sa2n = require( './fixtures/column_major_sa1_sa2n.json' ); +var csa1nsa2n = require( './fixtures/column_major_sa1n_sa2n.json' ); +var cxnyn = require( './fixtures/column_major_xnyn.json' ); +var cxpyn = require( './fixtures/column_major_xpyn.json' ); +var cxnyp = require( './fixtures/column_major_xnyp.json' ); +var cxpyp = require( './fixtures/column_major_xpyp.json' ); +var 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 rxb = require( './fixtures/row_major_x_zeros_beta_one.json' ); +var ra = require( './fixtures/row_major_alpha_zero.json' ); +var rl = require( './fixtures/row_major_l.json' ); +var rsa1sa2 = require( './fixtures/row_major_sa1_sa2.json' ); +var rsa1nsa2 = require( './fixtures/row_major_sa1n_sa2.json' ); +var rsa1sa2n = require( './fixtures/row_major_sa1_sa2n.json' ); +var rsa1nsa2n = require( './fixtures/row_major_sa1n_sa2n.json' ); +var rxpyp = require( './fixtures/row_major_xpyp.json' ); +var rxnyn = require( './fixtures/row_major_xnyn.json' ); +var rxpyn = require( './fixtures/row_major_xpyn.json' ); +var rxnyp = require( './fixtures/row_major_xnyp.json' ); +var 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 chemv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 14', function test( t ) { + t.strictEqual( chemv.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 a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chemv( value, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chemv( data.uplo, value, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chemv( data.uplo, data.N, alpha, a, value, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid sixth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chemv( data.uplo, data.N, alpha, a, data.strideA1, value, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid ninth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, value, data.offsetX, beta, y, data.strideY, data.offsetY ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid thirteenth argument', function test( t ) { + var values; + var alpha; + var data; + var beta; + var i; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, value, data.offsetY ); + }; + } +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (row-major, lower)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, lower)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (row-major, upper)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ru; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, upper)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (row-major)', function test( t ) { + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector (column-major)', function test( t ) { + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `N` is `0`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = chemv( data.uplo, 0, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is `0`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y ); + + out = chemv( data.uplo, 0, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( 1.0, 0.0 ); + + expected = new Complex64Array( data.y ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxb; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is `1`, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxb; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ra; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function scales the second input vector by `β` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = ca; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( 0.0, 0.0 ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rx; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the second input vector by `β` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cx; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rsa1sa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = csa1sa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rsa1nsa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = csa1nsa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rsa1sa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = csa1sa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports negative strides for `A` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rsa1nsa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports negative strides for `A` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = csa1nsa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset parameter for `A` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = roa; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset parameter for `A` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = coa; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxpyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxpyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxnyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxnyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxpyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxpyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying negative strides for `x` and `y` (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rxnyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying negative strides for `x` and `y` (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cxnyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (row-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = rap; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (column-major)', function test( t ) { + var expected; + var alpha; + var data; + var beta; + var out; + var a; + var x; + var y; + + data = cap; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + + alpha = new Complex64( data.alpha[0], data.alpha[1] ); + beta = new Complex64( data.beta[0], data.beta[1] ); + + expected = new Complex64Array( data.y_out ); + + out = chemv( data.uplo, data.N, alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, beta, y, data.strideY, data.offsetY ); + t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); From f11e307bc17675affeb5840a57ee6781764e2709 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 19 Mar 2026 05:51:16 +0000 Subject: [PATCH 12/26] test: basic fixtures added --- .../chemv/test/fixtures/column_major_l.json | 24 ++++++++ .../chemv/test/fixtures/column_major_u.json | 24 ++++++++ .../base/chemv/test/fixtures/row_major_l.json | 24 ++++++++ .../base/chemv/test/fixtures/row_major_u.json | 24 ++++++++ .../blas/base/chemv/test/test.chemv.js | 58 +++++++++---------- 5 files changed, 125 insertions(+), 29 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_l.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_l.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_u.json diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_l.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_l.json new file mode 100644 index 000000000000..88943ce06764 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_l.json @@ -0,0 +1,24 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 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 ], + "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 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_u.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_u.json new file mode 100644 index 000000000000..568dc0767d08 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_u.json @@ -0,0 +1,24 @@ +{ + "order": "column-major", + "uplo": "upper", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 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 ], + "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 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_l.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_l.json new file mode 100644 index 000000000000..c8900f6648da --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_l.json @@ -0,0 +1,24 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 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 ], + "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 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_u.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_u.json new file mode 100644 index 000000000000..441fa74fffb2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_u.json @@ -0,0 +1,24 @@ +{ + "order": "row-major", + "uplo": "upper", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 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 ], + "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 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js b/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js index 85697716ac08..701d2bc242f7 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js @@ -97,7 +97,7 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - chemv( value, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + chemv( value, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); }; } }); @@ -135,7 +135,7 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - chemv( data.order, value, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + chemv( data.order, value, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); }; } }); @@ -172,7 +172,7 @@ tape( 'the function throws an error if provided an invalid third argument', func function badValue( value ) { return function badValue() { - chemv( data.order, data.uplo, value, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + chemv( data.order, data.uplo, value, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); }; } }); @@ -247,7 +247,7 @@ tape( 'the function throws an error if provided an invalid eighth argument', fun function badValue( value ) { return function badValue() { - chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, value, beta, y, data.strideY ); + chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, value, beta, y, data.strideY ); }; } }); @@ -282,7 +282,7 @@ tape( 'the function throws an error if provided an invalid eleventh argument', f function badValue( value ) { return function badValue() { - chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, value ); + chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, value ); }; } }); @@ -308,7 +308,7 @@ tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (ro expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); @@ -336,7 +336,7 @@ tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (co expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); @@ -364,7 +364,7 @@ tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (ro expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); @@ -392,7 +392,7 @@ tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (co expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); @@ -417,7 +417,7 @@ tape( 'the function returns a reference to the second input vector (row-major)', alpha = new Complex64( data.alpha[0], data.alpha[1] ); beta = new Complex64( data.beta[0], data.beta[1] ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.end(); @@ -441,7 +441,7 @@ tape( 'the function returns a reference to the second input vector (column-major alpha = new Complex64( data.alpha[0], data.alpha[1] ); beta = new Complex64( data.beta[0], data.beta[1] ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.end(); @@ -468,7 +468,7 @@ tape( 'if `N` is `0`, the function returns the second input vector unchanged (ro expected = new Complex64Array( data.y ); - out = chemv( data.order, data.uplo, 0, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, 0, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -496,7 +496,7 @@ tape( 'if `N` is `0`, the function returns the second input vector unchanged (co expected = new Complex64Array( data.y ); - out = chemv( data.order, data.uplo, 0, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, 0, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -524,7 +524,7 @@ tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vec expected = new Complex64Array( data.y ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); @@ -552,7 +552,7 @@ tape( 'if `α` is `0` and `β` is `1`, the function returns the second input vec expected = new Complex64Array( data.y ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); @@ -580,7 +580,7 @@ tape( 'if `x` contains only zeros and `β` is `1`, the function returns the seco expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -608,7 +608,7 @@ tape( 'if `x` contains only zeros and `β` is `1`, the function returns the seco expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -636,7 +636,7 @@ tape( 'if `α` is `0`, the function scales the second input vector by `β` (row- expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -664,7 +664,7 @@ tape( 'if `α` is `0`, the function scales the second input vector by `β` (colu expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -692,7 +692,7 @@ tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the s expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -720,7 +720,7 @@ tape( 'if `x` contains only zeros and `β` is not `1`, the function scales the s expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -748,7 +748,7 @@ tape( 'the function supports specifying `x` and `y` strides (row-major)', functi expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -776,7 +776,7 @@ tape( 'the function supports specifying `x` and `y` strides (column-major)', fun expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -804,7 +804,7 @@ tape( 'the function supports specifying a negative `x` stride (row-major)', func expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -832,7 +832,7 @@ tape( 'the function supports specifying a negative `x` stride (column-major)', f expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -860,7 +860,7 @@ tape( 'the function supports specifying a negative `y` stride (row-major)', func expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -888,7 +888,7 @@ tape( 'the function supports specifying a negative `y` stride (column-major)', f expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -916,7 +916,7 @@ tape( 'the function supports complex access patterns (row-major)', function test expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -944,7 +944,7 @@ tape( 'the function supports complex access patterns (column-major)', function t expected = new Complex64Array( data.y_out ); - out = chemv( data.order, data.uplo, data.N, alpha, a, data.LDA, x, data.strideX, beta, y, data.strideY ); + out = chemv( data.order, data.uplo, data.N, alpha, a, data.lda, x, data.strideX, beta, y, data.strideY ); t.strictEqual( isSameComplex64Array( out, y ), true, 'returns expected values' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); From c621cf229261dab9fbf2cf33c9159c0394a61d81 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 19 Mar 2026 09:07:54 +0000 Subject: [PATCH 13/26] chore: paths added of conjugation of row and colmun major in base.js --- 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/chemv/lib/base.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js index 688cff75ac3d..c81108d537bc 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js @@ -79,6 +79,7 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs var viewY; var isrm; var cima; + var sign; var sa0; var sa1; var oa2; @@ -99,6 +100,7 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs // Layout isrm = isRowMajor( [ strideA1, strideA2 ] ); + console.log( 'isRowMajor: ', isrm ); // Decompose scalars rebeta = realf( beta ); @@ -133,6 +135,12 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs sa1 = strideA2 * 2; // offset increment for outermost loop } + if ( isrm ) { + sign = -1; + } else { + sign = 1; + } + // Vector indexing base oa = offsetA * 2; ox = offsetX * 2; @@ -161,14 +169,14 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs ia = oa2 + ( i0 * sa0 ); rea = viewA[ ia ]; ima = viewA[ ia + 1 ]; - cima = -ima; + 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 ) - ( ima * imx ) ); - imtmp2 += f32( ( rea * imx ) + ( ima * rex ) ); + 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 @@ -190,14 +198,14 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs ia = oa2 + ( i0 * sa0 ); rea = viewA[ ia ]; ima = viewA[ ia + 1 ]; - cima = -ima; + 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 ) - ( ima * imx ) ); - imtmp2 += f32( ( rea * imx ) + ( ima * rex ) ); + retmp2 += f32( ( rea * rex ) + ( cima * imx ) ); + imtmp2 += f32( ( rea * imx ) - ( cima * rex ) ); } ia = oa2 + ( i1 * sa0 ); rea = viewA[ ia ]; From 8325fe9e7aa8e54c9f074d54b06e4e8d14eb73af Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 19 Mar 2026 09:15:56 +0000 Subject: [PATCH 14/26] 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: 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 --- --- lib/node_modules/@stdlib/blas/base/chemv/lib/base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js index c81108d537bc..d4dab1310be0 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js @@ -100,7 +100,6 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs // Layout isrm = isRowMajor( [ strideA1, strideA2 ] ); - console.log( 'isRowMajor: ', isrm ); // Decompose scalars rebeta = realf( beta ); @@ -135,6 +134,7 @@ function chemv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs sa1 = strideA2 * 2; // offset increment for outermost loop } + // Adjust sign to account for layout-dependent conjugation if ( isrm ) { sign = -1; } else { From 0ea0919b3bd5d5a25b244244bc089ef561d5a254 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 19 Mar 2026 11:25:55 +0000 Subject: [PATCH 15/26] test: fixtures added for x zero and aplha zero --- .../fixtures/column_major_alpha_zero.json | 24 +++++++++++++++++++ .../test/fixtures/column_major_x_zeros.json | 24 +++++++++++++++++++ .../column_major_x_zeros_beta_one.json | 24 +++++++++++++++++++ .../test/fixtures/row_major_alpha_zero.json | 24 +++++++++++++++++++ .../test/fixtures/row_major_x_zeros.json | 24 +++++++++++++++++++ .../fixtures/row_major_x_zeros_beta_one.json | 24 +++++++++++++++++++ .../blas/base/chemv/test/test.chemv.js | 4 ++-- 7 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_alpha_zero.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_x_zeros.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_x_zeros_beta_one.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_alpha_zero.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_x_zeros.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_x_zeros_beta_one.json diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_alpha_zero.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_alpha_zero.json new file mode 100644 index 000000000000..33bc806e43e3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_alpha_zero.json @@ -0,0 +1,24 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.0, 0.0 ], + "A": [ 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 ], + "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 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 3.0, 0.0, 2.0, 0.0, 1.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_x_zeros.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_x_zeros.json new file mode 100644 index 000000000000..0d02aeff9fd3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_x_zeros.json @@ -0,0 +1,24 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 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 ], + "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 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 3.0, 0.0, 2.0, 0.0, 1.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_x_zeros_beta_one.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_x_zeros_beta_one.json new file mode 100644 index 000000000000..086477fa30d1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_x_zeros_beta_one.json @@ -0,0 +1,24 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 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 ], + "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 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 1.0, 0.0 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_alpha_zero.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_alpha_zero.json new file mode 100644 index 000000000000..38665f57d358 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_alpha_zero.json @@ -0,0 +1,24 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.0, 0.0 ], + "A": [ 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 ], + "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 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 3.0, 0.0, 2.0, 0.0, 1.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_x_zeros.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_x_zeros.json new file mode 100644 index 000000000000..97a5207d8bcd --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_x_zeros.json @@ -0,0 +1,24 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 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 ], + "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 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 3.0, 0.0, 2.0, 0.0, 1.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_x_zeros_beta_one.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_x_zeros_beta_one.json new file mode 100644 index 000000000000..1ca941630cca --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_x_zeros_beta_one.json @@ -0,0 +1,24 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 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 ], + "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 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 1.0, 0.0 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js b/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js index 701d2bc242f7..38269cd4b806 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/test.chemv.js @@ -895,7 +895,7 @@ tape( 'the function supports specifying a negative `y` stride (column-major)', f t.end(); }); -tape( 'the function supports complex access patterns (row-major)', function test( t ) { +tape( 'the function supports specifying negative strides for `x` and `y` (row-major)', function test( t ) { var expected; var alpha; var data; @@ -923,7 +923,7 @@ tape( 'the function supports complex access patterns (row-major)', function test t.end(); }); -tape( 'the function supports complex access patterns (column-major)', function test( t ) { +tape( 'the function supports specifying negative strides for `x` and `y` (column-major)', function test( t ) { var expected; var alpha; var data; From 95896c6a30f3862f2fcef54060c05427ea377470 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 19 Mar 2026 14:16:55 +0000 Subject: [PATCH 16/26] test: fixtures added for vector strides --- 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 | 25 +++++++++++++++++++ .../test/fixtures/column_major_xnyp.json | 25 +++++++++++++++++++ .../test/fixtures/column_major_xpyn.json | 25 +++++++++++++++++++ .../test/fixtures/column_major_xpyp.json | 25 +++++++++++++++++++ .../chemv/test/fixtures/row_major_xnyn.json | 25 +++++++++++++++++++ .../chemv/test/fixtures/row_major_xnyp.json | 25 +++++++++++++++++++ .../chemv/test/fixtures/row_major_xpyn.json | 25 +++++++++++++++++++ .../chemv/test/fixtures/row_major_xpyp.json | 25 +++++++++++++++++++ 8 files changed, 200 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_xnyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_xnyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_xpyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_xpyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_xnyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_xnyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_xpyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_xpyp.json diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_xnyn.json new file mode 100644 index 000000000000..18baf58b97ea --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_xnyn.json @@ -0,0 +1,25 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 2.0, 2.0, 3.0, -3.0, 4.0, 4.0, 0.0, 0.0, 5.0, 0.0, 6.0, 6.0, 7.0, -7.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 9.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.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 ] + ], + "lda": 4, + "strideA1": 1, + "strideA2": 4, + "offsetA": 0, + "x": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideX": -1, + "offsetX": 3, + "beta": [ 0.5, -0.5 ], + "y": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideY": -1, + "offsetY": 3, + "y_out": [ -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/chemv/test/fixtures/column_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_xnyp.json new file mode 100644 index 000000000000..0b23edfeadf9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_xnyp.json @@ -0,0 +1,25 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 2.0, 2.0, 3.0, -3.0, 4.0, 4.0, 0.0, 0.0, 5.0, 0.0, 6.0, 6.0, 7.0, -7.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 9.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.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 ] + ], + "lda": 4, + "strideA1": 1, + "strideA2": 4, + "offsetA": 0, + "x": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideX": -1, + "offsetX": 3, + "beta": [ 0.5, -0.5 ], + "y": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 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/chemv/test/fixtures/column_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_xpyn.json new file mode 100644 index 000000000000..7358ab755121 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_xpyn.json @@ -0,0 +1,25 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 2.0, 2.0, 3.0, -3.0, 4.0, 4.0, 0.0, 0.0, 5.0, 0.0, 6.0, 6.0, 7.0, -7.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 9.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.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 ] + ], + "lda": 4, + "strideA1": 1, + "strideA2": 4, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideY": -1, + "offsetY": 3, + "y_out": [ -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/chemv/test/fixtures/column_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_xpyp.json new file mode 100644 index 000000000000..ca22e270d1b5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_xpyp.json @@ -0,0 +1,25 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 2.0, 2.0, 3.0, -3.0, 4.0, 4.0, 0.0, 0.0, 5.0, 0.0, 6.0, 6.0, 7.0, -7.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 9.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.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 ] + ], + "lda": 4, + "strideA1": 1, + "strideA2": 4, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 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/chemv/test/fixtures/row_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_xnyn.json new file mode 100644 index 000000000000..542acb7952e6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_xnyn.json @@ -0,0 +1,25 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "A": [ 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 ], + "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 ] + ], + "lda": 4, + "strideA1": 4, + "strideA2": 1, + "offsetA": 0, + "x": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideX": -1, + "offsetX": 3, + "beta": [ 0.5, -0.5 ], + "y": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideY": -1, + "offsetY": 3, + "y_out": [ -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/chemv/test/fixtures/row_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_xnyp.json new file mode 100644 index 000000000000..8c799cc83ac2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_xnyp.json @@ -0,0 +1,25 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "A": [ 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 ], + "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 ] + ], + "lda": 4, + "strideA1": 4, + "strideA2": 1, + "offsetA": 0, + "x": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideX": -1, + "offsetX": 3, + "beta": [ 0.5, -0.5 ], + "y": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 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/chemv/test/fixtures/row_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_xpyn.json new file mode 100644 index 000000000000..ed27c26ba2a9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_xpyn.json @@ -0,0 +1,25 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "A": [ 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 ], + "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 ] + ], + "lda": 4, + "strideA1": 4, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideY": -1, + "offsetY": 3, + "y_out": [ -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/chemv/test/fixtures/row_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_xpyp.json new file mode 100644 index 000000000000..7507c39348a0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_xpyp.json @@ -0,0 +1,25 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + "alpha": [ 0.5, 0.5 ], + "A": [ 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 ], + "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 ] + ], + "lda": 4, + "strideA1": 4, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 4.0, 4.0, 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ 15.0, 30.0, -9.0, 58.0, 29.0, 75.0, -16.0, 85.0 ] +} From 01ba7090ac507bfb5d9779899463cd21e5ece7cc Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 19 Mar 2026 14:28:27 +0000 Subject: [PATCH 17/26] test: fixtures added for A offset --- 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 --- --- .../chemv/test/fixtures/column_major_oa.json | 23 +++++++++++++++++++ .../chemv/test/fixtures/row_major_oa.json | 23 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_oa.json diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_oa.json new file mode 100644 index 000000000000..2ce7be6fd262 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_oa.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 ], + "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 ] + ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 10, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_oa.json new file mode 100644 index 000000000000..e7cf0e320373 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_oa.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 ], + "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 ] + ], + "strideA1": 3, + "strideA2": 1, + "offsetA": 6, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} From cf17a9f19bf5cec0c2435f2f3389996e22366c7f Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 19 Mar 2026 18:07:16 +0000 Subject: [PATCH 18/26] test: fixtures added for A strides --- 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 --- --- .../chemv/test/fixtures/column_major_oa.json | 2 +- .../test/fixtures/column_major_sa1_sa2.json | 23 +++++++++++++++++++ .../test/fixtures/column_major_sa1_sa2n.json | 23 +++++++++++++++++++ .../test/fixtures/column_major_sa1n_sa2.json | 23 +++++++++++++++++++ .../test/fixtures/column_major_sa1n_sa2n.json | 23 +++++++++++++++++++ .../chemv/test/fixtures/row_major_oa.json | 2 +- .../test/fixtures/row_major_sa1_sa2.json | 23 +++++++++++++++++++ .../test/fixtures/row_major_sa1_sa2n.json | 23 +++++++++++++++++++ .../test/fixtures/row_major_sa1n_sa2.json | 23 +++++++++++++++++++ .../test/fixtures/row_major_sa1n_sa2n.json | 23 +++++++++++++++++++ 10 files changed, 186 insertions(+), 2 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1n_sa2n.json diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_oa.json index 2ce7be6fd262..a291f8cd23d3 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_oa.json +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_oa.json @@ -3,7 +3,7 @@ "uplo": "lower", "N": 3, "alpha": [ 0.5, 0.5 ], - "A": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 ], + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 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 ], "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 ], diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1_sa2.json new file mode 100644 index 000000000000..95828d63fd31 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1_sa2.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 3.0, -3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 4.0, 0.0, 999.0, 999.0, 5.0, -5.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.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 ] + ], + "strideA1": 2, + "strideA2": 9, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1_sa2n.json new file mode 100644 index 000000000000..02fbd985be52 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1_sa2n.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 6.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 4.0, 0.0, 999.0, 999.0, 5.0, -5.0, 999.0, 999.0, 999.0, 999.0, 1.0, 0.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 3.0, -3.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 ] + ], + "strideA1": 2, + "strideA2": -7, + "offsetA": 14, + "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/chemv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1n_sa2.json new file mode 100644 index 000000000000..bacfd724726b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1n_sa2.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 3.0, -3.0, 999.0, 999.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 999.0, 999.0, 1.0, 0.0, 999.0, 999.0, 999.0, 999.0, 5.0, -5.0, 999.0, 999.0, 999.0, 999.0, 4.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 6.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.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 ] + ], + "strideA1": -3, + "strideA2": 9, + "offsetA": 6, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1n_sa2n.json new file mode 100644 index 000000000000..54ed8bc619d7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_sa1n_sa2n.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 6.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 5.0, -5.0, 999.0, 999.0, 999.0, 999.0, 4.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 3.0, -3.0, 999.0, 999.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 999.0, 999.0, 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 ] + ], + "strideA1": -3, + "strideA2": -7, + "offsetA": 20, + "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/chemv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_oa.json index e7cf0e320373..c22a718be5cd 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_oa.json +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_oa.json @@ -3,7 +3,7 @@ "uplo": "lower", "N": 3, "alpha": [ 0.5, 0.5 ], - "A": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 ], + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 0.0, 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 ], "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 ], diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1_sa2.json new file mode 100644 index 000000000000..fcc0d70ac919 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1_sa2.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 1.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 999.0, 999.0, 4.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 3.0, -3.0, 999.0, 999.0, 999.0, 999.0, 5.0, -5.0, 999.0, 999.0, 999.0, 999.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 ] + ], + "strideA1": 8, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1_sa2n.json new file mode 100644 index 000000000000..92dbfc15ce9b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1_sa2n.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 1.0, 0.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 4.0, 0.0, 999.0, 999.0, 999.0, 999.0, 2.0, -2.0, 6.0, 0.0, 999.0, 999.0, 999.0, 999.0, 5.0, -5.0, 999.0, 999.0, 999.0, 999.0, 3.0, -3.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 ] + ], + "strideA1": 7, + "strideA2": -3, + "offsetA": 6, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1n_sa2.json new file mode 100644 index 000000000000..5c931aa31293 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1n_sa2.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 3.0, -3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, -5.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 6.0, 0.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 4.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 1.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.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 ] + ], + "strideA1": -10, + "strideA2": 4, + "offsetA": 20, + "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/chemv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1n_sa2n.json new file mode 100644 index 000000000000..c0b510116de4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_sa1n_sa2n.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 6.0, 0.0, 999.0, 999.0, 5.0, -5.0, 999.0, 999.0, 3.0, -3.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 4.0, 0.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 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 ] + ], + "strideA1": -6, + "strideA2": -2, + "offsetA": 16, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "beta": [ 0.5, -0.5 ], + "y": [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ], + "strideY": 1, + "offsetY": 0, + "y_out": [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +} From f24bfeaa1eb8ed1791bcac56fbbb83d5f1a99372 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 19 Mar 2026 18:32:10 +0000 Subject: [PATCH 19/26] test: fixtures added for complex acces pattern --- 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 | 23 +++++++++++++++++++ .../row_major_complex_access_pattern.json | 23 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_complex_access_pattern.json diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 000000000000..3154c38b3af5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/column_major_complex_access_pattern.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 999.0, 999.0, 999.0, 999.0, 6.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, -5.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 4.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, -3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 0.0 ], + "A_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 ] + ], + "strideA1": -5, + "strideA2": -15, + "offsetA": 42, + "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/chemv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 000000000000..13fd12bea2e4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/fixtures/row_major_complex_access_pattern.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 0.5, 0.5 ], + "A": [ 999.0, 999.0, 999.0, 999.0, 6.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, -5.0, 999.0, 999.0, 999.0, 999.0, 4.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, -3.0, 999.0, 999.0, 999.0, 999.0, 2.0, -2.0, 999.0, 999.0, 999.0, 999.0, 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 ] + ], + "strideA1": -3, + "strideA2": -15, + "offsetA": 38, + "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 5c3271d146dc9c8623ea4399e80552c3b5e44a54 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 19 Mar 2026 18:37:28 +0000 Subject: [PATCH 20/26] chore: test names corrected --- 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/chemv/test/test.ndarray.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chemv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/chemv/test/test.ndarray.js index cf48e12551a7..fd9c9ba29cae 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/test/test.ndarray.js @@ -36,6 +36,7 @@ var cl = require( './fixtures/column_major_l.json' ); var cx = require( './fixtures/column_major_x_zeros.json' ); var cxb = require( './fixtures/column_major_x_zeros_beta_one.json' ); var ca = require( './fixtures/column_major_alpha_zero.json' ); +var coa = require( './fixtures/column_major_oa.json' ); var csa1sa2 = require( './fixtures/column_major_sa1_sa2.json' ); var csa1nsa2 = require( './fixtures/column_major_sa1n_sa2.json' ); var csa1sa2n = require( './fixtures/column_major_sa1_sa2n.json' ); @@ -44,12 +45,12 @@ 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 cap = require( './fixtures/column_major_complex_access_pattern.json' ); var ru = require( './fixtures/row_major_u.json' ); var rx = require( './fixtures/row_major_x_zeros.json' ); var rxb = require( './fixtures/row_major_x_zeros_beta_one.json' ); var ra = require( './fixtures/row_major_alpha_zero.json' ); +var roa = require( './fixtures/row_major_oa.json' ); var rl = require( './fixtures/row_major_l.json' ); var rsa1sa2 = require( './fixtures/row_major_sa1_sa2.json' ); var rsa1nsa2 = require( './fixtures/row_major_sa1n_sa2.json' ); @@ -59,7 +60,7 @@ 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' ); +var rap = require( './fixtures/row_major_complex_access_pattern.json' ); // TESTS // From 3836ecf03f34103b09332c030246a14cf2a98408 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 20 Mar 2026 04:56:17 +0000 Subject: [PATCH 21/26] docs: types and type 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/chemv/docs/types/index.d.ts | 144 +++++ .../blas/base/chemv/docs/types/test.ts | 542 ++++++++++++++++++ 2 files changed, 686 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/docs/types/test.ts diff --git a/lib/node_modules/@stdlib/blas/base/chemv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/chemv/docs/types/index.d.ts new file mode 100644 index 000000000000..066eab124aec --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/docs/types/index.d.ts @@ -0,0 +1,144 @@ +/* +* @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 `chemv`. +*/ +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. + * + * @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 A - complex input matrix + * @param LDA - stride of the first dimension of `A` + * @param x - first complex input vector + * @param strideX - `x` stride length + * @param beta - complex scalar constant + * @param y - second complex input vector + * @param strideY - `y` stride length + * @returns `y` + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var A = new Complex64Array( [ 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 ] ); + * 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 ); + * + * chemv( 'row-major', 'lower', 3, alpha, A, 3, 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, A: Complex64Array, LDA: number, x: Complex64Array, strideX: number, beta: Complex64, y: Complex64Array, strideY: number ): Complex64Array; + + /** + * Performs the matrix-vector operation `y = α*A*x + β*y`, using alternative indexing semantics. + * + * @param uplo - specifies whether `A` is an upper or lower triangular part of matrix is supplied. + * @param N - number of elements along each dimension of `A` + * @param alpha - complex scalar constant + * @param A - complex input matrix + * @param strideA1 - stride of the first dimension of `A` + * @param strideA2 - stride of the second dimension of `A` + * @param offsetA - starting index for `A` + * @param x - first complex input vector + * @param strideX - `x` stride length + * @param offsetX - starting index for `x` + * @param beta - complex scalar constant + * @param y - second complex input vector + * @param strideY - `y` stride length + * @param offsetY - starting index for `y` + * @returns `y` + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var A = new Complex64Array( [ 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 ] ); + * 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 ); + * + * chemv.ndarray( 'lower', 3, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 ); + * // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] + */ + ndarray( uplo: MatrixTriangle, N: number, alpha: Complex64, A: Complex64Array, strideA1: number, strideA2: number, offsetA: number, x: Complex64Array, strideX: number, offsetX: number, beta: Complex64, y: Complex64Array, strideY: number, offsetY: number ): Complex64Array; +} + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are N element complex vectors, and `A` is an `N` by `N` Hermitian matrix. +* +* @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 A - complex input matrix +* @param LDA - stride of the first dimension of `A` +* @param x - first complex input vector +* @param strideX - `x` stride length +* @param beta - complex scalar constant +* @param y - second complex input vector +* @param strideY - `y` stride length +* @returns `y` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var A = new Complex64Array( [ 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 ] ); +* 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 ); +* +* chemv( 'row-major', 'lower', 3, alpha, A, 3, 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, 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 ] ); +* 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 ); +* +* chemv.ndarray( 'lower', 3, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 ); +* // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +*/ +declare var chemv: Routine; + + +// EXPORTS // + +export = chemv; diff --git a/lib/node_modules/@stdlib/blas/base/chemv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/chemv/docs/types/test.ts new file mode 100644 index 000000000000..542ee51fe781 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/docs/types/test.ts @@ -0,0 +1,542 @@ +/* +* @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 chemv = require( './index' ); + + +// TESTS // + +// The function returns a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 1.0, 0.0 ); + const beta = new Complex64( 1.0, 0.0 ); + + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectType Complex64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv( 10, 'lower', 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( true, 'lower', 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( false, 'lower', 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( null, 'lower', 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( undefined, 'lower', 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( [], 'lower', 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( {}, 'lower', 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( ( x: number ): number => x, 'lower', 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv( 'row-major', 10, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', true, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', false, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', null, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', undefined, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', [], 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', {}, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', ( x: number ): number => x, 10, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv( 'row-major', 'lower', '10', alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', true, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', false, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', null, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', undefined, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', [], alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', {}, alpha, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', ( x: number ): number => x, alpha, A, 10, 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 A = new Complex64Array( 20 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv( 'row-major', 'lower', 10, '10', A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, true, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, false, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, null, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, undefined, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, [], A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, {}, A, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, ( x: number ): number => x, A, 10, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a 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 ); + + chemv( 'row-major', 'lower', 10, alpha, 10, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, '10', 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, true, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, false, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, null, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, undefined, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, [ '1' ], 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, {}, 10, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, ( x: number ): number => x, 10, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv( 'row-major', 'lower', 10, alpha, A, '10', x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, true, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, false, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, null, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, undefined, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, [], x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, {}, x, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, ( x: number ): number => x, x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an seventh argument which is not a Complex64Array... +{ + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv( 'row-major', 'lower', 10, alpha, A, 10, 10, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, '10', 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, true, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, false, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, null, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, undefined, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, [ '1' ], 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, {}, 1, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, ( x: number ): number => x, 1, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eighth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, '10', beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, true, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, false, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, null, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, undefined, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, [], beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, {}, beta, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, ( x: number ): number => x, beta, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a Complex64... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, '10', y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, true, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, false, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, null, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, undefined, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, [], y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, {}, y, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, ( x: number ): number => x, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an tenth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, 10, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, '10', 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, true, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, false, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, null, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, undefined, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, [], 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, {}, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eleventh argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, y, '10' ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, y, true ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, y, false ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, y, null ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, y, undefined ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, y, [] ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, y, {} ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, y, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv(); // $ExpectError + chemv( 'row-major' ); // $ExpectError + chemv( 'row-major', 'lower' ); // $ExpectError + chemv( 'row-major', 'lower', 10 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1 ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, y ); // $ExpectError + chemv( 'row-major', 'lower', 10, alpha, A, 10, x, 1, beta, y, 1, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectType Complex64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv.ndarray( 10, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( true, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( false, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( null, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( undefined, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( [ '1' ], 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( {}, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( ( x: number ): number => x, 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv.ndarray( 'lower', '10', alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', true, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', false, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', null, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', undefined, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', [], alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', {}, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', ( x: number ): number => x, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a Complex64... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv.ndarray( 'lower', 10, '10', A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, 10, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, true, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, false, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, null, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, undefined, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, [], A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, {}, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, ( x: number ): number => x, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a forth 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 ); + + chemv.ndarray( 'lower', 10, alpha, 10, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, '10', 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, true, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, false, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, null, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, undefined, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, [], 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, {}, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, ( x: number ): number => x, 10, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv.ndarray( 'lower', 10, alpha, A, '10', 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, true, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, false, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, null, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, undefined, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, [], 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, {}, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, ( x: number ): number => x, 1, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv.ndarray( 'lower', 10, alpha, A, 10, '10', 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, true, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, false, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, null, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, undefined, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, [], 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, {}, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, ( x: number ): number => x, 0, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an seventh argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, '10', x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, true, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, false, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, null, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, undefined, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, [], x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, {}, x, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, ( x: number ): number => x, x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eighth argument which is not a Complex64Array... +{ + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, 10, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, '10', 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, true, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, false, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, null, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, undefined, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, [], 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, {}, 1, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, ( x: number ): number => x, 1, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, '10', 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, true, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, false, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, null, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, undefined, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, [], 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, {}, 0, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, ( x: number ): number => x, 0, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an tenth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, '10', beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, true, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, false, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, null, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, undefined, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, [], beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, {}, beta, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, ( x: number ): number => x, beta, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eleventh argument which is not a Complex64... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, '10', y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, 10, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, true, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, false, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, null, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, undefined, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, [], y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, {}, y, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, ( x: number ): number => x, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a twelfth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, 10, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, '10', 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, true, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, false, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, null, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, undefined, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, [], 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, {}, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a thirteenth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, '10', 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, true, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, false, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, null, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, undefined, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, [], 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, {}, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourteenth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, '10' ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, true ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, false ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, null ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, undefined ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, [] ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, {} ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 0.5, 0.5 ); + const beta = new Complex64( 0.5, -0.5 ); + + chemv.ndarray(); // $ExpectError + chemv.ndarray( 'lower' ); // $ExpectError + chemv.ndarray( 'lower', 10 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1 ); // $ExpectError + chemv.ndarray( 'lower', 10, alpha, A, 10, 1, 0, x, 1, 0, beta, y, 1, 0, 10 ); // $ExpectError +} From 356e828c9250435912c05520f35d5c98a9bef70d Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 20 Mar 2026 07:00:22 +0000 Subject: [PATCH 22/26] 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/chemv/docs/repl.txt | 186 ++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/docs/repl.txt diff --git a/lib/node_modules/@stdlib/blas/base/chemv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/chemv/docs/repl.txt new file mode 100644 index 000000000000..4f937f78a250 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/docs/repl.txt @@ -0,0 +1,186 @@ + +{{alias}}( order, uplo, N, α, A, lda, 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. + + 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. + + A: Complex64Array + Complex input matrix. + + lda: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + x: Complex64Array + First complex input vector. + + sx: integer + Index increment for `x`. + + β: Complex64 + Complex scalar constant. + + y: Complex64Array + Second complex input vector. + + sy: integer + Index increment for `y`. + + Returns + ------- + y: Complex64Array + Second complex input vector. + + Examples + -------- + // Standard usage: + > var x = new {{alias:@stdlib/array/complex64}}([1.0,1.0,2.0,2.0,3.0,3.0]); + > var y = new {{alias:@stdlib/array/complex64}}([3.0,3.0,2.0,2.0,1.0,1.0]); + > var buf1 = [1.0,0.0,0.0,0.0,0.0,0.0]; + > var buf2 = [2.0,-2.0,4.0,0.0,0.0,0.0]; + > var buf3 = [3.0,-3.0,5.0,-5.0,6.0,0.0]; + > var buf = buf1.concat( buf2, buf3 ); + > var A = new {{alias:@stdlib/array/complex64}}( buf ); + > var alpha = new {{alias:@stdlib/complex/float32/ctor}}(0.5,0.5); + > var beta = new {{alias:@stdlib/complex/float32/ctor}}(0.5,-0.5); + > var ord = 'row-major'; + > var uplo = 'lower'; + > {{alias}}( ord, uplo, 3, alpha, A, 3, 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]); + > buf1 = [1.0,0.0,0.0,0.0,0.0,0.0]; + > buf2 = [2.0,-2.0,4.0,0.0,0.0,0.0]; + > buf3 = [3.0,-3.0,5.0,-5.0,6.0,0.0]; + > buf = buf1.concat( buf2, buf3 ); + > A = new {{alias:@stdlib/array/complex64}}( buf ); + > alpha = new {{alias:@stdlib/complex/float32/ctor}}(0.5,0.5); + > beta = new {{alias:@stdlib/complex/float32/ctor}}(0.5,-0.5); + > ord = 'row-major'; + > uplo = 'lower'; + > {{alias}}( ord, uplo, 3, alpha, A, 3, 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 ); + > buf1 = [1.0,0.0,0.0,0.0,0.0,0.0]; + > buf2 = [2.0,-2.0,4.0,0.0,0.0,0.0]; + > buf3 = [3.0,-3.0,5.0,-5.0,6.0,0.0]; + > buf = buf1.concat( buf2, buf3 ); + > A = new {{alias:@stdlib/array/complex64}}( buf ); + > alpha = new {{alias:@stdlib/complex/float32/ctor}}(0.5,0.5); + > beta = new {{alias:@stdlib/complex/float32/ctor}}(0.5,-0.5); + > ord = 'row-major'; + > uplo = 'lower'; + > {{alias}}( ord, uplo, 3, alpha, A, 3, x1, -1, beta, y1, -1 ) + [14.0,31.0,-11.0,25.0,-10.0,14.0] + + +{{alias}}.ndarray( uplo, N, α, A, sa1, sa2, oa, x, sx, ox, β, y, sy, oy ) + Performs the matrix-vector operation `y = α*A*x + β*y` using alternative + indexing semantics and, where `α` and `β` are complex scalars, `x` and `y` + are N element complex vectors, and `A` is an `N` by `N` Hermitian matrix. + + While typed array views mandate a view offset based on the underlying buffer + , the offset parameters support indexing semantics based on starting + indices. + + Parameters + ---------- + uplo: string + Specifies whether the upper or lower triangular matrix of `A` is + supplied. Must be either 'upper' or 'lower'. + + N: integer + Number of columns in `A`. + + α: Complex64 + Complex scalar constant. + + A: Complex64Array + Complex input matrix. + + sa1: integer + Stride of the first dimension of `A`. + + sa2: integer + Stride of the second dimension of `A`. + + oa: integer + Starting index (offset) for `A`. + + x: Complex64Array + First complex input vector. + + sx: integer + Index increment for `x`. + + ox: integer + Starting index (offset) for `x`. + + β: Complex64 + Complex scalar constant. + + y: Complex64Array + Second complex input vector. + + sy: integer + Index increment for `y`. + + oy: integer + Starting index (offset) for `y`. + + Returns + ------- + y: Complex64Array + Second complex input vector. + + Examples + -------- + > x = new {{alias:@stdlib/array/complex64}}([1.0,1.0,2.0,2.0,3.0,3.0]); + > y = new {{alias:@stdlib/array/complex64}}([3.0,3.0,2.0,2.0,1.0,1.0]); + > buf1 = [1.0,0.0,0.0,0.0,0.0,0.0]; + > buf2 = [2.0,-2.0,4.0,0.0,0.0,0.0]; + > buf3 = [3.0,-3.0,5.0,-5.0,6.0,0.0]; + > buf = buf1.concat( buf2, buf3 ); + > A = new {{alias:@stdlib/array/complex64}}( buf ); + > alpha = new {{alias:@stdlib/complex/float32/ctor}}(0.5,0.5); + > beta = new {{alias:@stdlib/complex/float32/ctor}}(0.5,-0.5); + > uplo = 'lower'; + > {{alias}}.ndarray(uplo,3,alpha,A,3,1,0,x,1,0,beta,y,1,0) + [-10.0,14.0,-11.0,25.0,14.0,31.0] + + See Also + -------- From 6b009b89a66aa6f8eaa7ad09d4313004f9d40939 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 20 Mar 2026 07:08:00 +0000 Subject: [PATCH 23/26] docs: example 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: 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/chemv/examples/index.js | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/examples/index.js diff --git a/lib/node_modules/@stdlib/blas/base/chemv/examples/index.js b/lib/node_modules/@stdlib/blas/base/chemv/examples/index.js new file mode 100644 index 000000000000..c2998979c32d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/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 chemv = 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 A = filledarrayBy( N*N, 'complex64', rand ); +console.log( A.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() ); + +chemv( 'row-major', 'lower', N, alpha, A, N, x, 1, beta, y, 1 ); + +// Print the results: +logEach( '(%s)', y ); + +chemv.ndarray( 'lower', N, alpha, A, 1, N, 0, x, 1, 0, beta, y, 1, 0 ); + +// Print the results: +logEach( '(%s)', y ); From bce23e2b433f3041249cf9ce9efd598810cc7d59 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 20 Mar 2026 08:23:49 +0000 Subject: [PATCH 24/26] bench: benchmark 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: 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/chemv/benchmark/benchmark.js | 124 ++++++++++++++++++ .../base/chemv/benchmark/benchmark.ndarray.js | 124 ++++++++++++++++++ 2 files changed, 248 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/benchmark/benchmark.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/chemv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/chemv/benchmark/benchmark.js new file mode 100644 index 000000000000..5bf1c0e5e7c5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/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 chemv = require( './../lib/chemv.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var xbuf; + var ybuf; + var Abuf; + var x; + var y; + var A; + + xbuf = uniform( N*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + ybuf = uniform( N*2, -100.0, 100.0, options ); + y = new Complex64Array( ybuf.buffer ); + Abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex64Array( Abuf.buffer ); + + alpha = new Complex64( 0.5, 0.5 ); + beta = new Complex64( 0.5, -0.5 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + var z; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = chemv( 'row-major', 'lower', N, alpha, A, N, x, 1, beta, y, 1 ); + if ( isnanf( z[ i% ( z.length ) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z[ i % ( z.length ) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( format( '%s:size=%d', pkg, N*N ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/chemv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/chemv/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..a948802d633c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/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 chemv = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var xbuf; + var ybuf; + var Abuf; + var x; + var y; + var A; + + xbuf = uniform( N*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + ybuf = uniform( N*2, -100.0, 100.0, options ); + y = new Complex64Array( ybuf.buffer ); + Abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex64Array( Abuf.buffer ); + + alpha = new Complex64( 0.5, 0.5 ); + beta = new Complex64( 0.5, -0.5 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + var z; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = chemv( 'lower', N, alpha, A, 1, N, 0, x, 1, 0, beta, y, 1, 0 ); + if ( isnanf( z[ i % ( z.length ) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z[ i % ( z.length ) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); + } +} + +main(); From 5492879165c10ed6e0ce9322402e93be0abc8151 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 20 Mar 2026 08:54:14 +0000 Subject: [PATCH 25/26] docs: readme 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: 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: 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/chemv/README.md | 296 ++++++++++++++++++ .../blas/base/chemv/docs/types/index.d.ts | 2 +- .../@stdlib/blas/base/chemv/lib/base.js | 2 +- .../@stdlib/blas/base/chemv/lib/chemv.js | 2 +- .../@stdlib/blas/base/chemv/lib/index.js | 2 +- .../@stdlib/blas/base/chemv/lib/ndarray.js | 2 +- 6 files changed, 301 insertions(+), 5 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/chemv/README.md diff --git a/lib/node_modules/@stdlib/blas/base/chemv/README.md b/lib/node_modules/@stdlib/blas/base/chemv/README.md new file mode 100644 index 000000000000..3eebe87bde29 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/chemv/README.md @@ -0,0 +1,296 @@ + + +# chemv + +> Performs the matrix-vector operation `y = α*A*x + β*y` for complex-valued data. + +
+ +## Usage + +```javascript +var chemv = require( '@stdlib/blas/base/chemv' ); +``` + +#### chemv( order, uplo, N, α, A, LDA, 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. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var A = new Complex64Array( [ 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 ] ); // 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 ); + +chemv( 'row-major', 'lower', 3, alpha, A, 3, 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 the order of the matrix `A`. +- **α**: complex scalar constant. +- **A**: complex input matrix stored in linear memory as a [`Complex64Array`][@stdlib/array/complex64]. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **x**: complex input vector [`Complex64Array`][@stdlib/array/complex64]. +- **sx**: stride length for `x`. +- **β**: complex scalar constant. +- **y**: output [`Complex64Array`][@stdlib/array/complex64]. +- **sy**: stride length for `y`. + +The stride parameters determine how elements are accessed. For example, to iterate over every other element in `x` and `y`, + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var A = new Complex64Array( [ 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 ] ); // 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 ); + +chemv( 'row-major', 'lower', 3, alpha, A, 3, 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 A = new Complex64Array( [ 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 ] ); // 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 + +chemv( 'row-major', 'lower', 3, alpha, A, 3, x1, 1, beta, y1, 1 ); +// y1 => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] +``` + + + +#### chemv.ndarray( uplo, N, α, A, sa1, sa2, oa, x, sx, ox, β, y, sy, oy ) + +Performs the matrix-vector operation `y = α*A*x + β*y` using alternative indexing semantics, where `α` and `β` are complex scalars, `x` and `y` are `N` element complex vectors, and `A` is an `N` by `N` Hermitian matrix. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var A = new Complex64Array( [ 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 ] ); // 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 ); + +chemv( 'lower', 3, alpha, A, 3, 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: + +- **sa1**: stride of the first dimension of `A`. +- **sa2**: stride of the second dimension of `A`. +- **oa**: starting index for `A`. +- **ox**: starting index for `x`. +- **oy**: starting index for `y`. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var A = new Complex64Array( [ 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 ] ); // 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 ] ); + +var alpha = new Complex64( 0.5, 0.5 ); +var beta = new Complex64( 0.5, -0.5 ); + +chemv.ndarray( 'lower', 3, alpha, A, 3, 1, 0, x, 1, 1, beta, y, -1, 4 ); +// y => [ 14.0, 31.0, 0.0, 0.0, -11.0, 25.0, 0.0, 0.0, -10.0, 14.0 ] +``` + +
+ + + +
+ +## Notes + +- `chemv()` corresponds to the [BLAS][blas] level 2 function [`chemv`][chemv]. + +
+ + + +
+ +## 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 chemv = require( '@stdlib/blas/base/chemv' ); + +function rand() { + return new Complex64( discreteUniform( 0, 255 ), discreteUniform( -128, 127 ) ); +} + +var N = 3; + +var A = filledarrayBy( N*N, '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 ); + +chemv( 'row-major', 'lower', N, alpha, A, N, x, 1, beta, y, 1 ); + +// Print the results: +logEach( '(%s)', x ); + +chemv.ndarray( 'lower', N, alpha, A, N, 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/chemv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/chemv/docs/types/index.d.ts index 066eab124aec..ca9e055a8521 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/chemv/docs/types/index.d.ts @@ -29,7 +29,7 @@ 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. + * 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. * * @param order - storage layout * @param uplo - specifies whether `A` is an upper or lower triangular part of matrix is supplied. diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js index d4dab1310be0..1e86436f9d5e 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/lib/base.js @@ -33,7 +33,7 @@ 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. +* 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. * * @private * @param {string} uplo - specifies whether `A` is an upper or lower triangular part of matrix is supplied. diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/chemv.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/chemv.js index 51a3fecd416a..6b59f3b065c8 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/lib/chemv.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/lib/chemv.js @@ -34,7 +34,7 @@ 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. +* 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. * * @param {string} order - storage layout * @param {string} uplo - specifies whether `A` is an upper or lower triangular part of matrix is supplied. diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/index.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/index.js index 9e33b69bbadc..257367e6aac3 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/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. +* 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. * * @module @stdlib/blas/base/chemv * diff --git a/lib/node_modules/@stdlib/blas/base/chemv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/chemv/lib/ndarray.js index 9f3ca0da6cf0..5c91cb592900 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/chemv/lib/ndarray.js @@ -30,7 +30,7 @@ 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. +* 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. * * @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` From 30515fbda7dcb380ddae7ac3c0bc30b2e758e130 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 20 Mar 2026 08:59:23 +0000 Subject: [PATCH 26/26] 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: 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/chemv/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/chemv/README.md b/lib/node_modules/@stdlib/blas/base/chemv/README.md index 3eebe87bde29..58a726800558 100644 --- a/lib/node_modules/@stdlib/blas/base/chemv/README.md +++ b/lib/node_modules/@stdlib/blas/base/chemv/README.md @@ -117,7 +117,7 @@ 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 ); -chemv( 'lower', 3, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 ); +chemv.ndarray( 'lower', 3, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 ); // y => [ -10.0, 14.0, -11.0, 25.0, 14.0, 31.0 ] ``` @@ -137,12 +137,12 @@ var Complex64 = require( '@stdlib/complex/float32/ctor' ); var A = new Complex64Array( [ 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 ] ); // 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 ] ); +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 ); -chemv.ndarray( 'lower', 3, alpha, A, 3, 1, 0, x, 1, 1, beta, y, -1, 4 ); +chemv.ndarray( 'lower', 3, alpha, A, 1, 3, 0, x, 1, 1, beta, y, -1, 4 ); // y => [ 14.0, 31.0, 0.0, 0.0, -11.0, 25.0, 0.0, 0.0, -10.0, 14.0 ] ``` @@ -174,7 +174,7 @@ var logEach = require( '@stdlib/console/log-each' ); var chemv = require( '@stdlib/blas/base/chemv' ); function rand() { - return new Complex64( discreteUniform( 0, 255 ), discreteUniform( -128, 127 ) ); + return new Complex64( discreteUniform( 0, 255 ), discreteUniform( -128, 127 ) ); // eslint-disable-line max-params, max-len } var N = 3;