From e3480cbc7a38651bde855d3ccc2d4ad8cf51dab2 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Wed, 4 Jun 2025 22:53:51 +0530 Subject: [PATCH 01/24] feat: add blas/base/cher2 --- .../blas/base/cher2/benchmark/benchmark.js | 119 +++++ .../base/cher2/benchmark/benchmark.ndarray.js | 119 +++++ .../@stdlib/blas/base/cher2/docs/repl.txt | 150 ++++++ .../blas/base/cher2/docs/types/index.d.ts | 137 +++++ .../blas/base/cher2/docs/types/test.ts | 481 ++++++++++++++++++ .../@stdlib/blas/base/cher2/examples/index.js | 51 ++ .../@stdlib/blas/base/cher2/lib/base.js | 201 ++++++++ .../@stdlib/blas/base/cher2/lib/cher2.js | 108 ++++ .../@stdlib/blas/base/cher2/lib/index.js | 74 +++ .../@stdlib/blas/base/cher2/lib/main.js | 35 ++ .../@stdlib/blas/base/cher2/lib/ndarray.js | 96 ++++ .../@stdlib/blas/base/cher2/package.json | 79 +++ .../@stdlib/blas/base/cher2/test/test.js | 82 +++ 13 files changed, 1732 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/examples/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/lib/base.js create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/lib/ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/package.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/test.js diff --git a/lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.js new file mode 100644 index 000000000000..9353d4484c15 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.js @@ -0,0 +1,119 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var pkg = require( './../package.json' ).name; +var cher2 = require( './../lib/cher2.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var alpha; + var xbuf; + var ybuf; + var Abuf; + var x; + var y; + var A; + + xbuf = uniform( len*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + ybuf = uniform( len*2, -100.0, 100.0, options ); + y = new Complex64Array( ybuf.buffer ); + Abuf = uniform( (len*len)*2, -100.0, 100.0, options ); + A = new Complex64Array( Abuf.buffer ); + + alpha = new Complex64( 1.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + cher2( 'row-major', 'lower', len, alpha, x, 1, y, 1, A, len ); + if ( isnanf( Abuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( Abuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 4; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':len='+len, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..c9c55b762579 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.ndarray.js @@ -0,0 +1,119 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var pkg = require( './../package.json' ).name; +var cher2 = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var alpha; + var xbuf; + var ybuf; + var Abuf; + var x; + var y; + var A; + + xbuf = uniform( len*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + ybuf = uniform( len*2, -100.0, 100.0, options ); + y = new Complex64Array( ybuf.buffer ); + Abuf = uniform( (len*len)*2, -100.0, 100.0, options ); + A = new Complex64Array( Abuf.buffer ); + + alpha = new Complex64( 1.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + cher2( 'lower', len, alpha, x, 1, 0, y, 1, 0, A, len, 1, 0 ); + if ( isnanf( Abuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( Abuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 4; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':ndarray:len='+len, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/cher2/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/cher2/docs/repl.txt new file mode 100644 index 000000000000..6a55aa35d48a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/docs/repl.txt @@ -0,0 +1,150 @@ + +{{alias}}( order, uplo, N, α, x, strideX, y, strideY, LDA ) + Performs the hermitian rank 2 operation + `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, + `x` and `y` are `N` element 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 `A` unchanged. + + If `α` is equal to `0`, the function returns `A` 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`. + + α: number + Scalar constant. + + x: Complex64Array + First input array. + + strideX: integer + Index increment for `x`. + + y: Complex64Array + Second input array. + + strideY: integer + Index increment for `y`. + + A: Complex64Array + Input matrix. + + LDA: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + Returns + ------- + A: Complex64Array + Input matrix. + + Examples + -------- + // Standard usage: + > var x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var y = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var A = new {{alias:@stdlib/array/complex64}}( [ 1.0, 0.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); + > var alpha = new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 0.0 ); + > {{alias}}( 'row-major', 'lower', 2, alpha, x, 1, y, 1, A, 2 ) + [ 11.0, 0.0, 0.0, 0.0, 27.0, 2.0, 57.0, 0.0 ] + + // Advanced indexing: + > var x = new {{alias:@stdlib/array/complex64}}( [ 3.0, 4.0, 1.0, 2.0 ] ); + > var y = new {{alias:@stdlib/array/complex64}}( [ 3.0, 4.0, 1.0, 2.0 ] ); + > var A = new {{alias:@stdlib/array/complex64}}( [ 1.0, 0.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); + > var alpha = new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 0.0 ); + > {{alias}}( 'row-major', 'lower', 2, alpha, x, -1, y, -1, A, 2 ) + [ 11.0, 0.0, 0.0, 0.0, 27.0, 2.0, 57.0, 0.0 ] + + // Using typed array views: + > var x0 = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 3.0, 4.0, 1.0, 2.0 ] ); + > var y0 = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 3.0, 4.0, 1.0, 2.0 ] ); + > var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > var y1 = new {{alias:@stdlib/array/complex64}}( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); + > var A = new {{alias:@stdlib/array/complex64}}( [ 1.0, 0.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); + > var alpha = new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 0.0 ); + > {{alias}}( 'row-major', 'lower', 2, alpha, x1, -1, y1, -1, A, 2 ) + [ 11.0, 0.0, 0.0, 0.0, 27.0, 2.0, 57.0, 0.0 ] + + +{{alias}}.ndarray( uplo, N, α, x, strideX, offsetX, y, strideY, offsetY, A, sa1, sa2, offsetA ) + Performs the hermitian rank 2 operation + `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, + `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian + matrix using alternative indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameter supports indexing semantics based on a starting + index. + + Parameters + ---------- + uplo: string + Specifies whether the upper or lower triangular matrix of `A` is + supplied. Must be either 'upper' or 'lower'. + + N: integer + Number of elements along each dimension of `A`. + + α: number + Scalar constant. + + x: Complex64Array + First input array. + + strideX: integer + Index increment for `x`. + + offsetX: integer + Starting index for `x`. + + y: Complex64Array + Second input array. + + strideY: integer + Index increment for `y`. + + offsetY: integer + Starting index for `y`. + + A: Complex64Array + Input matrix. + + sa1: integer + Stride of the first dimension of `A`. + + sa2: integer + Stride of the second dimension of `A`. + + offsetA: integer + Starting index for `A`. + + Returns + ------- + A: Complex64Array + Input matrix. + + Examples + -------- + > var x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var y = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var A = new {{alias:@stdlib/array/complex64}}( [ 1.0, 0.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); + > var alpha = new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 0.0 ); + > {{alias}}.ndarray( 'lower', 2, alpha, x, 1, 0, y, 1, 0, A, 2, 1, 0 ) + [ 11.0, 0.0, 0.0, 0.0, 27.0, 2.0, 57.0, 0.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/base/cher2/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/index.d.ts new file mode 100644 index 000000000000..a5a5b4b57b24 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/index.d.ts @@ -0,0 +1,137 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import Complex64 from '@stdlib/complex/float32/ctor'; +import { Complex64Array } from '@stdlib/types/array'; +import { Layout, MatrixTriangle } from '@stdlib/types/blas'; + +/** +* Interface describing `cher2`. +*/ +interface Routine { + /** + * Performs the hermitian rank 2 operation `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, `x` and `y` are `N` element 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 - scalar constant + * @param x - first input array + * @param strideX - `x` stride length + * @param y - second input array + * @param strideY - `y` stride length + * @param A - input matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @returns input matrix + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); + * var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); + * var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); + * var alpha = new Complex64( 1.0, 0.0 ); + * + * cher2( 'lower', x.length, alpha, x, 1, y, 1, A, 2, 1 ); + * // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] + */ + ( order: Layout, uplo: MatrixTriangle, N: number, alpha: Complex64, x: Complex64Array, strideX: number, y: Complex64Array, strideY: number, A: Complex64Array, LDA: number ): Complex64Array; + + /** + * Performs the hermitian rank 2 operation `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian matrix. + * + * @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 - scalar + * @param x - first input array + * @param strideX - `x` stride length + * @param offsetX - starting `x` index + * @param y - second input array + * @param strideY - `y` stride length + * @param offsetY - starting `y` index + * @param A - input matrix + * @param strideA1 - stride of the first dimension of `A` + * @param strideA2 - stride of the second dimension of `A` + * @param offsetA - starting index for `A` + * @returns input matrix + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); + * var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); + * var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); + * var alpha = new Complex64( 1.0, 0.0 ); + * + * cher2( 'lower', x.length, alpha, x, 1, 0, y, 1, 0, A, 2, 1, 0 ); + * // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] + */ + ndarray( uplo: MatrixTriangle, N: number, alpha: Complex64, x: Complex64Array, strideX: number, offsetX: number, y: Complex64Array, strideY: number, offsetY: number, A: Complex64Array, strideA1: number, strideA2: number, offsetA: number ): Complex64Array; +} + +/** +* Performs the hermitian rank 2 operation `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, `x` and `y` are `N` element 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 - scalar constant +* @param x - first input array +* @param strideX - `x` stride length +* @param y - second input array +* @param strideY - `y` stride length +* @param A - input matrix +* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @returns input array +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +* var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +* var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +* var alpha = new Complex64( 1.0, 0.0 ); +* +* cher2( 'lower', x.length, alpha, x, 1, y, 1, A, 2, 1 ); +* // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +* var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +* var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +* var alpha = new Complex64( 1.0, 0.0 ); +* +* cher2( 'lower', x.length, alpha, x, 1, 0, y, 1, 0, A, 2, 1, 0 ); +* // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] +*/ +declare var cher2: Routine; + + +// EXPORTS // + +export = cher2; diff --git a/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts new file mode 100644 index 000000000000..9abcebff9b66 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts @@ -0,0 +1,481 @@ + +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import Complex64Array = require( '@stdlib/array/complex64' ); +import Complex64 = require( '@stdlib/complex/float32/ctor' ); +import cher2 = 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( 2.0, 2.0 ); + + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, A, 3 ); // $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( 2.0, 2.0 ); + + cher2( 10, 'lower', 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( '10', 'lower', 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( true, 'lower', 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( false, 'lower', 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( null, 'lower', 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( undefined, 'lower', 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( [], 'lower', 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( {}, 'lower', 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( ( x: number ): number => x, 'lower', 10, alpha, x, 1, y, 1, A, 3 ); // $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( 2.0, 2.0 ); + + cher2( 'row-major', 10, 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', '10', 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', true, 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', false, 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', null, 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', undefined, 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', [], 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', {}, 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', ( x: number ): number => x, 10, alpha, x, 1, y, 1, A, 3 ); // $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( 2.0, 2.0 ); + + cher2( 'row-major', 'lower', '10', alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', true, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', false, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', null, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', undefined, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', [], alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', {}, alpha, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', ( x: number ): number => x, alpha, x, 1, y, 1, A, 3 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cher2( 'row-major', 'lower', 10, '10', x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, true, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, false, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, null, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, undefined, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, [], x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, {}, x, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, ( x: number ): number => x, x, 1, y, 1, A, 3 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a Complex64Array... +{ + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cher2( 'row-major', 'lower', 10, alpha, 10, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, '10', 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, true, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, false, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, null, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, undefined, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, [], 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, {}, 1, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, ( x: number ): number => x, 1, y, 1, A, 3 ); // $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( 2.0, 2.0 ); + + cher2( 'row-major', 'lower', 10, alpha, x, '10', y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, true, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, false, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, null, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, undefined, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, [], y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, {}, y, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, ( x: number ): number => x, y, 1, A, 3 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cher2( 'row-major', 'lower', 10, alpha, x, 1, 10, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, '10', 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, true, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, false, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, null, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, undefined, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, [], 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, {}, 1, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, ( x: number ): number => x, 1, A, 3 ); // $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( 2.0, 2.0 ); + + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, '10', A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, true, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, false, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, null, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, undefined, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, [], A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, {}, A, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, ( x: number ): number => x, A, 3 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, 10, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, '10', 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, true, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, false, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, null, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, undefined, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, [], 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, {}, 3 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, ( x: number ): number => x, 3 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, A, '10' ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, A, true ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, A, false ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, A, null ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, A, undefined ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, A, [] ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, A, {} ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, A, ( 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( 2.0, 2.0 ); + + cher2(); // $ExpectError + cher2( 'row-major' ); // $ExpectError + cher2( 'row-major', 'lower' ); // $ExpectError + cher2( 'row-major', 'lower', 10 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1 ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, A ); // $ExpectError + cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, A, 3, 1 ); // $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( 2.0, 2.0 ); + + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectType Complex64Array +} + +// The compiler throws an error if the `ndarray` method is provided a first 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( 2.0, 2.0 ); + + cher2.ndarray( 10, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( '10', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( true, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( false, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( null, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( undefined, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( [], 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( {}, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray.ndarray( 'row-major', ( x: number ): number => x, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 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( 2.0, 2.0 ); + + cher2.ndarray( 'lower', '10', alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', true, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', false, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', null, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', undefined, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', [], alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', {}, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', ( x: number ): number => x, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cher2.ndarray( 'lower', 10, '10', x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, true, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, false, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, null, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, undefined, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, [], x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, {}, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, ( x: number ): number => x, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a Complex64Array... +{ + const A = new Complex64Array( 20 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cher2.ndarray( 'lower', 10, alpha, 10, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, '10', 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, true, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, false, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, null, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, undefined, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, [], 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, {}, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, ( x: number ): number => x, 1, 0, y, 1, 0, A, 3, 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( 2.0, 2.0 ); + + cher2.ndarray( 'lower', 10, alpha, x, '10', 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, true, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, false, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, null, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, undefined, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, [], 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, {}, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, ( x: number ): number => x, 0, y, 1, 0, A, 3, 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( 2.0, 2.0 ); + + cher2.ndarray( 'lower', 10, alpha, x, 1, '10', y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, true, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, false, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, null, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, undefined, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, [], y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, {}, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, ( x: number ): number => x, y, 1, 0, A, 3, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, 10, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, '10', 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, true, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, false, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, null, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, undefined, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, [], 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, {}, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, ( x: number ): number => x, 1, 0, A, 3, 1, 0 ); // $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( 2.0, 2.0 ); + + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, '10', 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, true, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, false, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, null, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, undefined, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, [], 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, {}, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, ( x: number ): number => x, 0, A, 3, 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( 2.0, 2.0 ); + + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, '10', A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, true, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, false, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, null, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, undefined, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, [], A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, {}, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, ( x: number ): number => x, A, 3, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, 10, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, '10', 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, true, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, false, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, null, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, undefined, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, [], 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, {}, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, ( x: number ): number => x, 3, 1, 0 ); // $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( 2.0, 2.0 ); + + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, '10', 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, true, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, false, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, null, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, undefined, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, [], 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, {}, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a twelfth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const y = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + const alpha = new Complex64( 2.0, 2.0 ); + + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, '10', 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, true, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, false, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, null, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, undefined, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, [], 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, {}, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, ( x: number ): number => x, 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( 2.0, 2.0 ); + + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, '10' ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, true ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, false ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, null ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, undefined ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, [] ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, {} ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 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( 2.0, 2.0 ); + + cher2.ndarray(); // $ExpectError + cher2.ndarray( 'lower' ); // $ExpectError + cher2.ndarray( 'lower', 10 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 1 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 1, 0, 1 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/examples/index.js b/lib/node_modules/@stdlib/blas/base/cher2/examples/index.js new file mode 100644 index 000000000000..8c60dfc10a20 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/examples/index.js @@ -0,0 +1,51 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var discreteUniform = require( '@stdlib/random/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 cher = require( './../lib' ); + +function rand() { + return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); +} + +var x = filledarrayBy( 3, 'complex64', rand ); +console.log( x.get( 0 ).toString() ); + +var y = filledarrayBy( 3, 'complex64', rand ); +console.log( y.get( 0 ).toString() ); + +var A = filledarrayBy( 9, 'complex64', rand ); +console.log( A.get( 0 ).toString() ); + +var alpha = new Complex64( 2.0, 2.0 ); +console.log( alpha.toString() ); + +cher( 'row-major', 'upper', 3, alpha, x, 1, y, 1, A, 3 ); + +// Print the results: +logEach( '(%s)', A ); + +cher.ndarray( 'upper', 3, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); + +// Print the results: +logEach( '(%s)', A ); diff --git a/lib/node_modules/@stdlib/blas/base/cher2/lib/base.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/base.js new file mode 100644 index 000000000000..d996542b30e4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/base.js @@ -0,0 +1,201 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); + + +// MAIN // + +/** +* Performs the hermitian rank 2 operation `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, `x` and `y` are `N` element 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 - scalar +* @param {Complex64Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {Complex64Array} y - second input array +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting `y` index +* @param {Complex64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @returns {Complex64Array} `A` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +* var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +* var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +* var alpha = new Complex64( 1.0, 0.0 ); +* +* cher2( 'lower', x.length, alpha, x, 1, 0, y, 1, 0, A, 2, 1, 0 ); +* // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] +*/ +function cher2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ) { + var alpha_re; + var alpha_im; + var tmp1_re; + var tmp1_im; + var tmp2_re; + var tmp2_im; + var re0_x; + var im0_x; + var re0_y; + var im0_y; + var re1_x; + var im1_x; + var re1_y; + var im1_y; + var viewX; + var viewY; + var viewA; + var isrm; + var idx; + var ix1; + var iy1; + var ix0; + var iy0; + var re0; + var im0; + var re1; + var im1; + var sa0; + var sa1; + var re; + var im; + var i1; + var i0; + var ix; + var iy; + var ia; + var sx; + var sy; + + alpha_re = f32( alpha.re ); + alpha_im = f32( alpha.im ); + + viewX = reinterpret( x, 0 ); + viewY = reinterpret( y, 0 ); + viewA = reinterpret( A, 0 ); + + isrm = isRowMajor( [ strideA1, strideA2 ] ); + if ( isrm ) { + sa0 = strideA2 * 2; + sa1 = strideA1 * 2; + } else { + sa0 = strideA1 * 2; + sa1 = strideA2 * 2; + } + ix = offsetX * 2; + iy = offsetY * 2; + ia = offsetA * 2; + sx = strideX * 2; + sy = strideY * 2; + if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { + for ( i1 = 0; i1 < N; i1++ ) { + ix1 = ix + ( i1 * sx ); + iy1 = iy + ( i1 * sy ); + re0_x = f32( viewX[ ix1 ] ); + im0_x = f32( viewX[ ix1 + 1 ] ); + re0_y = f32( viewY[ iy1 ] ); + im0_y = f32( viewY[ iy1 + 1 ] ); + for ( i0 = i1; i0 < N; i0++ ) { + ix0 = ix + ( i0 * sx ); + iy0 = iy + ( i0 * sy ); + re1_x = f32( viewX[ ix0 ] ); + im1_x = f32( viewX[ ix0 + 1 ] ); + re1_y = f32( viewY[ iy0 ] ); + im1_y = f32( viewY[ iy0 + 1 ] ); + + re0 = f32( ( re0_x * re1_y ) + ( im0_x * im1_y ) ); + im0 = f32( ( im0_x * re1_y ) - ( re0_x * im1_y ) ); + tmp1_re = f32( ( alpha_re * re0 ) - ( alpha_im * im0 ) ); + tmp1_im = f32( ( alpha_re * im0 ) + ( alpha_im * re0 ) ); + + re1 = f32( ( re0_y * re1_x ) + ( im0_y * im1_x ) ); + im1 = f32( ( im0_y * re1_x ) - ( re0_y * im1_x ) ); + tmp2_re = f32( ( alpha_re * re1 ) + ( alpha_im * im1 ) ); + tmp2_im = f32( ( alpha_re * im1 ) - ( alpha_im * re1 ) ); + + re = f32( tmp1_re + tmp2_re ); + im = f32( tmp1_im + tmp2_im ); + idx = ia + ( i0 * sa0 ) + ( i1 * sa1 ); + viewA[ idx ] = f32( viewA[ idx ] + re ); + viewA[ idx + 1 ] = f32( viewA[ idx + 1 ] + im ); + if ( i0 === i1 ) { + viewA[ idx + 1 ] = 0.0; + } + } + } + return A; + } + // ( isrm && uplo === 'lower' ) || ( !isrm && uplo === 'upper' ) + for ( i1 = 0; i1 < N; i1++ ) { + ix1 = ix + ( i1 * sx ); + iy1 = iy + ( i1 * sy ); + re0_x = f32( viewX[ ix1 ] ); + im0_x = f32( viewX[ ix1 + 1 ] ); + re0_y = f32( viewY[ iy1 ] ); + im0_y = f32( viewY[ iy1 + 1 ] ); + for ( i0 = 0; i0 <= i1; i0++ ) { + ix0 = ix + ( i0 * sx ); + iy0 = iy + ( i0 * sy ); + re1_x = f32( viewX[ ix0 ] ); + im1_x = f32( viewX[ ix0 + 1 ] ); + re1_y = f32( viewY[ iy0 ] ); + im1_y = f32( viewY[ iy0 + 1 ] ); + + re0 = f32( ( re0_x * re1_y ) + ( im0_x * im1_y ) ); + im0 = f32( ( im0_x * re1_y ) - ( re0_x * im1_y ) ); + tmp1_re = f32( ( alpha_re * re0 ) - ( alpha_im * im0 ) ); + tmp1_im = f32( ( alpha_re * im0 ) + ( alpha_im * re0 ) ); + + re1 = f32( ( re0_y * re1_x ) + ( im0_y * im1_x ) ); + im1 = f32( ( im0_y * re1_x ) - ( re0_y * im1_x ) ); + tmp2_re = f32( ( alpha_re * re1 ) + ( alpha_im * im1 ) ); + tmp2_im = f32( ( alpha_re * im1 ) - ( alpha_im * re1 ) ); + + re = f32( tmp1_re + tmp2_re ); + im = f32( tmp1_im + tmp2_im ); + idx = ia + ( i0 * sa0 ) + ( i1 * sa1 ); + viewA[ idx ] = f32( viewA[ idx ] + re ); + viewA[ idx + 1 ] = f32( viewA[ idx + 1 ] + im ); + if ( i0 === i1 ) { + viewA[ idx + 1 ] = 0.0; + } + } + } + return A; +} + + +// EXPORTS // + +module.exports = cher2; diff --git a/lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js new file mode 100644 index 000000000000..0cbcbe81db23 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js @@ -0,0 +1,108 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var max = require( '@stdlib/math/base/special/fast/max' ); +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var format = require( '@stdlib/string/format' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +/** +* Performs the hermitian rank 1 operation `A = alpha*x*x**H + A`, where `alpha` is a real scalar, `X` is an `N` element vector 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 - scalar constant +* @param {Complex64Array} x - input array +* @param {integer} strideX - `x` stride length +* @param {Complex64Array} y - input array +* @param {integer} strideX - `y` stride length +* @param {Complex64Array} A - input matrix +* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @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 non-zero +* @throws {RangeError} eighth argument must be greater than or equal to max(1,N) +* @returns {Complex64Array} `A` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +* var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +* var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +* var alpha = new Complex64( 1.0, 0.0 ); +* +* cher2( 'lower', x.length, alpha, x, 1, y, 1, A, 2, 1 ); +* // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] +*/ +function cher2( order, uplo, N, alpha, x, strideX, y, strideY, A, LDA ) { + 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. Sixth argument must be non-zero. Value: `%d`.', strideX ) ); + } + if ( strideY === 0 ) { + throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideY ) ); + } + if ( LDA < max( 1, N ) ) { + throw new RangeError( format( 'invalid argument. Tenth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); + } + if ( N === 0 || alpha === 0.0 ) { + return A; + } + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + } + ox = stride2offset( N, strideX ); + oy = stride2offset( N, strideY ); + return ndarray( uplo, N, alpha, x, strideX, ox, y, strideY, oy, A, sa1, sa2, 0 ); +} + + +// EXPORTS // + +module.exports = cher2; diff --git a/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js new file mode 100644 index 000000000000..1ff99ee02b44 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js @@ -0,0 +1,74 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Perform the hermitian rank 1 operation `A = alpha*x*x**H + A`, where `alpha` is a real scalar, `X` is an `N` element vector and `A` is an `N` by `N` hermitian matrix. +* +* @module @stdlib/blas/base/cher2 +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +* var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +* var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +* var alpha = new Complex64( 1.0, 0.0 ); +* +* cher2( 'lower', x.length, alpha, x, 1, y, 1, A, 2, 1 ); +* // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +* var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +* var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +* var alpha = new Complex64( 1.0, 0.0 ); +* +* cher2.ndarray( 'lower', x.length, alpha, x, 1, 0, y, 1, 0, A, 2, 1, 0 ); +* // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.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 cher2; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + cher2 = main; +} else { + cher2 = tmp; +} + + +// EXPORTS // + +module.exports = cher2; + +// exports: { "ndarray": "cher2.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/cher2/lib/main.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/main.js new file mode 100644 index 000000000000..92bc36c6c355 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var cher2 = require( './cher2.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( cher2, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = cher2; diff --git a/lib/node_modules/@stdlib/blas/base/cher2/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/ndarray.js new file mode 100644 index 000000000000..fb911d8f1cfa --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/ndarray.js @@ -0,0 +1,96 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Performs the hermitian rank 2 operation `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, `x` and `y` are `N` element 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 - scalar +* @param {Complex64Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {Complex64Array} y - second input array +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting `y` index +* @param {Complex64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @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} eighth argument must be non-zero +* @throws {RangeError} eleventh argument must be non-zero +* @throws {RangeError} twelfth argument must be non-zero +* @returns {Complex64Array} `A` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +* var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +* var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +* var alpha = new Complex64( 1.0, 0.0 ); +* +* cher2( 'lower', x.length, alpha, x, 1, 0, y, 1, 0, A, 2, 1, 0 ); +* // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] +*/ +function cher2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ) { + 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. Fifth argument must be non-zero. Value: `%d`.', strideX ) ); + } + if ( strideY === 0 ) { + throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideY ) ); + } + if ( strideA1 === 0 ) { + throw new RangeError( format( 'invalid argument. Eleventh argument must be non-zero. Value: `%d`.', strideA1 ) ); + } + if ( strideA2 === 0 ) { + throw new RangeError( format( 'invalid argument. Twelfth argument must be non-zero. Value: `%d`.', strideA2 ) ); + } + + if ( N === 0 || alpha === 0.0 ) { + return A; + } + return base( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ); +} + + +// EXPORTS // + +module.exports = cher2; diff --git a/lib/node_modules/@stdlib/blas/base/cher2/package.json b/lib/node_modules/@stdlib/blas/base/cher2/package.json new file mode 100644 index 000000000000..f876d16c46a2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/package.json @@ -0,0 +1,79 @@ +{ + "name": "@stdlib/blas/base/cher2", + "version": "0.0.0", + "description": "Performs the hermitian rank 2 operation `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, `x` and `y` are `N` element 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", + "linear", + "algebra", + "subroutines", + "cher2", + "hermitian", + "vector", + "matrix", + "typed", + "array", + "ndarray", + "complex", + "complex64", + "float", + "float32", + "single", + "float32array" + ], + "__stdlib__": { + "wasm": false + } +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/test.js b/lib/node_modules/@stdlib/blas/base/cher2/test/test.js new file mode 100644 index 000000000000..ab617f7fbfeb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var proxyquire = require( 'proxyquire' ); +var isBrowser = require( '@stdlib/assert/is-browser' ); +var cher2 = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': isBrowser +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof cher2, '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 cher2.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 cher2 = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( cher2, 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 cher2; + var main; + + main = require( './../lib/cher2.js' ); + + cher2 = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( cher2, main, 'returns JavaScript implementation' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); From 2b693bfbc467c95a7bae1a76ec0230f58e9543c1 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Thu, 5 Jun 2025 00:12:06 +0530 Subject: [PATCH 02/24] chore: add implementation --- .../@stdlib/blas/base/cher2/lib/cher2.js | 3 +- .../column_major_complex_access_pattern.json | 23 + .../cher2/test/fixtures/column_major_l.json | 23 + .../cher2/test/fixtures/column_major_oa.json | 23 + .../cher2/test/fixtures/column_major_ox.json | 23 + .../cher2/test/fixtures/column_major_oy.json | 23 + .../blas/base/cher2/test/test.cher2.js | 635 ++++++++++++ .../blas/base/cher2/test/test.ndarray.js | 966 ++++++++++++++++++ 8 files changed, 1718 insertions(+), 1 deletion(-) create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_l.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_ox.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oy.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js index 0cbcbe81db23..1e8c89aa750f 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js @@ -48,7 +48,8 @@ var ndarray = require( './ndarray.js' ); * @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 non-zero -* @throws {RangeError} eighth argument must be greater than or equal to max(1,N) +* @throws {RangeError} eighth argument must be non-zero +* @throws {RangeError} tenth argument must be greater than or equal to max(1,N) * @returns {Complex64Array} `A` * * @example diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 000000000000..b8403efaa7cd --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_complex_access_pattern.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 5.0, 6.0 ], + "strideX": 2, + "offsetX": 3, + "y": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 5.0, 6.0 ], + "strideY": 2, + "offsetY": 3, + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 6.0, 999.0, 999.0, 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 8.0, 9.0, 999.0, 999.0, 0.0, 0.0, 1.0, 0.0, 7.0, 0.0, 11.0, 0.0, 999.0, 999.0 ], + "A_mat": [ + [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ], + [ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ], + [ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ] + ], + "LDA": 5, + "strideA1": -4, + "strideA2": 5, + "offsetA": 12, + "A_out": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 39.0, 14.0, 999.0, 999.0, 0.0, 0.0, 0.0, 0.0, 25.0, 8.0, 86.0, 13.0, 999.0, 999.0, 0.0, 0.0, 11.0, 0.0, 57.0, 0.0, 133.0, 0.0, 999.0, 999.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_l.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_l.json new file mode 100644 index 000000000000..3b31aa6366fc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_l.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 0, + "A": [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ], + [ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ], + [ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 25.0, 8.0, 39.0, 14.0, 0.0, 0.0, 57.0, 0.0, 86.0, 13.0, 0.0, 0.0, 0.0, 0.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oa.json new file mode 100644 index 000000000000..1e11e7aab619 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oa.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 0, + "A": [ 999.0, 999.0, 999.0, 999.0, 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ], + [ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ], + [ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 2, + "A_out": [ 999.0, 999.0, 999.0, 999.0, 11.0, 0.0, 25.0, 8.0, 39.0, 14.0, 0.0, 0.0, 57.0, 0.0, 86.0, 13.0, 0.0, 0.0, 0.0, 0.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_ox.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_ox.json new file mode 100644 index 000000000000..d6437a569210 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_ox.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 1, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 0, + "A": [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ], + [ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ], + [ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 25.0, 8.0, 39.0, 14.0, 0.0, 0.0, 57.0, 0.0, 86.0, 13.0, 0.0, 0.0, 0.0, 0.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oy.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oy.json new file mode 100644 index 000000000000..27c29680fbdd --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oy.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 1, + "A": [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ], + [ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ], + [ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 25.0, 8.0, 39.0, 14.0, 0.0, 0.0, 57.0, 0.0, 86.0, 13.0, 0.0, 0.0, 0.0, 0.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js b/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js new file mode 100644 index 000000000000..4a5162aed8c3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js @@ -0,0 +1,635 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var cher = require( './../lib/cher.js' ); + + +// FIXTURES // + +var ru = require( './fixtures/row_major_u.json' ); +var rl = require( './fixtures/row_major_l.json' ); +var rxp = require( './fixtures/row_major_xp.json' ); +var rxn = require( './fixtures/row_major_xn.json' ); +var ryp = require( './fixtures/row_major_yp.json' ); +var ryn = require( './fixtures/row_major_yn.json' ); + +var cu = require( './fixtures/column_major_u.json' ); +var cl = require( './fixtures/column_major_l.json' ); +var cxp = require( './fixtures/column_major_xp.json' ); +var cxn = require( './fixtures/column_major_xn.json' ); +var cyp = require( './fixtures/column_major_yp.json' ); +var cyn = require( './fixtures/column_major_yn.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof cher, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 10', function test( t ) { + t.strictEqual( cher.length, 10, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', function test( t ) { + var values; + var data; + var i; + + data = rl; + + 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() { + cher( value, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, y, strideY, new Complex64Array( data.A ), data.LDA ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var data; + var i; + + data = rl; + + 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() { + cher( data.order, value, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', function test( t ) { + var values; + var data; + var i; + + data = rl; + + 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() { + cher( data.order, data.uplo, value, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid sixth argument', function test( t ) { + var values; + var data; + var i; + + data = rl; + + 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() { + cher( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), value, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid eighth argument', function test( t ) { + var values; + var data; + var i; + + data = rl; + + 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() { + cher( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), value, new Complex64Array( data.A ), data.LDA ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid tenth argument', function test( t ) { + var values; + var data; + var i; + + data = rl; + + 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() { + cher( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), value ); + }; + } +}); + +tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (row-major, lower)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (column-major, lower)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (row-major, upper)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (column-major, upper)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input matrix (row-major)', function test( t ) { + var data; + 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 Complex64Array( data.alpha ); + + out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input matrix (column-major)', function test( t ) { + var data; + 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 Complex64Array( data.alpha ); + + out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is `0`, the function returns the second input matrix unchanged (row-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A ); + + out = cher( data.order, data.uplo, 0, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is `0`, the function returns the second input matrix unchanged (column-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A ); + + out = cher( data.order, data.uplo, 0, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function returns the second input matrix unchanged (row-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A ); + + out = cher( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0`, the function returns the second input matrix unchanged (column-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A ); + + out = cher( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = rxp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` stride (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cxp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying negative `x` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = rxn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying negative `x` stride (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cxn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `y` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = ryp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `y` stride (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying negative `y` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = ryn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying negative `x` stride (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); \ No newline at end of file diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js new file mode 100644 index 000000000000..ab9898d4683c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js @@ -0,0 +1,966 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var cher = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var ru = require( './fixtures/row_major_u.json' ); +var rl = require( './fixtures/row_major_l.json' ); +var rxp = require( './fixtures/row_major_xp.json' ); +var rxn = require( './fixtures/row_major_xn.json' ); +var ryp = require( './fixtures/row_major_yp.json' ); +var ryn = require( './fixtures/row_major_yn.json' ); +var roa = require( './fixtures/row_major_oa.json' ); +var rox = require( './fixtures/row_major_ox.json' ); +var roy = require( './fixtures/row_major_oy.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 rcap = require( './fixtures/row_major_complex_access_pattern.json' ); + +var cu = require( './fixtures/column_major_u.json' ); +var cl = require( './fixtures/column_major_l.json' ); +var cxp = require( './fixtures/column_major_xp.json' ); +var cxn = require( './fixtures/column_major_xn.json' ); +var cyp = require( './fixtures/column_major_yp.json' ); +var cyn = require( './fixtures/column_major_yn.json' ); +var coa = require( './fixtures/column_major_oa.json' ); +var cox = require( './fixtures/column_major_ox.json' ); +var coy = require( './fixtures/column_major_oy.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 ccap = require( './fixtures/column_major_complex_access_pattern.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof cher, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 13', function test( t ) { + t.strictEqual( cher.length, 13, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', function test( t ) { + var values; + var data; + var i; + + data = ru; + + 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() { + cher( value, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var data; + var i; + + data = ru; + + 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() { + cher( data.uplo, value, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { + var values; + var data; + var i; + + data = ru; + + 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() { + cher( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), value, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid eighth argument', function test( t ) { + var values; + var data; + var i; + + data = ru; + + 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() { + cher( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), value, data.strideA2, data.offsetA ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid eleventh argument', function test( t ) { + var values; + var data; + var i; + + data = ru; + + 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() { + cher( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, value, data.offsetA ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid twelfth argument', function test( t ) { + var values; + var data; + var i; + + data = ru; + + 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() { + cher( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, value, data.offsetA ); + }; + } +}); + +tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, lower)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (column-major, lower)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (column-major, upper)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, upper)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a reference to the input matrix `A`', function test( t ) { + var data; + 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 Complex64Array( data.alpha ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (row-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A ); + + out = cher( data.uplo, 0, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + out = cher( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (column-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A ); + + out = cher( data.uplo, 0, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + out = cher( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( a, expected, '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 data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + 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` (column-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (row-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (column-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (row-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (column-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports negative strides for both dimensions of `A` (row-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports negative strides for both dimensions of `A` (column-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `A` offset (row-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `A` offset (column-major)', function test( t ) { + var expected; + var data; + 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 Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = rxp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` stride (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cxp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + 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 data; + var out; + var a; + var x; + var y; + + data = rxn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + 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 data; + var out; + var a; + var x; + var y; + + data = cxn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` offset (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = rox; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` offset (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cox; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `y` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = ryp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `y` stride (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cyp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + 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 data; + var out; + var a; + var x; + var y; + + data = ryn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + 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 data; + var out; + var a; + var x; + var y; + + data = cyn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `y` offset (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = roy; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `y` offset (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = coy; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + 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 data; + var out; + var a; + var x; + var y; + + data = rcap; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + 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 data; + var out; + var a; + var x; + var y; + + data = ccap; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + y = new Complex64Array( data.y ); + alpha = new Complex64Array( data.alpha ); + + expected = new Complex64Array( data.A_out ); + + out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); From b91e0285ae45959b927f5b424f46a61650cb503b Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 6 Jun 2025 12:36:18 +0530 Subject: [PATCH 03/24] test: add fixtures --- .../column_major_complex_access_pattern.json | 6 +- .../cher2/test/fixtures/column_major_l.json | 6 +- .../cher2/test/fixtures/column_major_oa.json | 6 +- .../cher2/test/fixtures/column_major_ox.json | 6 +- .../cher2/test/fixtures/column_major_oy.json | 6 +- .../test/fixtures/column_major_sa1_sa2.json | 23 +++++ .../blas/base/cher2/test/test.cher2.js | 54 ++++++------ .../blas/base/cher2/test/test.ndarray.js | 84 +++++++++---------- 8 files changed, 107 insertions(+), 84 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1_sa2.json diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_complex_access_pattern.json index b8403efaa7cd..97b6874f40b1 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_complex_access_pattern.json +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_complex_access_pattern.json @@ -11,9 +11,9 @@ "offsetY": 3, "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 6.0, 999.0, 999.0, 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 8.0, 9.0, 999.0, 999.0, 0.0, 0.0, 1.0, 0.0, 7.0, 0.0, 11.0, 0.0, 999.0, 999.0 ], "A_mat": [ - [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ], - [ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ], - [ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ] + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ], + [ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ] ], "LDA": 5, "strideA1": -4, diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_l.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_l.json index 3b31aa6366fc..dbe3014a1e63 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_l.json +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_l.json @@ -11,9 +11,9 @@ "offsetY": 0, "A": [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ], "A_mat": [ - [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ], - [ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ], - [ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ] + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ], + [ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ] ], "LDA": 3, "strideA1": 1, diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oa.json index 1e11e7aab619..891d0956238b 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oa.json +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oa.json @@ -11,9 +11,9 @@ "offsetY": 0, "A": [ 999.0, 999.0, 999.0, 999.0, 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ], "A_mat": [ - [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ], - [ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ], - [ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ] + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ], + [ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ] ], "LDA": 3, "strideA1": 1, diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_ox.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_ox.json index d6437a569210..39a241c4b53a 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_ox.json +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_ox.json @@ -11,9 +11,9 @@ "offsetY": 0, "A": [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ], "A_mat": [ - [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ], - [ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ], - [ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ] + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ], + [ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ] ], "LDA": 3, "strideA1": 1, diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oy.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oy.json index 27c29680fbdd..8a9a2537bb27 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oy.json +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oy.json @@ -11,9 +11,9 @@ "offsetY": 1, "A": [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ], "A_mat": [ - [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ], - [ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ], - [ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ] + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ], + [ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ] ], "LDA": 3, "strideA1": 1, diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1_sa2.json new file mode 100644 index 000000000000..d67e5569c1b0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1_sa2.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 0, + "A": [ 1.0, 0.0, 999.0, 999.0, 999.0, 999.0, 3.0, 4.0, 999.0, 999.0, 999.0, 999.0, 5.0, 6.0, 7.0, 0.0, 0.0, 0.0, 999.0, 999.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 999.0, 999.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ], + [ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ] + ], + "LDA": 4, + "strideA1": 3, + "strideA2": 4, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 999.0, 999.0, 999.0, 999.0, 25.0, 8.0, 999.0, 999.0, 999.0, 999.0, 39.0, 14.0, 57.0, 0.0, 0.0, 0.0, 999.0, 999.0, 86.0, 13.0, 0.0, 0.0, 0.0, 0.0, 999.0, 999.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js b/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js index 4a5162aed8c3..72d3556b57b1 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js @@ -26,7 +26,7 @@ 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 cher = require( './../lib/cher.js' ); +var cher2 = require( './../lib/cher2.js' ); // FIXTURES // @@ -50,12 +50,12 @@ var cyn = require( './fixtures/column_major_yn.json' ); tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); - t.strictEqual( typeof cher, 'function', 'main export is a function' ); + t.strictEqual( typeof cher2, 'function', 'main export is a function' ); t.end(); }); tape( 'the function has an arity of 10', function test( t ) { - t.strictEqual( cher.length, 10, 'returns expected value' ); + t.strictEqual( cher2.length, 10, 'returns expected value' ); t.end(); }); @@ -80,7 +80,7 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - cher( value, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, y, strideY, new Complex64Array( data.A ), data.LDA ); + cher2( value, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, y, strideY, new Complex64Array( data.A ), data.LDA ); }; } }); @@ -106,7 +106,7 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - cher( data.order, value, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA ); + cher2( data.order, value, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA ); }; } }); @@ -131,7 +131,7 @@ tape( 'the function throws an error if provided an invalid third argument', func function badValue( value ) { return function badValue() { - cher( data.order, data.uplo, value, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA ); + cher2( data.order, data.uplo, value, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA ); }; } }); @@ -154,7 +154,7 @@ tape( 'the function throws an error if provided an invalid sixth argument', func function badValue( value ) { return function badValue() { - cher( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), value, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA ); + cher2( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), value, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA ); }; } }); @@ -177,7 +177,7 @@ tape( 'the function throws an error if provided an invalid eighth argument', fun function badValue( value ) { return function badValue() { - cher( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), value, new Complex64Array( data.A ), data.LDA ); + cher2( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), value, new Complex64Array( data.A ), data.LDA ); }; } }); @@ -205,7 +205,7 @@ tape( 'the function throws an error if provided an invalid tenth argument', func function badValue( value ) { return function badValue() { - cher( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), value ); + cher2( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), value ); }; } }); @@ -227,7 +227,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( expected = new Complex64Array( data.A_out ); - out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -251,7 +251,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( expected = new Complex64Array( data.A_out ); - out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -275,7 +275,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( expected = new Complex64Array( data.A_out ); - out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -299,7 +299,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( expected = new Complex64Array( data.A_out ); - out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -320,7 +320,7 @@ tape( 'the function returns a reference to the second input matrix (row-major)', y = new Complex64Array( data.y ); alpha = new Complex64Array( data.alpha ); - out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.end(); @@ -340,7 +340,7 @@ tape( 'the function returns a reference to the second input matrix (column-major y = new Complex64Array( data.y ); alpha = new Complex64Array( data.alpha ); - out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.end(); @@ -363,7 +363,7 @@ tape( 'if `N` is `0`, the function returns the second input matrix unchanged (ro expected = new Complex64Array( data.A ); - out = cher( data.order, data.uplo, 0, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, 0, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -387,7 +387,7 @@ tape( 'if `N` is `0`, the function returns the second input matrix unchanged (co expected = new Complex64Array( data.A ); - out = cher( data.order, data.uplo, 0, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, 0, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -411,7 +411,7 @@ tape( 'if `α` is `0`, the function returns the second input matrix unchanged (r expected = new Complex64Array( data.A ); - out = cher( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -435,7 +435,7 @@ tape( 'if `α` is `0`, the function returns the second input matrix unchanged (c expected = new Complex64Array( data.A ); - out = cher( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -459,7 +459,7 @@ tape( 'the function supports specifying `x` stride (row-major)', function test( expected = new Complex64Array( data.A_out ); - out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -483,7 +483,7 @@ tape( 'the function supports specifying `x` stride (column-major)', function tes expected = new Complex64Array( data.A_out ); - out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -507,7 +507,7 @@ tape( 'the function supports specifying negative `x` stride (row-major)', functi expected = new Complex64Array( data.A_out ); - out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -531,7 +531,7 @@ tape( 'the function supports specifying negative `x` stride (column-major)', fun expected = new Complex64Array( data.A_out ); - out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -555,7 +555,7 @@ tape( 'the function supports specifying `y` stride (row-major)', function test( expected = new Complex64Array( data.A_out ); - out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -579,7 +579,7 @@ tape( 'the function supports specifying `y` stride (column-major)', function tes expected = new Complex64Array( data.A_out ); - out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -603,7 +603,7 @@ tape( 'the function supports specifying negative `y` stride (row-major)', functi expected = new Complex64Array( data.A_out ); - out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -627,7 +627,7 @@ tape( 'the function supports specifying negative `x` stride (column-major)', fun expected = new Complex64Array( data.A_out ); - out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js index ab9898d4683c..ed0adb6b9368 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js @@ -25,7 +25,7 @@ var tape = require( 'tape' ); var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); var Complex64Array = require( '@stdlib/array/complex64' ); -var cher = require( './../lib/ndarray.js' ); +var cher2 = require( './../lib/ndarray.js' ); // FIXTURES // @@ -65,12 +65,12 @@ var ccap = require( './fixtures/column_major_complex_access_pattern.json' ); tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); - t.strictEqual( typeof cher, 'function', 'main export is a function' ); + t.strictEqual( typeof cher2, 'function', 'main export is a function' ); t.end(); }); tape( 'the function has an arity of 13', function test( t ) { - t.strictEqual( cher.length, 13, 'returns expected value' ); + t.strictEqual( cher2.length, 13, 'returns expected value' ); t.end(); }); @@ -95,7 +95,7 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - cher( value, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + cher2( value, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); }; } }); @@ -120,7 +120,7 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - cher( data.uplo, value, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + cher2( data.uplo, value, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); }; } }); @@ -143,7 +143,7 @@ tape( 'the function throws an error if provided an invalid fifth argument', func function badValue( value ) { return function badValue() { - cher( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), value, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + cher2( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), value, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); }; } }); @@ -166,7 +166,7 @@ tape( 'the function throws an error if provided an invalid eighth argument', fun function badValue( value ) { return function badValue() { - cher( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), value, data.strideA2, data.offsetA ); + cher2( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), value, data.strideA2, data.offsetA ); }; } }); @@ -189,7 +189,7 @@ tape( 'the function throws an error if provided an invalid eleventh argument', f function badValue( value ) { return function badValue() { - cher( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, value, data.offsetA ); + cher2( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, value, data.offsetA ); }; } }); @@ -212,7 +212,7 @@ tape( 'the function throws an error if provided an invalid twelfth argument', fu function badValue( value ) { return function badValue() { - cher( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, value, data.offsetA ); + cher2( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, value, data.offsetA ); }; } }); @@ -234,7 +234,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -258,7 +258,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -282,7 +282,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -306,7 +306,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -327,7 +327,7 @@ tape( 'the function returns a reference to the input matrix `A`', function test( y = new Complex64Array( data.y ); alpha = new Complex64Array( data.alpha ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.end(); @@ -350,11 +350,11 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i expected = new Complex64Array( data.A ); - out = cher( data.uplo, 0, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, 0, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( a, expected, 'returns expected value' ); - out = cher( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( a, expected, 'returns expected value' ); @@ -378,11 +378,11 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i expected = new Complex64Array( data.A ); - out = cher( data.uplo, 0, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, 0, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( a, expected, 'returns expected value' ); - out = cher( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( a, expected, 'returns expected value' ); @@ -406,7 +406,7 @@ tape( 'the function supports specifying the strides of the first and second dime expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -430,7 +430,7 @@ tape( 'the function supports specifying the strides of the first and second dime expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -454,7 +454,7 @@ tape( 'the function supports a negative stride for the first dimension of `A` (r expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -478,7 +478,7 @@ tape( 'the function supports a negative stride for the first dimension of `A` (c expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -502,7 +502,7 @@ tape( 'the function supports a negative stride for the second dimension of `A` ( expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -526,7 +526,7 @@ tape( 'the function supports a negative stride for the second dimension of `A` ( expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -550,7 +550,7 @@ tape( 'the function supports negative strides for both dimensions of `A` (row-ma expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -574,7 +574,7 @@ tape( 'the function supports negative strides for both dimensions of `A` (column expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -598,7 +598,7 @@ tape( 'the function supports specifying an `A` offset (row-major)', function tes expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -622,7 +622,7 @@ tape( 'the function supports specifying an `A` offset (column-major)', function expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -646,7 +646,7 @@ tape( 'the function supports specifying an `x` stride (row-major)', function tes expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -670,7 +670,7 @@ tape( 'the function supports specifying an `x` stride (column-major)', function expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -694,7 +694,7 @@ tape( 'the function supports specifying a negative `x` stride (row-major)', func expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -718,7 +718,7 @@ tape( 'the function supports specifying a negative `x` stride (column-major)', f expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -742,7 +742,7 @@ tape( 'the function supports specifying an `x` offset (row-major)', function tes expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -766,7 +766,7 @@ tape( 'the function supports specifying an `x` offset (column-major)', function expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -790,7 +790,7 @@ tape( 'the function supports specifying an `y` stride (row-major)', function tes expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -814,7 +814,7 @@ tape( 'the function supports specifying an `y` stride (column-major)', function expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -838,7 +838,7 @@ tape( 'the function supports specifying a negative `y` stride (row-major)', func expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -862,7 +862,7 @@ tape( 'the function supports specifying a negative `y` stride (column-major)', f expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -886,7 +886,7 @@ tape( 'the function supports specifying an `y` offset (row-major)', function tes expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -910,7 +910,7 @@ tape( 'the function supports specifying an `y` offset (column-major)', function expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -934,7 +934,7 @@ tape( 'the function supports complex access patterns (row-major)', function test expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -958,7 +958,7 @@ tape( 'the function supports complex access patterns (column-major)', function t expected = new Complex64Array( data.A_out ); - out = cher( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); From 74887f84a78297680c45002da679408dd4ee9cdc Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 6 Jun 2025 12:38:40 +0530 Subject: [PATCH 04/24] chore: add indentation --- lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js b/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js index 72d3556b57b1..15b1a7dc4e3d 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js @@ -632,4 +632,4 @@ tape( 'the function supports specifying negative `x` stride (column-major)', fun t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); -}); \ No newline at end of file +}); From 3e58da76c5005f7f8cd88cfa05cc29247d5ed386 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 6 Jun 2025 17:12:45 +0530 Subject: [PATCH 05/24] test: update implementation --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cher2/README.md | 296 ++++++++++++++++++ .../blas/base/cher2/docs/types/index.d.ts | 44 +-- .../@stdlib/blas/base/cher2/lib/cher2.js | 10 +- .../@stdlib/blas/base/cher2/lib/index.js | 4 +- .../@stdlib/blas/base/cher2/lib/ndarray.js | 8 +- .../test/fixtures/column_major_sa1_sa2n.json | 23 ++ .../test/fixtures/column_major_sa1n_sa2.json | 23 ++ .../test/fixtures/column_major_sa1n_sa2n.json | 23 ++ .../cher2/test/fixtures/column_major_u.json | 23 ++ .../test/fixtures/column_major_xnyn.json | 23 ++ .../test/fixtures/column_major_xnyp.json | 23 ++ .../test/fixtures/column_major_xpyn.json | 23 ++ .../test/fixtures/column_major_xpyp.json | 23 ++ .../row_major_complex_access_pattern.json | 24 ++ .../base/cher2/test/fixtures/row_major_l.json | 23 ++ .../cher2/test/fixtures/row_major_oa.json | 23 ++ .../cher2/test/fixtures/row_major_ox.json | 23 ++ .../cher2/test/fixtures/row_major_oy.json | 23 ++ .../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 | 24 ++ .../base/cher2/test/fixtures/row_major_u.json | 24 ++ .../cher2/test/fixtures/row_major_xnyn.json | 23 ++ .../cher2/test/fixtures/row_major_xnyp.json | 23 ++ .../cher2/test/fixtures/row_major_xpyn.json | 23 ++ .../cher2/test/fixtures/row_major_xpyp.json | 23 ++ .../blas/base/cher2/test/test.cher2.js | 146 +++++---- .../blas/base/cher2/test/test.ndarray.js | 160 ++++++---- 29 files changed, 1017 insertions(+), 160 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/README.md create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xnyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xnyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xpyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xpyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_l.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_ox.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_oy.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xnyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xnyp.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xpyn.json create mode 100644 lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xpyp.json diff --git a/lib/node_modules/@stdlib/blas/base/cher2/README.md b/lib/node_modules/@stdlib/blas/base/cher2/README.md new file mode 100644 index 000000000000..0f6ddba20cdb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/README.md @@ -0,0 +1,296 @@ + + +# cher2 + +> Perform the hermitian rank 1 operation `A = alpha*x*x**H + A`, where `alpha` is a real scalar, `X` is an `N` element vector and `A` is an `N` by `N` hermitian matrix. + +
+ +## Usage + +```javascript +var cher2 = require( '@stdlib/blas/base/cher2' ); +``` + +#### cher2( order, uplo, N, α, x, strideX, y, strideY, A, LDA ) + +Performs the hermitian rank 1 operation `A = alpha*x*x**H + A`, where `alpha` is a real scalar, `X` is an `N` element vector and `A` is an `N` by `N` hermitian matrix. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +var alpha = new Complex64( 1.0, 0.0 ); + +cher2( 'row-major', 'lower', x.length, alpha, x, 1, y, 1, A, 2 ); +// A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.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`. +- **α**: scalar constant. +- **x**: first input vector [`Complex64Array`][@stdlib/array/complex64]. +- **strideX**: index increment for `x`. +- **y**: second input vector [`Complex64Array`][@stdlib/array/complex64]. +- **strideY**: index increment for `y`. +- **A**: input matrix stored in linear memory as [`Complex64Array`][@stdlib/array/complex64]. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). + +The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +var alpha = new Complex64( 1.0, 0.0 ); + +cher2( 'row-major', 'lower', x.length, alpha, x, 1, y, 1, A, 2 ); +// A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.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 array: +var x0 = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 1.0, 1.0 ] ); +var y0 = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 1.0, 1.0 ] ); + +var alpha = new Complex64( 1.0, 0.0 ); + +// Define a input matrix: +var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); + +// Create an offset view: +var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var y1 = new Complex64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +cher2( 'row-major', 'lower', x1.length, alpha, x1, 1, y1, 1, A, 2 ); +// A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] +``` + + + +#### cher2.ndarray( uplo, N, α, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ) + +Performs the hermitian rank 1 operation `A = alpha*x*x**H + A`, where `alpha` is a real scalar, `X` is an `N` element vector and `A` is an `N` by `N` hermitian matrix using alternative indexing semantics. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +var alpha = new Complex64( 1.0, 0.0 ); + +cher2.ndarray( 'lower', x.length, alpha, x, 1, 0, y, 1, 0, A, 2, 1, 0 ); +// A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] +``` + +The function has the following additional parameters: + +- **strideA1**: stride of the first dimension of `A`. +- **strideA2**: stride of the second dimension of `A`. +- **offsetX**: starting index for `x`. +- **offsetY**: starting index for `y`. +- **offsetA**: starting index for `A`. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to scale every other value in the input strided array starting from the second element, + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +var alpha = new Complex64( 1.0, 0.0 ); + +cher2.ndarray( 'lower', x.length, alpha, x, -1, 0, y, -1, 0, A, 2, 1, 0 ); +// A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] +``` + +
+ + + +
+ +## Notes + +- If `N = 0` or `realf( α ) = 0.0` or `imagf( α ) = 0.0`, both functions return `x` unchanged. +- `cher2()` corresponds to the [BLAS][blas] level 2 function [`cher2`][cher2]. + +
+ + + +
+ +## Examples + + + +```javascript +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 cher2 = require( '@stdlib/blas/base/cher2' ); + +function rand() { + return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); +} + +var x = filledarrayBy( 3, 'complex64', rand ); +console.log( x.get( 0 ).toString() ); + +var y = filledarrayBy( 3, 'complex64', rand ); +console.log( y.get( 0 ).toString() ); + +var A = filledarrayBy( 9, 'complex64', rand ); +console.log( A.get( 0 ).toString() ); + +var alpha = new Complex64( 2.0, 2.0 ); +console.log( alpha.toString() ); + +cher2( 'row-major', 'upper', 3, alpha, x, 1, y, 1, A, 3 ); + +// Print the results: +logEach( '(%s)', A ); + +cher2.ndarray( 'upper', 3, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); + +// Print the results: +logEach( '(%s)', A ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/base/cher2/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/index.d.ts index a5a5b4b57b24..b42a03e6daca 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/index.d.ts @@ -20,8 +20,8 @@ /// -import Complex64 from '@stdlib/complex/float32/ctor'; import { Complex64Array } from '@stdlib/types/array'; +import { Complex64 } from '@stdlib/types/complex'; import { Layout, MatrixTriangle } from '@stdlib/types/blas'; /** @@ -37,7 +37,7 @@ interface Routine { * @param alpha - scalar constant * @param x - first input array * @param strideX - `x` stride length - * @param y - second input array + * @param y - second input array * @param strideY - `y` stride length * @param A - input matrix * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) @@ -45,15 +45,15 @@ interface Routine { * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); - * var Complex64 = require( '@stdlib/complex/float32/ctor' ); - * - * var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); - * var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); - * var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); - * var alpha = new Complex64( 1.0, 0.0 ); - * - * cher2( 'lower', x.length, alpha, x, 1, y, 1, A, 2, 1 ); - * // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); + * var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); + * var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); + * var alpha = new Complex64( 1.0, 0.0 ); + * + * cher2( 'row-major', 'lower', x.length, alpha, x, 1, y, 1, A, 2 ); + * // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] */ ( order: Layout, uplo: MatrixTriangle, N: number, alpha: Complex64, x: Complex64Array, strideX: number, y: Complex64Array, strideY: number, A: Complex64Array, LDA: number ): Complex64Array; @@ -66,7 +66,7 @@ interface Routine { * @param x - first input array * @param strideX - `x` stride length * @param offsetX - starting `x` index - * @param y - second input array + * @param y - second input array * @param strideY - `y` stride length * @param offsetY - starting `y` index * @param A - input matrix @@ -77,15 +77,15 @@ interface Routine { * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); - * var Complex64 = require( '@stdlib/complex/float32/ctor' ); - * - * var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); - * var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); - * var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); - * var alpha = new Complex64( 1.0, 0.0 ); - * - * cher2( 'lower', x.length, alpha, x, 1, 0, y, 1, 0, A, 2, 1, 0 ); - * // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); + * var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); + * var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); + * var alpha = new Complex64( 1.0, 0.0 ); + * + * cher2( 'lower', x.length, alpha, x, 1, 0, y, 1, 0, A, 2, 1, 0 ); + * // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] */ ndarray( uplo: MatrixTriangle, N: number, alpha: Complex64, x: Complex64Array, strideX: number, offsetX: number, y: Complex64Array, strideY: number, offsetY: number, A: Complex64Array, strideA1: number, strideA2: number, offsetA: number ): Complex64Array; } @@ -114,7 +114,7 @@ interface Routine { * var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); * var alpha = new Complex64( 1.0, 0.0 ); * -* cher2( 'lower', x.length, alpha, x, 1, y, 1, A, 2, 1 ); +* cher2( 'row-major', 'lower', x.length, alpha, x, 1, y, 1, A, 2 ); * // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] * * @example diff --git a/lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js index 1e8c89aa750f..2aa40a96fdff 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js @@ -25,6 +25,8 @@ var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); var format = require( '@stdlib/string/format' ); var ndarray = require( './ndarray.js' ); @@ -41,7 +43,7 @@ var ndarray = require( './ndarray.js' ); * @param {Complex64Array} x - input array * @param {integer} strideX - `x` stride length * @param {Complex64Array} y - input array -* @param {integer} strideX - `y` stride length +* @param {integer} strideY - `y` stride length * @param {Complex64Array} A - input matrix * @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) * @throws {TypeError} first argument must be a valid order @@ -61,7 +63,7 @@ var ndarray = require( './ndarray.js' ); * var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); * var alpha = new Complex64( 1.0, 0.0 ); * -* cher2( 'lower', x.length, alpha, x, 1, y, 1, A, 2, 1 ); +* cher2( 'row-major', 'lower', x.length, alpha, x, 1, y, 1, A, 2 ); * // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] */ function cher2( order, uplo, N, alpha, x, strideX, y, strideY, A, LDA ) { @@ -82,13 +84,13 @@ function cher2( order, uplo, N, alpha, x, strideX, y, strideY, A, LDA ) { if ( strideX === 0 ) { throw new RangeError( format( 'invalid argument. Sixth argument must be non-zero. Value: `%d`.', strideX ) ); } - if ( strideY === 0 ) { + if ( strideY === 0 ) { throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideY ) ); } if ( LDA < max( 1, N ) ) { throw new RangeError( format( 'invalid argument. Tenth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); } - if ( N === 0 || alpha === 0.0 ) { + if ( N === 0 || ( realf( alpha ) === 0.0 && imagf( alpha ) === 0.0 ) ) { return A; } if ( isColumnMajor( order ) ) { diff --git a/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js index 1ff99ee02b44..1163cafdcfa4 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js @@ -26,18 +26,20 @@ * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* var cher2 = require( '@stdlib/blas/base/cher2' ); * * var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); * var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); * var A = new Complex64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); * var alpha = new Complex64( 1.0, 0.0 ); * -* cher2( 'lower', x.length, alpha, x, 1, y, 1, A, 2, 1 ); +* cher2( 'row-major', 'lower', x.length, alpha, x, 1, y, 1, A, 2 ); * // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* var cher2 = require( '@stdlib/blas/base/cher2' ); * * var x = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); * var y = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); diff --git a/lib/node_modules/@stdlib/blas/base/cher2/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/ndarray.js index fb911d8f1cfa..fd85b2d2bc93 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/ndarray.js @@ -22,6 +22,8 @@ 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' ); @@ -64,7 +66,7 @@ var base = require( './base.js' ); * cher2( 'lower', x.length, alpha, x, 1, 0, y, 1, 0, A, 2, 1, 0 ); * // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] */ -function cher2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ) { +function cher2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ) { // eslint-disable-line max-params, max-len if ( !isMatrixTriangle( uplo ) ) { throw new TypeError( format( 'invalid argument. First argument must specify whether to reference the lower or upper triangular matrix. Value: `%s`.', uplo ) ); } @@ -74,7 +76,7 @@ function cher2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, str if ( strideX === 0 ) { throw new RangeError( format( 'invalid argument. Fifth argument must be non-zero. Value: `%d`.', strideX ) ); } - if ( strideY === 0 ) { + if ( strideY === 0 ) { throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideY ) ); } if ( strideA1 === 0 ) { @@ -84,7 +86,7 @@ function cher2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, str throw new RangeError( format( 'invalid argument. Twelfth argument must be non-zero. Value: `%d`.', strideA2 ) ); } - if ( N === 0 || alpha === 0.0 ) { + if ( N === 0 || ( realf( alpha ) === 0.0 && imagf( alpha ) === 0.0 ) ) { return A; } return base( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ); diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1_sa2n.json new file mode 100644 index 000000000000..2b7a536b13ef --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1_sa2n.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 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, 11.0, 0.0, 7.0, 0.0, 1.0, 0.0, 0.0, 0.0, 8.0, 9.0, 3.0, 4.0, 0.0, 0.0, 0.0, 0.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ], + [ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ] + ], + "LDA": 4, + "strideA1": 3, + "strideA2": -4, + "offsetA": 12, + "A_out": [ 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, 133.0, 0.0, 57.0, 0.0, 11.0, 0.0, 0.0, 0.0, 86.0, 13.0, 25.0, 8.0, 0.0, 0.0, 0.0, 0.0, 39.0, 14.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1n_sa2.json new file mode 100644 index 000000000000..7b708d644950 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1n_sa2.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 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, 5.0, 6.0, 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 8.0, 9.0, 0.0, 0.0, 1.0, 0.0, 7.0, 0.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ], + [ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ] + ], + "LDA": 4, + "strideA1": -3, + "strideA2": 4, + "offsetA": 12, + "A_out": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 39.0, 14.0, 0.0, 0.0, 0.0, 0.0, 25.0, 8.0, 86.0, 13.0, 0.0, 0.0, 11.0, 0.0, 57.0, 0.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1n_sa2n.json new file mode 100644 index 000000000000..d0604ebfce11 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_sa1n_sa2n.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 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, 11.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 8.0, 9.0, 999.0, 999.0, 999.0, 999.0, 7.0, 0.0, 5.0, 6.0, 0.0, 0.0, 999.0, 999.0, 3.0, 4.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ], + [ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ] + ], + "LDA": 4, + "strideA1": -3, + "strideA2": -4, + "offsetA": 20, + "A_out": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 133.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 86.0, 13.0, 999.0, 999.0, 999.0, 999.0, 57.0, 0.0, 39.0, 14.0, 0.0, 0.0, 999.0, 999.0, 25.0, 8.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_u.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_u.json new file mode 100644 index 000000000000..1daf0811e551 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_u.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "upper", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 0, + "A": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 5.0, 0.0, 0.0, 0.0, 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ], + [ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ], + [ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 25.0, 0.0, 55.0, 0.0, 0.0, 0.0, 41.0, 0.0, 87.0, 6.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xnyn.json new file mode 100644 index 000000000000..4aa51d4e4f3c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xnyn.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 5.0, 6.0, 3.0, 4.0, 1.0, 2.0 ], + "strideX": -1, + "offsetX": 2, + "y": [ 5.0, 6.0, 3.0, 4.0, 1.0, 2.0 ], + "strideY": -1, + "offsetY": 2, + "A": [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ], + [ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 25.0, 8.0, 39.0, 14.0, 0.0, 0.0, 57.0, 0.0, 86.0, 13.0, 0.0, 0.0, 0.0, 0.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xnyp.json new file mode 100644 index 000000000000..2c16024eae17 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xnyp.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 5.0, 6.0, 3.0, 4.0, 1.0, 2.0 ], + "strideX": -1, + "offsetX": 2, + "y": [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 5.0, 6.0 ], + "strideY": 2, + "offsetY": 0, + "A": [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ], + [ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 25.0, 8.0, 39.0, 14.0, 0.0, 0.0, 57.0, 0.0, 86.0, 13.0, 0.0, 0.0, 0.0, 0.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xpyn.json new file mode 100644 index 000000000000..3267846dfc7c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xpyn.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 5.0, 6.0 ], + "strideX": 2, + "offsetX": 0, + "y": [ 5.0, 6.0, 3.0, 4.0, 1.0, 2.0 ], + "strideY": -1, + "offsetY": 2, + "A": [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ], + [ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 25.0, 8.0, 39.0, 14.0, 0.0, 0.0, 57.0, 0.0, 86.0, 13.0, 0.0, 0.0, 0.0, 0.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xpyp.json new file mode 100644 index 000000000000..11cfb1df8db5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_xpyp.json @@ -0,0 +1,23 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 5.0, 6.0 ], + "strideX": 2, + "offsetX": 0, + "y": [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 5.0, 6.0 ], + "strideY": 2, + "offsetY": 0, + "A": [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ], + [ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 25.0, 8.0, 39.0, 14.0, 0.0, 0.0, 57.0, 0.0, 86.0, 13.0, 0.0, 0.0, 0.0, 0.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 000000000000..d68d9f1df95d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_complex_access_pattern.json @@ -0,0 +1,24 @@ + +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 5.0, 6.0 ], + "strideX": 2, + "offsetX": 3, + "y": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 5.0, 6.0 ], + "strideY": 2, + "offsetY": 3, + "A": [ 999.0, 999.0, 999.0, 999.0, 7.0, 8.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 9.0, 10.0, 3.0, 4.0, 999.0, 999.0, 0.0, 0.0, 11.0, 0.0, 5.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 999.0, 999.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] + ], + "LDA": 5, + "strideA1": -5, + "strideA2": 4, + "offsetA": 12, + "A_out": [ 999.0, 999.0, 999.0, 999.0, 41.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 87.0, 6.0, 25.0, 0.0, 999.0, 999.0, 0.0, 0.0, 133.0, 0.0, 55.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 999.0, 999.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_l.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_l.json new file mode 100644 index 000000000000..268f6836ef2a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_l.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 0, + "A": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 5.0, 0.0, 0.0, 0.0, 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 25.0, 0.0, 55.0, 0.0, 0.0, 0.0, 41.0, 0.0, 87.0, 6.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_oa.json new file mode 100644 index 000000000000..fbb0a6ec9f26 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_oa.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 0, + "A": [ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 5.0, 0.0, 0.0, 0.0, 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 2, + "A_out": [ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 25.0, 0.0, 55.0, 0.0, 0.0, 0.0, 41.0, 0.0, 87.0, 6.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_ox.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_ox.json new file mode 100644 index 000000000000..f5831752072e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_ox.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 1, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 0, + "A": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 5.0, 0.0, 0.0, 0.0, 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 25.0, 0.0, 55.0, 0.0, 0.0, 0.0, 41.0, 0.0, 87.0, 6.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_oy.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_oy.json new file mode 100644 index 000000000000..aaf7ce3c175c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_oy.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 1, + "A": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 5.0, 0.0, 0.0, 0.0, 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 25.0, 0.0, 55.0, 0.0, 0.0, 0.0, 41.0, 0.0, 87.0, 6.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1_sa2.json new file mode 100644 index 000000000000..ec4908582311 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1_sa2.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 0, + "A": [ 1.0, 0.0, 999.0, 999.0, 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 999.0, 999.0, 999.0, 999.0, 5.0, 0.0, 7.0, 8.0, 999.0, 999.0, 0.0, 0.0, 9.0, 10.0, 999.0, 999.0, 999.0, 999.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] + ], + "LDA": 4, + "strideA1": 4, + "strideA2": 3, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 999.0, 999.0, 0.0, 0.0, 0.0, 0.0, 25.0, 0.0, 999.0, 999.0, 999.0, 999.0, 55.0, 0.0, 41.0, 0.0, 999.0, 999.0, 0.0, 0.0, 87.0, 6.0, 999.0, 999.0, 999.0, 999.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1_sa2n.json new file mode 100644 index 000000000000..9c839a580b63 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1_sa2n.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 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, 999.0, 999.0, 999.0, 999.0, 1.0, 0.0, 5.0, 0.0, 11.0, 0.0, 0.0, 0.0, 3.0, 4.0, 9.0, 10.0, 0.0, 0.0, 0.0, 0.0, 7.0, 8.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] + ], + "LDA": 4, + "strideA1": 4, + "strideA2": -3, + "offsetA": 12, + "A_out": [ 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, 999.0, 999.0, 999.0, 999.0, 11.0, 0.0, 55.0, 0.0, 133.0, 0.0, 0.0, 0.0, 25.0, 0.0, 87.0, 6.0, 0.0, 0.0, 0.0, 0.0, 41.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1n_sa2.json new file mode 100644 index 000000000000..d3c2b6f67f3d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1n_sa2.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 0, + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 7.0, 8.0, 999.0, 999.0, 999.0, 999.0, 9.0, 10.0, 3.0, 4.0, 0.0, 0.0, 11.0, 0.0, 5.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 999.0, 999.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] + ], + "LDA": 4, + "strideA1": -4, + "strideA2": 3, + "offsetA": 12, + "A_out": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 41.0, 0.0, 999.0, 999.0, 999.0, 999.0, 87.0, 6.0, 25.0, 0.0, 0.0, 0.0, 133.0, 0.0, 55.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 999.0, 999.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1n_sa2n.json new file mode 100644 index 000000000000..72ace3568795 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1n_sa2n.json @@ -0,0 +1,24 @@ + +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 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, 11.0, 0.0, 999.0, 999.0, 999.0, 999.0, 9.0, 10.0, 999.0, 999.0, 999.0, 999.0, 7.0, 8.0, 5.0, 0.0, 0.0, 0.0, 999.0, 999.0, 3.0, 4.0, 0.0, 0.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 ], + [ 3.0, 4.0, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] + ], + "LDA": 4, + "strideA1": -4, + "strideA2": -3, + "offsetA": 20, + "A_out": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 133.0, 0.0, 999.0, 999.0, 999.0, 999.0, 87.0, 6.0, 999.0, 999.0, 999.0, 999.0, 41.0, 0.0, 55.0, 0.0, 0.0, 0.0, 999.0, 999.0, 25.0, 0.0, 0.0, 0.0, 0.0, 0.0, 999.0, 999.0, 11.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json new file mode 100644 index 000000000000..424006316825 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json @@ -0,0 +1,24 @@ + +{ + "order": "row-major", + "uplo": "upper", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 0, + "y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideY": 1, + "offsetY": 0, + "A": [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ], + [ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ], + [ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 25.0, 8.0, 39.0, 14.0, 0.0, 0.0, 57.0, 0.0, 86.0, 13.0, 0.0, 0.0, 0.0, 0.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xnyn.json new file mode 100644 index 000000000000..977d00e612d3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xnyn.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 5.0, 6.0, 3.0, 4.0, 1.0, 2.0 ], + "strideX": -1, + "offsetX": 2, + "y": [ 5.0, 6.0, 3.0, 4.0, 1.0, 2.0 ], + "strideY": -1, + "offsetY": 2, + "A": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 5.0, 0.0, 0.0, 0.0, 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 25.0, 0.0, 55.0, 0.0, 0.0, 0.0, 41.0, 0.0, 87.0, 6.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xnyp.json new file mode 100644 index 000000000000..ff3b09d7fe93 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xnyp.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 5.0, 6.0, 3.0, 4.0, 1.0, 2.0 ], + "strideX": -1, + "offsetX": 2, + "y": [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 5.0, 6.0 ], + "strideY": 2, + "offsetY": 0, + "A": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 5.0, 0.0, 0.0, 0.0, 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 25.0, 0.0, 55.0, 0.0, 0.0, 0.0, 41.0, 0.0, 87.0, 6.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xpyn.json new file mode 100644 index 000000000000..05a3700e4e2c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xpyn.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 5.0, 6.0 ], + "strideX": 2, + "offsetX": 0, + "y": [ 5.0, 6.0, 3.0, 4.0, 1.0, 2.0 ], + "strideY": -1, + "offsetY": 2, + "A": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 5.0, 0.0, 0.0, 0.0, 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 25.0, 0.0, 55.0, 0.0, 0.0, 0.0, 41.0, 0.0, 87.0, 6.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xpyp.json new file mode 100644 index 000000000000..6db54255a0c8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_xpyp.json @@ -0,0 +1,23 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": [ 1.0, 0.0 ], + "x": [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 5.0, 6.0 ], + "strideX": 2, + "offsetX": 0, + "y": [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 5.0, 6.0 ], + "strideY": 2, + "offsetY": 0, + "A": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 5.0, 0.0, 0.0, 0.0, 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 4.0, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "A_out": [ 11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 25.0, 0.0, 55.0, 0.0, 0.0, 0.0, 41.0, 0.0, 87.0, 6.0, 133.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js b/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js index 15b1a7dc4e3d..78f305a45bb8 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js @@ -33,17 +33,17 @@ var cher2 = require( './../lib/cher2.js' ); var ru = require( './fixtures/row_major_u.json' ); var rl = require( './fixtures/row_major_l.json' ); -var rxp = require( './fixtures/row_major_xp.json' ); -var rxn = require( './fixtures/row_major_xn.json' ); -var ryp = require( './fixtures/row_major_yp.json' ); -var ryn = require( './fixtures/row_major_yn.json' ); +var rxpyp = require( './fixtures/row_major_xpyp.json' ); +var rxnyp = require( './fixtures/row_major_xnyp.json' ); +var rxpyn = require( './fixtures/row_major_xpyn.json' ); +var rxnyn = require( './fixtures/row_major_xnyn.json' ); var cu = require( './fixtures/column_major_u.json' ); var cl = require( './fixtures/column_major_l.json' ); -var cxp = require( './fixtures/column_major_xp.json' ); -var cxn = require( './fixtures/column_major_xn.json' ); -var cyp = require( './fixtures/column_major_yp.json' ); -var cyn = require( './fixtures/column_major_yn.json' ); +var cxpyp = require( './fixtures/column_major_xpyp.json' ); +var cxnyp = require( './fixtures/column_major_xnyp.json' ); +var cxpyn = require( './fixtures/column_major_xpyp.json' ); +var cxnyn = require( './fixtures/column_major_xnyn.json' ); // TESTS // @@ -80,7 +80,7 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - cher2( value, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, y, strideY, new Complex64Array( data.A ), data.LDA ); + cher2( value, data.uplo, data.N, new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), data.strideY, new Complex64Array( data.A ), data.LDA ); }; } }); @@ -106,7 +106,7 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - cher2( data.order, value, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA ); + cher2( data.uplo, value, data.N, new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), data.strideY, new Complex64Array( data.A ), data.LDA ); }; } }); @@ -131,7 +131,7 @@ tape( 'the function throws an error if provided an invalid third argument', func function badValue( value ) { return function badValue() { - cher2( data.order, data.uplo, value, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA ); + cher2( data.order, data.uplo, value, new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), data.strideY, new Complex64Array( data.A ), data.LDA ); }; } }); @@ -154,7 +154,7 @@ tape( 'the function throws an error if provided an invalid sixth argument', func function badValue( value ) { return function badValue() { - cher2( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), value, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA ); + cher2( data.order, data.uplo, data.N, new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ), new Complex64Array( data.x ), value, new Complex64Array( data.y ), data.strideY, new Complex64Array( data.A ), data.LDA ); }; } }); @@ -177,7 +177,7 @@ tape( 'the function throws an error if provided an invalid eighth argument', fun function badValue( value ) { return function badValue() { - cher2( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), value, new Complex64Array( data.A ), data.LDA ); + cher2( data.order, data.uplo, data.N, new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), value, new Complex64Array( data.A ), data.LDA ); }; } }); @@ -205,13 +205,14 @@ tape( 'the function throws an error if provided an invalid tenth argument', func function badValue( value ) { return function badValue() { - cher2( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), value ); + cher2( data.order, data.uplo, data.N, new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), data.strideY, new Complex64Array( data.A ), value ); }; } }); tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (row-major, lower)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -223,11 +224,11 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); - out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -236,6 +237,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (column-major, lower)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -247,11 +249,11 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); - out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -260,6 +262,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (row-major, upper)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -271,11 +274,11 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); - out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -284,6 +287,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (column-major, upper)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -295,11 +299,11 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); - out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -307,6 +311,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( }); tape( 'the function returns a reference to the second input matrix (row-major)', function test( t ) { + var alpha; var data; var out; var a; @@ -318,15 +323,16 @@ tape( 'the function returns a reference to the second input matrix (row-major)', a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); - out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns a reference to the second input matrix (column-major)', function test( t ) { + var alpha; var data; var out; var a; @@ -338,9 +344,9 @@ tape( 'the function returns a reference to the second input matrix (column-major a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); - out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.end(); @@ -348,6 +354,7 @@ tape( 'the function returns a reference to the second input matrix (column-major tape( 'if `N` is `0`, the function returns the second input matrix unchanged (row-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -359,11 +366,11 @@ tape( 'if `N` is `0`, the function returns the second input matrix unchanged (ro a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A ); - out = cher2( data.order, data.uplo, 0, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, 0, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -372,6 +379,7 @@ tape( 'if `N` is `0`, the function returns the second input matrix unchanged (ro tape( 'if `N` is `0`, the function returns the second input matrix unchanged (column-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -383,11 +391,11 @@ tape( 'if `N` is `0`, the function returns the second input matrix unchanged (co a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A ); - out = cher2( data.order, data.uplo, 0, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, 0, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -407,11 +415,10 @@ tape( 'if `α` is `0`, the function returns the second input matrix unchanged (r a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); expected = new Complex64Array( data.A ); - out = cher2( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, new Complex64( 0.0, 0.0 ), x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); @@ -431,203 +438,210 @@ tape( 'if `α` is `0`, the function returns the second input matrix unchanged (c a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); expected = new Complex64Array( data.A ); - out = cher2( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, new Complex64( 0.0, 0.0 ), x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function supports specifying `x` stride (row-major)', function test( t ) { +tape( 'the function supports specifying strides (row-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; var x; var y; - data = rxp; + data = rxpyp; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); - out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function supports specifying `x` stride (column-major)', function test( t ) { +tape( 'the function supports specifying strides (column-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; var x; var y; - data = cxp; + data = cxpyp; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); - out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function supports specifying negative `x` stride (row-major)', function test( t ) { +tape( 'the function supports specifying a negative `x` stride (row-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; var x; var y; - data = rxn; + data = rxnyp; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); - out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function supports specifying negative `x` stride (column-major)', function test( t ) { +tape( 'the function supports specifying a negative `x` stride (column-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; var x; var y; - data = cxn; + data = cxnyp; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); - out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function supports specifying `y` stride (row-major)', function test( t ) { +tape( 'the function supports specifying a negative `y` stride (row-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; var x; var y; - data = ryp; + data = rxpyn; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); - out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function supports specifying `y` stride (column-major)', function test( t ) { +tape( 'the function supports specifying a negative `y` stride (column-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; var x; var y; - data = cyp; + data = cxpyn; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); - out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function supports specifying negative `y` stride (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; var out; var a; var x; var y; - data = ryn; + data = rxnyn; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); - out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function supports specifying negative `x` stride (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; var out; var a; var x; var y; - data = cyn; + data = cxnyn; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); - out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA ); + out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, data.strideY, a, data.LDA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js index ed0adb6b9368..4f2005b32202 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js @@ -25,6 +25,7 @@ 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 cher2 = require( './../lib/ndarray.js' ); @@ -32,10 +33,10 @@ var cher2 = require( './../lib/ndarray.js' ); var ru = require( './fixtures/row_major_u.json' ); var rl = require( './fixtures/row_major_l.json' ); -var rxp = require( './fixtures/row_major_xp.json' ); -var rxn = require( './fixtures/row_major_xn.json' ); -var ryp = require( './fixtures/row_major_yp.json' ); -var ryn = require( './fixtures/row_major_yn.json' ); +var rxpyp = require( './fixtures/row_major_xpyp.json' ); +var rxnyp = require( './fixtures/row_major_xnyp.json' ); +var rxpyn = require( './fixtures/row_major_xpyn.json' ); +var rxnyn = require( './fixtures/row_major_xnyn.json' ); var roa = require( './fixtures/row_major_oa.json' ); var rox = require( './fixtures/row_major_ox.json' ); var roy = require( './fixtures/row_major_oy.json' ); @@ -47,10 +48,10 @@ var rcap = require( './fixtures/row_major_complex_access_pattern.json' ); var cu = require( './fixtures/column_major_u.json' ); var cl = require( './fixtures/column_major_l.json' ); -var cxp = require( './fixtures/column_major_xp.json' ); -var cxn = require( './fixtures/column_major_xn.json' ); -var cyp = require( './fixtures/column_major_yp.json' ); -var cyn = require( './fixtures/column_major_yn.json' ); +var cxpyp = require( './fixtures/column_major_xpyp.json' ); +var cxnyp = require( './fixtures/column_major_xnyp.json' ); +var cxpyn = require( './fixtures/column_major_xpyp.json' ); +var cxnyn = require( './fixtures/column_major_xnyn.json' ); var coa = require( './fixtures/column_major_oa.json' ); var cox = require( './fixtures/column_major_ox.json' ); var coy = require( './fixtures/column_major_oy.json' ); @@ -95,7 +96,7 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - cher2( value, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + cher2( value, data.N, new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); }; } }); @@ -120,7 +121,7 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - cher2( data.uplo, value, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + cher2( data.uplo, value, new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); }; } }); @@ -143,7 +144,7 @@ tape( 'the function throws an error if provided an invalid fifth argument', func function badValue( value ) { return function badValue() { - cher2( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), value, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + cher2( data.uplo, data.N, new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ), new Complex64Array( data.x ), value, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); }; } }); @@ -166,7 +167,7 @@ tape( 'the function throws an error if provided an invalid eighth argument', fun function badValue( value ) { return function badValue() { - cher2( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), value, data.strideA2, data.offsetA ); + cher2( data.uplo, data.N, new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), value, data.strideA2, data.offsetA ); }; } }); @@ -189,7 +190,7 @@ tape( 'the function throws an error if provided an invalid eleventh argument', f function badValue( value ) { return function badValue() { - cher2( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, value, data.offsetA ); + cher2( data.uplo, data.N, new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, value, data.offsetA ); }; } }); @@ -212,13 +213,14 @@ tape( 'the function throws an error if provided an invalid twelfth argument', fu function badValue( value ) { return function badValue() { - cher2( data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, value, data.offsetA ); + cher2( data.uplo, data.N, new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ), new Complex64Array( data.x ), data.strideX, data.offsetX, new Complex64Array( data.y ), data.strideY, data.offsetY, new Complex64Array( data.A ), data.strideA1, value, data.offsetA ); }; } }); tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, lower)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -230,7 +232,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -243,6 +245,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (column-major, lower)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -254,7 +257,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -267,6 +270,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (column-major, upper)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -278,7 +282,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -291,6 +295,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, upper)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -302,7 +307,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -314,6 +319,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( }); tape( 'the function returns a reference to the input matrix `A`', function test( t ) { + var alpha; var data; var out; var a; @@ -325,7 +331,7 @@ tape( 'the function returns a reference to the input matrix `A`', function test( a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); out = cher2( data.uplo, data.N, alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); @@ -335,6 +341,7 @@ tape( 'the function returns a reference to the input matrix `A`', function test( tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (row-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -346,7 +353,7 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A ); @@ -363,6 +370,7 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (column-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -374,7 +382,7 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A ); @@ -382,7 +390,7 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( a, expected, 'returns expected value' ); - out = cher2( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); + out = cher2( data.uplo, data.N, new Complex64( 0.0, 0.0 ), x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' ); t.deepEqual( a, expected, 'returns expected value' ); @@ -391,6 +399,7 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i 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 out; var a; @@ -402,7 +411,7 @@ tape( 'the function supports specifying the strides of the first and second dime a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -415,6 +424,7 @@ tape( 'the function supports specifying the strides of the first and second dime 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 out; var a; @@ -426,7 +436,7 @@ tape( 'the function supports specifying the strides of the first and second dime a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -439,6 +449,7 @@ tape( 'the function supports specifying the strides of the first and second dime 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 out; var a; @@ -450,7 +461,7 @@ tape( 'the function supports a negative stride for the first dimension of `A` (r a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -463,6 +474,7 @@ tape( 'the function supports a negative stride for the first dimension of `A` (r 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 out; var a; @@ -474,7 +486,7 @@ tape( 'the function supports a negative stride for the first dimension of `A` (c a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -487,6 +499,7 @@ tape( 'the function supports a negative stride for the first dimension of `A` (c 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 out; var a; @@ -498,7 +511,7 @@ tape( 'the function supports a negative stride for the second dimension of `A` ( a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -511,6 +524,7 @@ tape( 'the function supports a negative stride for the second dimension of `A` ( 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 out; var a; @@ -522,7 +536,7 @@ tape( 'the function supports a negative stride for the second dimension of `A` ( a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -535,6 +549,7 @@ tape( 'the function supports a negative stride for the second dimension of `A` ( tape( 'the function supports negative strides for both dimensions of `A` (row-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -546,7 +561,7 @@ tape( 'the function supports negative strides for both dimensions of `A` (row-ma a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -559,6 +574,7 @@ tape( 'the function supports negative strides for both dimensions of `A` (row-ma tape( 'the function supports negative strides for both dimensions of `A` (column-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -570,7 +586,7 @@ tape( 'the function supports negative strides for both dimensions of `A` (column a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -583,6 +599,7 @@ tape( 'the function supports negative strides for both dimensions of `A` (column tape( 'the function supports specifying an `A` offset (row-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -594,7 +611,7 @@ tape( 'the function supports specifying an `A` offset (row-major)', function tes a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -607,6 +624,7 @@ tape( 'the function supports specifying an `A` offset (row-major)', function tes tape( 'the function supports specifying an `A` offset (column-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -618,7 +636,7 @@ tape( 'the function supports specifying an `A` offset (column-major)', function a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -629,20 +647,21 @@ tape( 'the function supports specifying an `A` offset (column-major)', function t.end(); }); -tape( 'the function supports specifying an `x` stride (row-major)', function test( t ) { +tape( 'the function supports specifying strides (row-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; var x; var y; - data = rxp; + data = rxpyp; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -653,20 +672,21 @@ tape( 'the function supports specifying an `x` stride (row-major)', function tes t.end(); }); -tape( 'the function supports specifying an `x` stride (column-major)', function test( t ) { +tape( 'the function supports specifying strides (column-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; var x; var y; - data = cxp; + data = cxpyp; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -679,18 +699,19 @@ tape( 'the function supports specifying an `x` stride (column-major)', function tape( 'the function supports specifying a negative `x` stride (row-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; var x; var y; - data = rxn; + data = rxnyp; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -703,18 +724,19 @@ tape( 'the function supports specifying a negative `x` stride (row-major)', func tape( 'the function supports specifying a negative `x` stride (column-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; var x; var y; - data = cxn; + data = cxnyp; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -725,20 +747,21 @@ tape( 'the function supports specifying a negative `x` stride (column-major)', f t.end(); }); -tape( 'the function supports specifying an `x` offset (row-major)', function test( t ) { +tape( 'the function supports specifying a negative `y` stride (row-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; var x; var y; - data = rox; + data = rxpyn; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -749,20 +772,21 @@ tape( 'the function supports specifying an `x` offset (row-major)', function tes t.end(); }); -tape( 'the function supports specifying an `x` offset (column-major)', function test( t ) { +tape( 'the function supports specifying a negative `y` stride (column-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; var x; var y; - data = cox; + data = cxpyn; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -773,20 +797,21 @@ tape( 'the function supports specifying an `x` offset (column-major)', function t.end(); }); -tape( 'the function supports specifying an `y` stride (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; var out; var a; var x; var y; - data = ryp; + data = rxnyn; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -797,20 +822,21 @@ tape( 'the function supports specifying an `y` stride (row-major)', function tes t.end(); }); -tape( 'the function supports specifying an `y` stride (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; var out; var a; var x; var y; - data = cyp; + data = cxnyn; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -821,20 +847,21 @@ tape( 'the function supports specifying an `y` stride (column-major)', function t.end(); }); -tape( 'the function supports specifying a negative `y` stride (row-major)', function test( t ) { +tape( 'the function supports specifying an `x` offset (row-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; var x; var y; - data = ryn; + data = rox; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -845,20 +872,21 @@ tape( 'the function supports specifying a negative `y` stride (row-major)', func t.end(); }); -tape( 'the function supports specifying a negative `y` stride (column-major)', function test( t ) { +tape( 'the function supports specifying an `x` offset (column-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; var x; var y; - data = cyn; + data = cox; a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -871,6 +899,7 @@ tape( 'the function supports specifying a negative `y` stride (column-major)', f tape( 'the function supports specifying an `y` offset (row-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -882,7 +911,7 @@ tape( 'the function supports specifying an `y` offset (row-major)', function tes a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -895,6 +924,7 @@ tape( 'the function supports specifying an `y` offset (row-major)', function tes tape( 'the function supports specifying an `y` offset (column-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -906,7 +936,7 @@ tape( 'the function supports specifying an `y` offset (column-major)', function a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -919,6 +949,7 @@ tape( 'the function supports specifying an `y` offset (column-major)', function tape( 'the function supports complex access patterns (row-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -930,7 +961,7 @@ tape( 'the function supports complex access patterns (row-major)', function test a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); @@ -943,6 +974,7 @@ tape( 'the function supports complex access patterns (row-major)', function test tape( 'the function supports complex access patterns (column-major)', function test( t ) { var expected; + var alpha; var data; var out; var a; @@ -954,7 +986,7 @@ tape( 'the function supports complex access patterns (column-major)', function t a = new Complex64Array( data.A ); x = new Complex64Array( data.x ); y = new Complex64Array( data.y ); - alpha = new Complex64Array( data.alpha ); + alpha = new Complex64( data.alpha[ 0 ], data.alpha[ 1 ] ); expected = new Complex64Array( data.A_out ); From f6c08b918d45d58fcca4c70d71598ffde42006fd Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 6 Jun 2025 17:25:49 +0530 Subject: [PATCH 06/24] chore: update indentation --- 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: 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cher2/examples/index.js | 6 +- .../@stdlib/blas/base/cher2/lib/base.js | 268 +++++++++--------- 2 files changed, 137 insertions(+), 137 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/examples/index.js b/lib/node_modules/@stdlib/blas/base/cher2/examples/index.js index 8c60dfc10a20..695fa7f987f8 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/examples/index.js @@ -22,7 +22,7 @@ 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 cher = require( './../lib' ); +var cher2 = require( './../lib' ); function rand() { return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); @@ -40,12 +40,12 @@ console.log( A.get( 0 ).toString() ); var alpha = new Complex64( 2.0, 2.0 ); console.log( alpha.toString() ); -cher( 'row-major', 'upper', 3, alpha, x, 1, y, 1, A, 3 ); +cher2( 'row-major', 'upper', 3, alpha, x, 1, y, 1, A, 3 ); // Print the results: logEach( '(%s)', A ); -cher.ndarray( 'upper', 3, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); +cher2.ndarray( 'upper', 3, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // Print the results: logEach( '(%s)', A ); diff --git a/lib/node_modules/@stdlib/blas/base/cher2/lib/base.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/base.js index d996542b30e4..a101b7a9222d 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/base.js @@ -58,141 +58,141 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' ); * cher2( 'lower', x.length, alpha, x, 1, 0, y, 1, 0, A, 2, 1, 0 ); * // A => [ 5.0, 0.0, 0.0, 0.0, 6.0, 3.0, 8.0, 0.0 ] */ -function cher2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ) { - var alpha_re; - var alpha_im; - var tmp1_re; - var tmp1_im; - var tmp2_re; - var tmp2_im; - var re0_x; - var im0_x; - var re0_y; - var im0_y; - var re1_x; - var im1_x; - var re1_y; - var im1_y; +function cher2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ) { // eslint-disable-line max-params, max-len + var realpha; + var imalpha; + var retmp1; + var imtmp1; + var retmp2; + var imtmp2; var viewX; - var viewY; - var viewA; - var isrm; - var idx; - var ix1; - var iy1; - var ix0; - var iy0; - var re0; - var im0; - var re1; - var im1; - var sa0; - var sa1; - var re; - var im; - var i1; - var i0; - var ix; - var iy; - var ia; - var sx; - var sy; - - alpha_re = f32( alpha.re ); - alpha_im = f32( alpha.im ); - - viewX = reinterpret( x, 0 ); - viewY = reinterpret( y, 0 ); - viewA = reinterpret( A, 0 ); - - isrm = isRowMajor( [ strideA1, strideA2 ] ); - if ( isrm ) { - sa0 = strideA2 * 2; - sa1 = strideA1 * 2; - } else { - sa0 = strideA1 * 2; - sa1 = strideA2 * 2; - } - ix = offsetX * 2; - iy = offsetY * 2; - ia = offsetA * 2; - sx = strideX * 2; - sy = strideY * 2; - if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { - for ( i1 = 0; i1 < N; i1++ ) { - ix1 = ix + ( i1 * sx ); - iy1 = iy + ( i1 * sy ); - re0_x = f32( viewX[ ix1 ] ); - im0_x = f32( viewX[ ix1 + 1 ] ); - re0_y = f32( viewY[ iy1 ] ); - im0_y = f32( viewY[ iy1 + 1 ] ); - for ( i0 = i1; i0 < N; i0++ ) { - ix0 = ix + ( i0 * sx ); - iy0 = iy + ( i0 * sy ); - re1_x = f32( viewX[ ix0 ] ); - im1_x = f32( viewX[ ix0 + 1 ] ); - re1_y = f32( viewY[ iy0 ] ); - im1_y = f32( viewY[ iy0 + 1 ] ); - - re0 = f32( ( re0_x * re1_y ) + ( im0_x * im1_y ) ); - im0 = f32( ( im0_x * re1_y ) - ( re0_x * im1_y ) ); - tmp1_re = f32( ( alpha_re * re0 ) - ( alpha_im * im0 ) ); - tmp1_im = f32( ( alpha_re * im0 ) + ( alpha_im * re0 ) ); - - re1 = f32( ( re0_y * re1_x ) + ( im0_y * im1_x ) ); - im1 = f32( ( im0_y * re1_x ) - ( re0_y * im1_x ) ); - tmp2_re = f32( ( alpha_re * re1 ) + ( alpha_im * im1 ) ); - tmp2_im = f32( ( alpha_re * im1 ) - ( alpha_im * re1 ) ); - - re = f32( tmp1_re + tmp2_re ); - im = f32( tmp1_im + tmp2_im ); - idx = ia + ( i0 * sa0 ) + ( i1 * sa1 ); - viewA[ idx ] = f32( viewA[ idx ] + re ); - viewA[ idx + 1 ] = f32( viewA[ idx + 1 ] + im ); - if ( i0 === i1 ) { - viewA[ idx + 1 ] = 0.0; - } - } - } - return A; - } - // ( isrm && uplo === 'lower' ) || ( !isrm && uplo === 'upper' ) - for ( i1 = 0; i1 < N; i1++ ) { - ix1 = ix + ( i1 * sx ); - iy1 = iy + ( i1 * sy ); - re0_x = f32( viewX[ ix1 ] ); - im0_x = f32( viewX[ ix1 + 1 ] ); - re0_y = f32( viewY[ iy1 ] ); - im0_y = f32( viewY[ iy1 + 1 ] ); - for ( i0 = 0; i0 <= i1; i0++ ) { - ix0 = ix + ( i0 * sx ); - iy0 = iy + ( i0 * sy ); - re1_x = f32( viewX[ ix0 ] ); - im1_x = f32( viewX[ ix0 + 1 ] ); - re1_y = f32( viewY[ iy0 ] ); - im1_y = f32( viewY[ iy0 + 1 ] ); - - re0 = f32( ( re0_x * re1_y ) + ( im0_x * im1_y ) ); - im0 = f32( ( im0_x * re1_y ) - ( re0_x * im1_y ) ); - tmp1_re = f32( ( alpha_re * re0 ) - ( alpha_im * im0 ) ); - tmp1_im = f32( ( alpha_re * im0 ) + ( alpha_im * re0 ) ); - - re1 = f32( ( re0_y * re1_x ) + ( im0_y * im1_x ) ); - im1 = f32( ( im0_y * re1_x ) - ( re0_y * im1_x ) ); - tmp2_re = f32( ( alpha_re * re1 ) + ( alpha_im * im1 ) ); - tmp2_im = f32( ( alpha_re * im1 ) - ( alpha_im * re1 ) ); - - re = f32( tmp1_re + tmp2_re ); - im = f32( tmp1_im + tmp2_im ); - idx = ia + ( i0 * sa0 ) + ( i1 * sa1 ); - viewA[ idx ] = f32( viewA[ idx ] + re ); - viewA[ idx + 1 ] = f32( viewA[ idx + 1 ] + im ); - if ( i0 === i1 ) { - viewA[ idx + 1 ] = 0.0; - } - } - } - return A; + var viewY; + var viewA; + var xre0; + var xim0; + var yre0; + var yim0; + var xre1; + var xim1; + var yre1; + var yim1; + var isrm; + var idx; + var ix1; + var iy1; + var ix0; + var iy0; + var re0; + var im0; + var re1; + var im1; + var sa0; + var sa1; + var re; + var im; + var i1; + var i0; + var ix; + var iy; + var ia; + var sx; + var sy; + + realpha = f32( alpha.re ); + imalpha = f32( alpha.im ); + + viewX = reinterpret( x, 0 ); + viewY = reinterpret( y, 0 ); + viewA = reinterpret( A, 0 ); + + isrm = isRowMajor( [ strideA1, strideA2 ] ); + if ( isrm ) { + sa0 = strideA2 * 2; + sa1 = strideA1 * 2; + } else { + sa0 = strideA1 * 2; + sa1 = strideA2 * 2; + } + ix = offsetX * 2; + iy = offsetY * 2; + ia = offsetA * 2; + sx = strideX * 2; + sy = strideY * 2; + if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { + for ( i1 = 0; i1 < N; i1++ ) { + ix1 = ix + ( i1 * sx ); + iy1 = iy + ( i1 * sy ); + xre0 = f32( viewX[ ix1 ] ); + xim0 = f32( viewX[ ix1 + 1 ] ); + yre0 = f32( viewY[ iy1 ] ); + yim0 = f32( viewY[ iy1 + 1 ] ); + for ( i0 = i1; i0 < N; i0++ ) { + ix0 = ix + ( i0 * sx ); + iy0 = iy + ( i0 * sy ); + xre1 = f32( viewX[ ix0 ] ); + xim1 = f32( viewX[ ix0 + 1 ] ); + yre1 = f32( viewY[ iy0 ] ); + yim1 = f32( viewY[ iy0 + 1 ] ); + + re0 = f32( ( xre0 * yre1 ) + ( xim0 * yim1 ) ); + im0 = f32( ( xim0 * yre1 ) - ( xre0 * yim1 ) ); + retmp1 = f32( ( realpha * re0 ) - ( imalpha * im0 ) ); + imtmp1 = f32( ( realpha * im0 ) + ( imalpha * re0 ) ); + + re1 = f32( ( yre0 * xre1 ) + ( yim0 * xim1 ) ); + im1 = f32( ( yim0 * xre1 ) - ( yre0 * xim1 ) ); + retmp2 = f32( ( realpha * re1 ) + ( imalpha * im1 ) ); + imtmp2 = f32( ( realpha * im1 ) - ( imalpha * re1 ) ); + + re = f32( retmp1 + retmp2 ); + im = f32( imtmp1 + imtmp2 ); + idx = ia + ( i0 * sa0 ) + ( i1 * sa1 ); + viewA[ idx ] = f32( viewA[ idx ] + re ); + viewA[ idx + 1 ] = f32( viewA[ idx + 1 ] + im ); + if ( i0 === i1 ) { + viewA[ idx + 1 ] = 0.0; + } + } + } + return A; + } + // ( isrm && uplo === 'lower' ) || ( !isrm && uplo === 'upper' ) + for ( i1 = 0; i1 < N; i1++ ) { + ix1 = ix + ( i1 * sx ); + iy1 = iy + ( i1 * sy ); + xre0 = f32( viewX[ ix1 ] ); + xim0 = f32( viewX[ ix1 + 1 ] ); + yre0 = f32( viewY[ iy1 ] ); + yim0 = f32( viewY[ iy1 + 1 ] ); + for ( i0 = 0; i0 <= i1; i0++ ) { + ix0 = ix + ( i0 * sx ); + iy0 = iy + ( i0 * sy ); + xre1 = f32( viewX[ ix0 ] ); + xim1 = f32( viewX[ ix0 + 1 ] ); + yre1 = f32( viewY[ iy0 ] ); + yim1 = f32( viewY[ iy0 + 1 ] ); + + re0 = f32( ( xre0 * yre1 ) + ( xim0 * yim1 ) ); + im0 = f32( ( xim0 * yre1 ) - ( xre0 * yim1 ) ); + retmp1 = f32( ( realpha * re0 ) - ( imalpha * im0 ) ); + imtmp1 = f32( ( realpha * im0 ) + ( imalpha * re0 ) ); + + re1 = f32( ( yre0 * xre1 ) + ( yim0 * xim1 ) ); + im1 = f32( ( yim0 * xre1 ) - ( yre0 * xim1 ) ); + retmp2 = f32( ( realpha * re1 ) + ( imalpha * im1 ) ); + imtmp2 = f32( ( realpha * im1 ) - ( imalpha * re1 ) ); + + re = f32( retmp1 + retmp2 ); + im = f32( imtmp1 + imtmp2 ); + idx = ia + ( i0 * sa0 ) + ( i1 * sa1 ); + viewA[ idx ] = f32( viewA[ idx ] + re ); + viewA[ idx + 1 ] = f32( viewA[ idx + 1 ] + im ); + if ( i0 === i1 ) { + viewA[ idx + 1 ] = 0.0; + } + } + } + return A; } From d0cb7996fbbd6ab57dc587bdabb257a95c66b7de Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 6 Jun 2025 17:33:06 +0530 Subject: [PATCH 07/24] chore: update implementation --- 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: na - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../blas/base/cher2/benchmark/benchmark.js | 6 +- .../base/cher2/benchmark/benchmark.ndarray.js | 6 +- .../blas/base/cher2/docs/types/test.ts | 57 +++++++++---------- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.js index 9353d4484c15..7b378347bb0e 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.js @@ -47,17 +47,17 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var alpha; + var alpha; var xbuf; var ybuf; var Abuf; var x; - var y; + var y; var A; xbuf = uniform( len*2, -100.0, 100.0, options ); x = new Complex64Array( xbuf.buffer ); - ybuf = uniform( len*2, -100.0, 100.0, options ); + ybuf = uniform( len*2, -100.0, 100.0, options ); y = new Complex64Array( ybuf.buffer ); Abuf = uniform( (len*len)*2, -100.0, 100.0, options ); A = new Complex64Array( Abuf.buffer ); diff --git a/lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.ndarray.js index c9c55b762579..f16a4f33eb07 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/benchmark/benchmark.ndarray.js @@ -47,17 +47,17 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var alpha; + var alpha; var xbuf; var ybuf; var Abuf; var x; - var y; + var y; var A; xbuf = uniform( len*2, -100.0, 100.0, options ); x = new Complex64Array( xbuf.buffer ); - ybuf = uniform( len*2, -100.0, 100.0, options ); + ybuf = uniform( len*2, -100.0, 100.0, options ); y = new Complex64Array( ybuf.buffer ); Abuf = uniform( (len*len)*2, -100.0, 100.0, options ); A = new Complex64Array( Abuf.buffer ); diff --git a/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts index 9abcebff9b66..d22f61cd1c29 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts @@ -29,7 +29,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectType Complex64Array } @@ -39,7 +39,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2( 10, 'lower', 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError cher2( '10', 'lower', 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError @@ -57,7 +57,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2( 'row-major', 10, 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError cher2( 'row-major', '10', 10, alpha, x, 1, y, 1, A, 3 ); // $ExpectError @@ -75,7 +75,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2( 'row-major', 'lower', '10', alpha, x, 1, y, 1, A, 3 ); // $ExpectError cher2( 'row-major', 'lower', true, alpha, x, 1, y, 1, A, 3 ); // $ExpectError @@ -92,7 +92,6 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); cher2( 'row-major', 'lower', 10, '10', x, 1, y, 1, A, 3 ); // $ExpectError cher2( 'row-major', 'lower', 10, true, x, 1, y, 1, A, 3 ); // $ExpectError @@ -108,7 +107,7 @@ import cher2 = require( './index' ); { const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2( 'row-major', 'lower', 10, alpha, 10, 1, y, 1, A, 3 ); // $ExpectError cher2( 'row-major', 'lower', 10, alpha, '10', 1, y, 1, A, 3 ); // $ExpectError @@ -126,7 +125,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2( 'row-major', 'lower', 10, alpha, x, '10', y, 1, A, 3 ); // $ExpectError cher2( 'row-major', 'lower', 10, alpha, x, true, y, 1, A, 3 ); // $ExpectError @@ -142,7 +141,7 @@ import cher2 = require( './index' ); { const x = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2( 'row-major', 'lower', 10, alpha, x, 1, 10, 1, A, 3 ); // $ExpectError cher2( 'row-major', 'lower', 10, alpha, x, 1, '10', 1, A, 3 ); // $ExpectError @@ -160,7 +159,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2( 'row-major', 'lower', 10, alpha, x, 1, y, '10', A, 3 ); // $ExpectError cher2( 'row-major', 'lower', 10, alpha, x, 1, y, true, A, 3 ); // $ExpectError @@ -176,7 +175,7 @@ import cher2 = require( './index' ); { const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, 10, 3 ); // $ExpectError cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, '10', 3 ); // $ExpectError @@ -194,7 +193,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, A, '10' ); // $ExpectError cher2( 'row-major', 'lower', 10, alpha, x, 1, y, 1, A, true ); // $ExpectError @@ -211,7 +210,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2(); // $ExpectError cher2( 'row-major' ); // $ExpectError @@ -231,7 +230,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectType Complex64Array } @@ -241,7 +240,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray( 10, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError cher2.ndarray( '10', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError @@ -259,7 +258,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray( 'lower', '10', alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError cher2.ndarray( 'lower', true, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError @@ -276,7 +275,6 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray( 'lower', 10, '10', x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError cher2.ndarray( 'lower', 10, true, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError @@ -292,7 +290,7 @@ import cher2 = require( './index' ); { const A = new Complex64Array( 20 ); const y = new Complex64Array( 10 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray( 'lower', 10, alpha, 10, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError cher2.ndarray( 'lower', 10, alpha, '10', 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError @@ -310,7 +308,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray( 'lower', 10, alpha, x, '10', 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError cher2.ndarray( 'lower', 10, alpha, x, true, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError @@ -327,7 +325,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray( 'lower', 10, alpha, x, 1, '10', y, 1, 0, A, 3, 1, 0 ); // $ExpectError cher2.ndarray( 'lower', 10, alpha, x, 1, true, y, 1, 0, A, 3, 1, 0 ); // $ExpectError @@ -343,7 +341,7 @@ import cher2 = require( './index' ); { const x = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray( 'lower', 10, alpha, x, 1, 0, 10, 1, 0, A, 3, 1, 0 ); // $ExpectError cher2.ndarray( 'lower', 10, alpha, x, 1, 0, '10', 1, 0, A, 3, 1, 0 ); // $ExpectError @@ -361,7 +359,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, '10', 0, A, 3, 1, 0 ); // $ExpectError cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, true, 0, A, 3, 1, 0 ); // $ExpectError @@ -378,7 +376,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, '10', A, 3, 1, 0 ); // $ExpectError cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, true, A, 3, 1, 0 ); // $ExpectError @@ -394,7 +392,7 @@ import cher2 = require( './index' ); { const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, 10, 3, 1, 0 ); // $ExpectError cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, '10', 3, 1, 0 ); // $ExpectError @@ -412,7 +410,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, '10', 1, 0 ); // $ExpectError cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, true, 1, 0 ); // $ExpectError @@ -429,7 +427,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, '10', 0 ); // $ExpectError cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, true, 0 ); // $ExpectError @@ -446,7 +444,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, '10' ); // $ExpectError cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, true ); // $ExpectError @@ -463,7 +461,7 @@ import cher2 = require( './index' ); const x = new Complex64Array( 10 ); const y = new Complex64Array( 10 ); const A = new Complex64Array( 20 ); - const alpha = new Complex64( 2.0, 2.0 ); + const alpha = new Complex64( 2.0, 2.0 ); cher2.ndarray(); // $ExpectError cher2.ndarray( 'lower' ); // $ExpectError @@ -476,6 +474,7 @@ import cher2 = require( './index' ); cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1 ); // $ExpectError cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0 ); // $ExpectError cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A ); // $ExpectError - cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 1 ); // $ExpectError - cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 1, 0, 1 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1 ); // $ExpectError + cher2.ndarray( 'lower', 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0, 1 ); // $ExpectError } From 2d56c45bb5155f89055644a2a663ec250d573c87 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 6 Jun 2025 17:36:43 +0530 Subject: [PATCH 08/24] chore: update implementation --- 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cher2/docs/repl.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/cher2/docs/repl.txt index 6a55aa35d48a..0efbd6e6c5c5 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/cher2/docs/repl.txt @@ -1,5 +1,5 @@ -{{alias}}( order, uplo, N, α, x, strideX, y, strideY, LDA ) +{{alias}}( order, uplo, N, α, x, strideX, y, strideY, A, LDA ) Performs the hermitian rank 2 operation `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian @@ -80,7 +80,7 @@ [ 11.0, 0.0, 0.0, 0.0, 27.0, 2.0, 57.0, 0.0 ] -{{alias}}.ndarray( uplo, N, α, x, strideX, offsetX, y, strideY, offsetY, A, sa1, sa2, offsetA ) +{{alias}}.ndarray( uplo, N, α, x, sx, ox, y, sy, oy, A, sa1, sa2, oa ) Performs the hermitian rank 2 operation `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian @@ -105,19 +105,19 @@ x: Complex64Array First input array. - strideX: integer + sx: integer Index increment for `x`. - offsetX: integer + ox: integer Starting index for `x`. y: Complex64Array Second input array. - strideY: integer + sy: integer Index increment for `y`. - offsetY: integer + oy: integer Starting index for `y`. A: Complex64Array @@ -129,7 +129,7 @@ sa2: integer Stride of the second dimension of `A`. - offsetA: integer + oa: integer Starting index for `A`. Returns From 8f0d60c08f128c41ee5069310a21db05ec01f920 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:12:16 +0530 Subject: [PATCH 09/24] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts index d22f61cd1c29..c3734e89dff2 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts @@ -1,4 +1,3 @@ - /* * @license Apache-2.0 * From b192070e3095e7796e9c3ca40e7604a7dd9c19d1 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:22:38 +0530 Subject: [PATCH 10/24] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/cher2/lib/base.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/lib/base.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/base.js index a101b7a9222d..287efeb6111f 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/base.js @@ -22,6 +22,8 @@ var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); var f32 = require( '@stdlib/number/float64/base/to-float32' ); @@ -98,8 +100,8 @@ function cher2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, str var sx; var sy; - realpha = f32( alpha.re ); - imalpha = f32( alpha.im ); + realpha = realf( alpha ); + imalpha = imagf( alpha ); viewX = reinterpret( x, 0 ); viewY = reinterpret( y, 0 ); From 50ca9242a590ebdc383f5f819d582bb385670d41 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:41:18 +0530 Subject: [PATCH 11/24] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../cher2/test/fixtures/row_major_complex_access_pattern.json | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_complex_access_pattern.json index d68d9f1df95d..209cf6f8b433 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_complex_access_pattern.json +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_complex_access_pattern.json @@ -1,4 +1,3 @@ - { "order": "row-major", "uplo": "lower", From bcd2e4083c3a36d385d3034656d9dd514deaef31 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:48:48 +0530 Subject: [PATCH 12/24] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../blas/base/cher2/test/fixtures/row_major_sa1n_sa2n.json | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1n_sa2n.json index 72ace3568795..6940cb5c665f 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1n_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_sa1n_sa2n.json @@ -1,4 +1,3 @@ - { "order": "row-major", "uplo": "lower", From 46e3d05bf9a2fea30cc792921e8245870e2bfd21 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:50:52 +0530 Subject: [PATCH 13/24] c Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../@stdlib/blas/base/cher2/test/fixtures/row_major_u.json | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json index 424006316825..63d5befb4232 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json @@ -1,4 +1,3 @@ - { "order": "row-major", "uplo": "upper", From 34e58f7062666279fd95a905ca155083010c2af3 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:52:33 +0530 Subject: [PATCH 14/24] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../@stdlib/blas/base/cher2/test/fixtures/row_major_u.json | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json index 63d5befb4232..424006316825 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json @@ -1,3 +1,4 @@ + { "order": "row-major", "uplo": "upper", From 963cf28aee794402004c3cf21660e7c0dd34927f Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:52:55 +0530 Subject: [PATCH 15/24] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../@stdlib/blas/base/cher2/test/fixtures/row_major_u.json | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json index 424006316825..63d5befb4232 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/row_major_u.json @@ -1,4 +1,3 @@ - { "order": "row-major", "uplo": "upper", From 54688490c2de1e7772558e6185c510c8602945ef Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Tue, 24 Jun 2025 18:49:20 +0530 Subject: [PATCH 16/24] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/cher2/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js index 1163cafdcfa4..5b3a28323888 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* Perform the hermitian rank 1 operation `A = alpha*x*x**H + A`, where `alpha` is a real scalar, `X` is an `N` element vector and `A` is an `N` by `N` hermitian matrix. +* BLAS level 2 routine to perform the hermitian rank 1 operation `A = alpha*x*x**H + A`, where `alpha` is a real scalar, `X` is an `N` element vector and `A` is an `N` by `N` hermitian matrix. * * @module @stdlib/blas/base/cher2 * From 3b5777216c17e144b58deb479b6938ea498f99a7 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 25 Jun 2025 12:51:01 +0530 Subject: [PATCH 17/24] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/cher2/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/package.json b/lib/node_modules/@stdlib/blas/base/cher2/package.json index f876d16c46a2..4f5fff4ec826 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/package.json +++ b/lib/node_modules/@stdlib/blas/base/cher2/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/cher2", "version": "0.0.0", - "description": "Performs the hermitian rank 2 operation `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian matrix.", + "description": "Perform the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A`, where `α` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian matrix.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", From 16fec00f3d0a87a9df754979c6a656564ea7c145 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Wed, 25 Jun 2025 13:10:30 +0530 Subject: [PATCH 18/24] chore: minor 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: passed - 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/cher2/docs/repl.txt | 4 ++-- .../@stdlib/blas/base/cher2/docs/types/index.d.ts | 6 +++--- lib/node_modules/@stdlib/blas/base/cher2/lib/base.js | 2 +- lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js | 2 +- lib/node_modules/@stdlib/blas/base/cher2/lib/ndarray.js | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/cher2/docs/repl.txt index 0efbd6e6c5c5..853508bc52a2 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/cher2/docs/repl.txt @@ -1,7 +1,7 @@ {{alias}}( order, uplo, N, α, x, strideX, y, strideY, A, LDA ) Performs the hermitian rank 2 operation - `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, + `A = α*x*y**H + conjg( α )*y*x**H + A`, where `α` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian matrix. @@ -82,7 +82,7 @@ {{alias}}.ndarray( uplo, N, α, x, sx, ox, y, sy, oy, A, sa1, sa2, oa ) Performs the hermitian rank 2 operation - `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, + `A = α*x*y**H + conjg( α )*y*x**H + A`, where `α` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian matrix using alternative indexing semantics. diff --git a/lib/node_modules/@stdlib/blas/base/cher2/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/index.d.ts index b42a03e6daca..c5fe9c15590e 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/index.d.ts @@ -29,7 +29,7 @@ import { Layout, MatrixTriangle } from '@stdlib/types/blas'; */ interface Routine { /** - * Performs the hermitian rank 2 operation `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian matrix. + * Performs the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A`, where `α` is a scalar, `x` and `y` are `N` element 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. @@ -58,7 +58,7 @@ interface Routine { ( order: Layout, uplo: MatrixTriangle, N: number, alpha: Complex64, x: Complex64Array, strideX: number, y: Complex64Array, strideY: number, A: Complex64Array, LDA: number ): Complex64Array; /** - * Performs the hermitian rank 2 operation `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian matrix. + * Performs the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A`, where `α` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian matrix. * * @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` @@ -91,7 +91,7 @@ interface Routine { } /** -* Performs the hermitian rank 2 operation `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian matrix. +* Performs the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A`, where `α` is a scalar, `x` and `y` are `N` element 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/cher2/lib/base.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/base.js index 287efeb6111f..f63ead118f5c 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/base.js @@ -30,7 +30,7 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' ); // MAIN // /** -* Performs the hermitian rank 2 operation `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian matrix. +* Performs the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A`, where `α` is a scalar, `x` and `y` are `N` element 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/cher2/lib/cher2.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js index 2aa40a96fdff..79efa9f064bf 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/cher2.js @@ -34,7 +34,7 @@ var ndarray = require( './ndarray.js' ); // MAIN // /** -* Performs the hermitian rank 1 operation `A = alpha*x*x**H + A`, where `alpha` is a real scalar, `X` is an `N` element vector and `A` is an `N` by `N` hermitian matrix. +* Performs the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A`, where `α` is a scalar, `x` and `y` are `N` element 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/cher2/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/ndarray.js index fd85b2d2bc93..dd829975d8ab 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/ndarray.js @@ -30,7 +30,7 @@ var base = require( './base.js' ); // MAIN // /** -* Performs the hermitian rank 2 operation `A = alpha*x*y**H + conjg( alpha )*y*x**H + A`, where `alpha` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian matrix. +* Performs the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A`, where `α` is a scalar, `x` and `y` are `N` element 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. From ff791d49cf7f454a1129e28b95d54a49427f40ae Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 25 Jun 2025 13:16:50 +0530 Subject: [PATCH 19/24] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/cher2/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js b/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js index 5b3a28323888..8f82281f3100 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* BLAS level 2 routine to perform the hermitian rank 1 operation `A = alpha*x*x**H + A`, where `alpha` is a real scalar, `X` is an `N` element vector and `A` is an `N` by `N` hermitian matrix. +* BLAS level 2 routine to perform the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A`, where `α` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian matrix. * * @module @stdlib/blas/base/cher2 * From 44a17276f6fc81613c033fd3eabeb531cd9798ea Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 25 Jun 2025 18:18:06 +0530 Subject: [PATCH 20/24] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts index c3734e89dff2..c4b75e921da3 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts @@ -249,7 +249,7 @@ import cher2 = require( './index' ); cher2.ndarray( undefined, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError cher2.ndarray( [], 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError cher2.ndarray( {}, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError - cher2.ndarray.ndarray( 'row-major', ( x: number ): number => x, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( 'row-major', ( x: number ): number => x, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a number... From b968a88a8e3a631d8aa5efbca7267cefa11dc8d9 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 25 Jun 2025 18:22:01 +0530 Subject: [PATCH 21/24] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts index c4b75e921da3..1e87917ee4f2 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/cher2/docs/types/test.ts @@ -249,7 +249,7 @@ import cher2 = require( './index' ); cher2.ndarray( undefined, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError cher2.ndarray( [], 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError cher2.ndarray( {}, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError - cher2.ndarray( 'row-major', ( x: number ): number => x, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError + cher2.ndarray( ( x: number ): number => x, 10, alpha, x, 1, 0, y, 1, 0, A, 3, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a number... From 0b26ea1aa840773174554d4ec54ec6ed50e040cc Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Thu, 26 Jun 2025 10:54:30 +0530 Subject: [PATCH 22/24] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/cher2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/README.md b/lib/node_modules/@stdlib/blas/base/cher2/README.md index 0f6ddba20cdb..adaa29fa005a 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/README.md +++ b/lib/node_modules/@stdlib/blas/base/cher2/README.md @@ -20,7 +20,7 @@ limitations under the License. # cher2 -> Perform the hermitian rank 1 operation `A = alpha*x*x**H + A`, where `alpha` is a real scalar, `X` is an `N` element vector and `A` is an `N` by `N` hermitian matrix. +> Perform the hermitian rank 1 operation `A = alpha*x*x**H + A`.
From 4bb279729c5aed2e4384ad515824f635a001820b Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Thu, 26 Jun 2025 11:00:23 +0530 Subject: [PATCH 23/24] 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/cher2/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/README.md b/lib/node_modules/@stdlib/blas/base/cher2/README.md index adaa29fa005a..009c0de966f5 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/README.md +++ b/lib/node_modules/@stdlib/blas/base/cher2/README.md @@ -20,7 +20,7 @@ limitations under the License. # cher2 -> Perform the hermitian rank 1 operation `A = alpha*x*x**H + A`. +> Perform the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A`.
@@ -32,7 +32,7 @@ var cher2 = require( '@stdlib/blas/base/cher2' ); #### cher2( order, uplo, N, α, x, strideX, y, strideY, A, LDA ) -Performs the hermitian rank 1 operation `A = alpha*x*x**H + A`, where `alpha` is a real scalar, `X` is an `N` element vector and `A` is an `N` by `N` hermitian matrix. +Performs the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A`, where `α` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian matrix. ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); @@ -102,9 +102,9 @@ cher2( 'row-major', 'lower', x1.length, alpha, x1, 1, y1, 1, A, 2 ); -#### cher2.ndarray( uplo, N, α, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ) +#### cher2.ndarray( uplo, N, α, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA )\ -Performs the hermitian rank 1 operation `A = alpha*x*x**H + A`, where `alpha` is a real scalar, `X` is an `N` element vector and `A` is an `N` by `N` hermitian matrix using alternative indexing semantics. +Performs the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A`, using alternative indexing semantics and where `α` is a scalar, `x` and `y` are `N` element vectors and `A` is an `N` by `N` hermitian matrix. ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); From 61fb78dbfa0495ceaa3a36dc5df984c45c996d05 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Thu, 26 Jun 2025 11:22:49 +0530 Subject: [PATCH 24/24] 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: 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/cher2/test/test.cher2.js | 8 ++++---- .../@stdlib/blas/base/cher2/test/test.ndarray.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js b/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js index 78f305a45bb8..3b46581c5d50 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js @@ -210,7 +210,7 @@ tape( 'the function throws an error if provided an invalid tenth argument', func } }); -tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (row-major, lower)', function test( t ) { +tape( 'the function performs hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A` (row-major, lower)', function test( t ) { var expected; var alpha; var data; @@ -235,7 +235,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( t.end(); }); -tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (column-major, lower)', function test( t ) { +tape( 'the function performs hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A` (column-major, lower)', function test( t ) { var expected; var alpha; var data; @@ -260,7 +260,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( t.end(); }); -tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (row-major, upper)', function test( t ) { +tape( 'the function performs hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A` (row-major, upper)', function test( t ) { var expected; var alpha; var data; @@ -285,7 +285,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` ( t.end(); }); -tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (column-major, upper)', function test( t ) { +tape( 'the function performs hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A` (column-major, upper)', function test( t ) { var expected; var alpha; var data; diff --git a/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js index 4f2005b32202..39a5dee79f37 100644 --- a/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/cher2/test/test.ndarray.js @@ -218,7 +218,7 @@ tape( 'the function throws an error if provided an invalid twelfth argument', fu } }); -tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, lower)', function test( t ) { +tape( 'the function performs the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A` (row-major, lower)', function test( t ) { var expected; var alpha; var data; @@ -243,7 +243,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( t.end(); }); -tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (column-major, lower)', function test( t ) { +tape( 'the function performs the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A` (column-major, lower)', function test( t ) { var expected; var alpha; var data; @@ -268,7 +268,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( t.end(); }); -tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (column-major, upper)', function test( t ) { +tape( 'the function performs the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A` (column-major, upper)', function test( t ) { var expected; var alpha; var data; @@ -293,7 +293,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( t.end(); }); -tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, upper)', function test( t ) { +tape( 'the function performs the hermitian rank 2 operation `A = α*x*y**H + conjg( α )*y*x**H + A` (row-major, upper)', function test( t ) { var expected; var alpha; var data;