From d4a71b5168f5a9dbb2347955bd3dff03a45fb085 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 30 May 2025 13:37:16 +0530 Subject: [PATCH 01/17] feat: add blas/base/zher --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/zher/README.md | 269 +++++++ .../blas/base/zher/benchmark/benchmark.js | 111 +++ .../base/zher/benchmark/benchmark.ndarray.js | 111 +++ .../@stdlib/blas/base/zher/docs/repl.txt | 124 ++++ .../blas/base/zher/docs/types/index.d.ts | 113 +++ .../@stdlib/blas/base/zher/docs/types/test.ts | 346 +++++++++ .../@stdlib/blas/base/zher/examples/index.js | 45 ++ .../@stdlib/blas/base/zher/lib/base.js | 137 ++++ .../@stdlib/blas/base/zher/lib/index.js | 71 ++ .../@stdlib/blas/base/zher/lib/main.js | 36 + .../@stdlib/blas/base/zher/lib/ndarray.js | 85 +++ .../@stdlib/blas/base/zher/lib/zher.js | 98 +++ .../@stdlib/blas/base/zher/package.json | 78 ++ .../column_major_complex_access_pattern.json | 20 + .../zher/test/fixtures/column_major_l.json | 20 + .../zher/test/fixtures/column_major_oa.json | 21 + .../test/fixtures/column_major_sa1_sa2.json | 20 + .../test/fixtures/column_major_sa1_sa2n.json | 20 + .../test/fixtures/column_major_sa1n_sa2.json | 20 + .../test/fixtures/column_major_sa1n_sa2n.json | 20 + .../zher/test/fixtures/column_major_u.json | 20 + .../zher/test/fixtures/column_major_xn.json | 20 + .../zher/test/fixtures/column_major_xp.json | 20 + .../row_major_complex_access_pattern.json | 20 + .../base/zher/test/fixtures/row_major_l.json | 20 + .../base/zher/test/fixtures/row_major_oa.json | 20 + .../zher/test/fixtures/row_major_sa1_sa2.json | 21 + .../test/fixtures/row_major_sa1_sa2n.json | 20 + .../test/fixtures/row_major_sa1n_sa2.json | 20 + .../test/fixtures/row_major_sa1n_sa2n.json | 20 + .../base/zher/test/fixtures/row_major_u.json | 20 + .../base/zher/test/fixtures/row_major_xn.json | 20 + .../base/zher/test/fixtures/row_major_xp.json | 20 + .../@stdlib/blas/base/zher/test/test.js | 82 +++ .../blas/base/zher/test/test.ndarray.js | 674 ++++++++++++++++++ .../@stdlib/blas/base/zher/test/test.zher.js | 469 ++++++++++++ 36 files changed, 3251 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/zher/README.md create mode 100644 lib/node_modules/@stdlib/blas/base/zher/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/base/zher/benchmark/benchmark.ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/zher/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/base/zher/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/blas/base/zher/examples/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/zher/lib/base.js create mode 100644 lib/node_modules/@stdlib/blas/base/zher/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/zher/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/base/zher/lib/ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/zher/lib/zher.js create mode 100644 lib/node_modules/@stdlib/blas/base/zher/package.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_l.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_xn.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_xp.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_l.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_xn.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_xp.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/test.js create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/test.ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/test.zher.js diff --git a/lib/node_modules/@stdlib/blas/base/zher/README.md b/lib/node_modules/@stdlib/blas/base/zher/README.md new file mode 100644 index 000000000000..f3ed6d7992c3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/README.md @@ -0,0 +1,269 @@ + + +# zher + +> Perform the hermitian rank 1 operation `A = α*x*x**H + A`, where `α` is a real scalar, `X` is an `N` element vector and `A` is an `N` by `N` hermitian matrix. + +
+ +## Usage + +```javascript +var zher = require( '@stdlib/blas/base/zher' ); +``` + +#### zher( order, uplo, N, α, x, strideX, A, LDA ) + +Performs the hermitian rank 1 operation `A = α*x*x**H + A`, where `α` is a real scalar, `X` is an `N` element vector and `A` is an `N` by `N` hermitian matrix. + +```javascript +var Complex128Array = require( '@stdlib/array/complex128' ); + +var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); + +zher( 'row-major', 'lower', x.length, 2.0, x, 1, A, 2 ); +// A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.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**: input vector [`Complex128Array`][@stdlib/array/complex128]. +- **strideX**: index increment for `x`. +- **A**: input matrix stored in linear memory as [`Complex128Array`][@stdlib/array/complex128]. +- **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 Complex128Array = require( '@stdlib/array/complex128' ); + +var x = new Complex128Array( [ 3.0, 4.0, 1.0, 2.0 ] ); +var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); + +zher( 'row-major', 'lower', x.length, 2.0, x, -1, A, 2 ); +// A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.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 Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); + +// Initial array: +var x0 = new Complex128Array( [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0 ] ); + +// Define a input matrix: +var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); + +// Create an offset view: +var x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +zher( 'row-major', 'lower', x1.length, 2.0, x1, 1, A, 2 ); +// A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.0, 0.0 ] +``` + +#### zher.ndarray( uplo, N, α, x, strideX, offsetX, A, strideA1, strideA2, offsetA ) + +Performs the hermitian rank 1 operation `A = α*x*x**H + A`, where `α` 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 Complex128Array = require( '@stdlib/array/complex128' ); + +var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); + +zher.ndarray( 'lower', x.length, 2.0, x, 1, 0, A, 2, 1, 0 ); +// A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.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`. +- **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 Complex128Array = require( '@stdlib/array/complex128' ); + +var x = new Complex128Array( [ 3.0, 4.0, 1.0, 2.0 ] ); +var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); + +zher.ndarray( 'lower', x.length, 2.0, x, -1, 1, A, 2, 1, 0 ); +// A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.0, 0.0 ] +``` + +
+ + + +
+ +## Notes + +- If `N = 0` or `α = 0.0`, both functions return `x` unchanged. +- `zher()` corresponds to the [BLAS][blas] level 2 function [`zher`][zher]. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var logEach = require( '@stdlib/console/log-each' ); +var zher = require( '@stdlib/blas/base/zher' ); + +function rand() { + return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); +} + +var x = filledarrayBy( 3, 'complex128', rand ); +console.log( x.get( 0 ).toString() ); + +var A = filledarrayBy( 9, 'complex128', rand ); +console.log( A.get( 0 ).toString() ); + +zher( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); + +// Print the results: +logEach( '(%s)', A ); + +zher.ndarray( 'upper', 3, 1.0, x, 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/zher/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/zher/benchmark/benchmark.js new file mode 100644 index 000000000000..adce31ce47d5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/benchmark/benchmark.js @@ -0,0 +1,111 @@ +/** +* @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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var pkg = require( './../package.json' ).name; +var zher = require( './../lib/zher.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var Abuf; + var x; + var A; + + xbuf = uniform( len*2, -100.0, 100.0, options ); + x = new Complex128Array( xbuf.buffer ); + Abuf = uniform( (len*len)*2, -100.0, 100.0, options ); + A = new Complex128Array( Abuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + zher( 'row-major', 'lower', len, 2.0, x, 1, A, len ); + if ( isnan( Abuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( 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/zher/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/zher/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..a078e187eeb1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/benchmark/benchmark.ndarray.js @@ -0,0 +1,111 @@ +/** +* @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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var pkg = require( './../package.json' ).name; +var zher = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var xbuf; + var Abuf; + var x; + var A; + + xbuf = uniform( len*2, -100.0, 100.0, options ); + x = new Complex128Array( xbuf.buffer ); + Abuf = uniform( (len*len)*2, -100.0, 100.0, options ); + A = new Complex128Array( Abuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + zher( 'lower', len, 2.0, x, 1, 0, A, len, 1, 0 ); + if ( isnan( Abuf[ i%(len*2) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( 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/zher/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/zher/docs/repl.txt new file mode 100644 index 000000000000..1eb84e3154d7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/docs/repl.txt @@ -0,0 +1,124 @@ + +{{alias}}( order, uplo, N, α, x, strideX, A, LDA ) + Performs the hermitian rank 1 operation `A = α*x*x**H + A`, where + `α` is a real scalar, `X` is an `N` element vector 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: Complex128Array + Input array. + + strideX: integer + Index increment for `x`. + + A: Complex128Array + Input matrix. + + LDA: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + Returns + ------- + A: Complex128Array + Input matrix. + + Examples + -------- + // Standard usage: + > var x = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); + > {{alias}}( 'row-major', 'lower', 2, 2.0, x, 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/complex128}}( [ 3.0, 4.0, 1.0, 2.0 ] ); + > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); + > {{alias}}( 'row-major', 'lower', 2, 2.0, x, -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/complex128}}( [ 0.0, 0.0, 3.0, 4.0, 1.0, 2.0 ] ); + > var x1 = new {{alias:@stdlib/array/complex128}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); + > {{alias}}( 'row-major', 'lower', 2, 2.0, x, -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, A, sa1, sa2, offsetA ) + Performs the hermitian rank 1 operation `A = α*x*x**H + A`, where + `α` is a real scalar, `X` is an `N` element vector 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: Complex128Array + Input array. + + strideX: integer + Index increment for `x`. + + offsetX: integer + Starting index for `X`. + + A: Complex128Array + 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: Complex128Array + Input matrix. + + Examples + -------- + > var x = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); + > {{alias}}.ndarray( 'lower', 2, 2.0, x, 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/zher/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts new file mode 100644 index 000000000000..e1d7ee903dc2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts @@ -0,0 +1,113 @@ +/* +* @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 { Complex128Array } from '@stdlib/types/array'; +import { Layout, MatrixTriangle } from '@stdlib/types/blas'; + +/** +* Interface describing `zher`. +*/ +interface Routine { + /** + * 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 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 - input array + * @param strideX - `x` 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 Complex128Array = require( '@stdlib/array/complex128' ); + * + * var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + * var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); + * + * zher( 'row-major', 'lower', x.length, 2.0, x, 1, A, 2 ); + * // A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.0, 0.0 ] + */ + ( order: Layout, uplo: MatrixTriangle, N: number, alpha: number, x: Complex128Array, strideX: number, A: Complex128Array, LDA: number ): Complex128Array; + + /** + * 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 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 - input array + * @param strideX - `x` stride length + * @param offsetX - starting `x` 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 Complex128Array = require( '@stdlib/array/complex128' ); + * + * var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + * var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); + * + * zher( 'lower', x.length, 2.0, x, 1, 0, A, 2, 1, 0 ); + * // A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.0, 0.0 ] + */ + ndarray( uplo: MatrixTriangle, N: number, alpha: number, x: Complex128Array, strideX: number, offsetX: number, A: Complex128Array, strideA1: number, strideA2: number, offsetA: number ): Complex128Array; +} + +/** +* Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. +* +* @param N - number of indexed elements +* @param ca - scalar constant +* @param cx - input array +* @param strideX - `cx` stride length +* @returns input array +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +* var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +* +* zher( 'row-major', 'lower', x.length, 2.0, x, 1, A, 2 ); +* // A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.0, 0.0 ] +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +* var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +* +* zher( 'lower', x.length, 2.0, x, 1, 0, A, 2, 1, 0 ); +* // A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.0, 0.0 ] +*/ +declare var zher: Routine; + + +// EXPORTS // + +export = zher; diff --git a/lib/node_modules/@stdlib/blas/base/zher/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/zher/docs/types/test.ts new file mode 100644 index 000000000000..2ed0a4abcbc8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/docs/types/test.ts @@ -0,0 +1,346 @@ +/* +* @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 Complex128Array = require( '@stdlib/array/complex128' ); +import zher = require( './index' ); + + +// TESTS // + +// The function returns a Complex128Array... +{ + const x = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher( 'row-major', 'lower', 10, 1.0, x, 1, A, 3 ); // $ExpectType Complex128Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher( 10, 'lower', 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( '10', 'lower', 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( true, 'lower', 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( false, 'lower', 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( null, 'lower', 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( undefined, 'lower', 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( [], 'lower', 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( {}, 'lower', 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( ( x: number ): number => x, 'lower', 10, 1.0, x, 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 Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher( 'row-major', 10, 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', '10', 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', true, 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', false, 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', null, 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', undefined, 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', [], 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', {}, 10, 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', ( x: number ): number => x, 10, 1.0, x, 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 Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher( 'row-major', 'lower', '10', 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', true, 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', false, 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', null, 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', undefined, 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', [], 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', {}, 1.0, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', ( x: number ): number => x, 1.0, x, 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 Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher( 'row-major', 'lower', 10, '10', x, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, true, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, false, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, null, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, undefined, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, [], x, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, {}, x, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, ( x: number ): number => x, x, 1, A, 3 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a Complex128Array... +{ + const A = new Complex128Array( 20 ); + + zher( 'row-major', 'lower', 10, 1.0, 10, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, '10', 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, true, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, false, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, null, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, undefined, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, [], 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, {}, 1, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, ( x: number ): number => x, 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 Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher( 'row-major', 'lower', 10, 1.0, x, '10', A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, true, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, false, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, null, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, undefined, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, [], A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, {}, A, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, ( x: number ): number => x, A, 3 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a Complex128Array... +{ + const x = new Complex128Array( 10 ); + + zher( 'row-major', 'lower', 10, 1.0, x, 1, 10, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, '10', 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, true, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, false, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, null, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, undefined, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, [], 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, {}, 3 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, ( x: number ): number => x, 3 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eighth argument which is not a number... +{ + const x = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher( 'row-major', 'lower', 10, 1.0, x, 1, A, '10' ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, A, true ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, A, false ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, A, null ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, A, undefined ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, A, [] ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, A, {} ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 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 Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher(); // $ExpectError + zher( 'row-major' ); // $ExpectError + zher( 'row-major', 'lower' ); // $ExpectError + zher( 'row-major', 'lower', 10 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1 ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, A ); // $ExpectError + zher( 'row-major', 'lower', 10, 1.0, x, 1, A, 3, 1 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Complex128Array... +{ + const x = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectType Complex128Array +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const x = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher.ndarray( 10, 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( '10', 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( true, 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( false, 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( null, 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( undefined, 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( [], 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( {}, 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray.ndarray( 'row-major', ( x: number ): number => x, 10, 1.0, x, 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 Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher.ndarray( 'lower', '10', 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', true, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', false, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', null, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', undefined, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', [], 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', {}, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', ( x: number ): number => x, 1.0, x, 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 Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher.ndarray( 'lower', 10, '10', x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, true, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, false, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, null, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, undefined, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, [], x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, {}, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, ( x: number ): number => x, x, 1, 0, A, 3, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a Complex128Array... +{ + const A = new Complex128Array( 20 ); + + zher.ndarray( 'lower', 10, 1.0, 10, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, '10', 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, true, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, false, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, null, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, undefined, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, [], 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, {}, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, ( x: number ): number => x, 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 Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher.ndarray( 'lower', 10, 1.0, x, '10', 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, true, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, false, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, null, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, undefined, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, [], 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, {}, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, ( x: number ): number => x, 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 Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher.ndarray( 'lower', 10, 1.0, x, 1, '10', A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, true, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, false, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, null, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, undefined, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, [], A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, {}, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, ( x: number ): number => x, A, 3, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a Complex128Array... +{ + const x = new Complex128Array( 10 ); + + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, 10, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, '10', 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, true, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, false, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, null, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, undefined, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, [], 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, {}, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, ( x: number ): number => x, 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 Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, '10', 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, true, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, false, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, null, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, undefined, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, [], 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, {}, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const x = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, '10', 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, true, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, false, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, null, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, undefined, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, [], 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, {}, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a number... +{ + const x = new Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, 1, '10' ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, 1, true ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, 1, false ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, 1, null ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, 1, undefined ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, 1, [] ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, 1, {} ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 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 Complex128Array( 10 ); + const A = new Complex128Array( 20 ); + + zher.ndarray(); // $ExpectError + zher.ndarray( 'lower' ); // $ExpectError + zher.ndarray( 'lower', 10 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, 1 ); // $ExpectError + zher.ndarray( 'lower', 10, 1.0, x, 1, 0, A, 3, 1, 0, 1 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/zher/examples/index.js b/lib/node_modules/@stdlib/blas/base/zher/examples/index.js new file mode 100644 index 000000000000..922fbc77d77f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/examples/index.js @@ -0,0 +1,45 @@ +/** +* @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 Complex128 = require( '@stdlib/complex/float64/ctor' ); +var logEach = require( '@stdlib/console/log-each' ); +var zher = require( './../lib' ); + +function rand() { + return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); +} + +var x = filledarrayBy( 3, 'complex128', rand ); +console.log( x.get( 0 ).toString() ); + +var A = filledarrayBy( 9, 'complex128', rand ); +console.log( A.get( 0 ).toString() ); + +zher( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); + +// Print the results: +logEach( '(%s)', A ); + +zher.ndarray( 'upper', 3, 1.0, x, 1, 0, A, 3, 1, 0 ); + +// Print the results: +logEach( '(%s)', A ); diff --git a/lib/node_modules/@stdlib/blas/base/zher/lib/base.js b/lib/node_modules/@stdlib/blas/base/zher/lib/base.js new file mode 100644 index 000000000000..27663f813057 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/lib/base.js @@ -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. +*/ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); + + +// 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. +* +* @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 {number} alpha - scalar +* @param {Complex128Array} x - input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {Complex128Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @returns {Complex128Array} `A` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +* var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +* +* zher( 'lower', x.length, 2.0, x, 1, 0, A, 2, 1, 0 ); +* // A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.0, 0.0 ] +*/ +function zher( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ) { + var viewX; + var viewA; + var isrm; + var ix1; + var ix0; + var re0; + var re1; + var im0; + var im1; + var idx; + var sa0; + var sa1; + var i1; + var i0; + var ix; + var ia; + var re; + var im; + var sx; + + viewX = reinterpret( x, 0 ); + viewA = reinterpret( A, 0 ); + + isrm = isRowMajor( [ strideA1, strideA2 ] ); + if ( isrm ) { + sa0 = strideA2 * 2; // Stride for columns (inner dimension) + sa1 = strideA1 * 2; // Stride for rows (outer dimension) + } else { + sa0 = strideA1 * 2; // Stride for rows (inner dimension) + sa1 = strideA2 * 2; // Stride for columns (outer dimension) + } + + ix = offsetX * 2; + ia = offsetA * 2; + sx = strideX * 2; + + if ( ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) ) { + for ( i1 = 0; i1 < N; i1++ ) { + ix1 = ix + ( i1 * sx ); + re0 = viewX[ ix1 ]; + im0 = viewX[ ix1 + 1 ]; + for ( i0 = i1; i0 < N; i0++ ) { + ix0 = ix + ( i0 * sx ); + re1 = viewX[ ix0 ]; + im1 = viewX[ ix0 + 1 ]; + re = alpha * ( ( re0 * re1 ) + ( im0 * im1 ) ); + im = alpha * ( ( im0 * re1 ) - ( re0 * im1 ) ); + idx = ia + ( i0 * sa0 ) + ( i1 * sa1 ); + viewA[ idx ] += re; + 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 ); + re0 = viewX[ ix1 ]; + im0 = viewX[ ix1 + 1 ]; + for ( i0 = 0; i0 <= i1; i0++ ) { + ix0 = ix + ( i0 * sx ); + re1 = viewX[ ix0 ]; + im1 = viewX[ ix0 + 1 ]; + re = alpha * ( ( re0 * re1 ) + ( im0 * im1 ) ); + im = alpha * ( ( im0 * re1 ) - ( re0 * im1 ) ); + idx = ia + ( i0 * sa0 ) + ( i1 * sa1 ); + viewA[ idx ] += re; + viewA[ idx + 1 ] += im; + if ( i0 === i1 ) { + viewA[ idx + 1 ] = 0.0; + } + } + } + return A; +} + + +// EXPORTS // + +module.exports = zher; diff --git a/lib/node_modules/@stdlib/blas/base/zher/lib/index.js b/lib/node_modules/@stdlib/blas/base/zher/lib/index.js new file mode 100644 index 000000000000..1dee9640c7ff --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/lib/index.js @@ -0,0 +1,71 @@ + +/** +* @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/zher +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var zher = require( '@stdlib/blas/base/zher' ); +* +* var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +* var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +* +* zher( 'row-major', 'lower', x.length, 2.0, x, 1 A, 2 ); +* // A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.0, 0.0 ] +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var zher = require( '@stdlib/blas/base/zher' ); +* +* var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +* var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +* +* zher.ndarray( 'lower', x.length, 2.0, x, 1, 0, A, 2, 1, 0 ); +* // A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.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 zher; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + zher = main; +} else { + zher = tmp; +} + + +// EXPORTS // + +module.exports = zher; + +// exports: { "ndarray": "zher.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/zher/lib/main.js b/lib/node_modules/@stdlib/blas/base/zher/lib/main.js new file mode 100644 index 000000000000..145d992e0803 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/lib/main.js @@ -0,0 +1,36 @@ + +/** +* @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 zher = require( './zher.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( zher, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = zher; diff --git a/lib/node_modules/@stdlib/blas/base/zher/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/zher/lib/ndarray.js new file mode 100644 index 000000000000..a3d065a06320 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/lib/ndarray.js @@ -0,0 +1,85 @@ +/** +* @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 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} 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 {number} alpha - scalar +* @param {Complex128Array} x - input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {Complex128Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @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} ninth argument must be non-zero +* @returns {Complex128Array} `A` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +* var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +* +* zher( 'lower', x.length, 2.0, x, 1, 0, A, 2, 1, 0 ); +* // A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.0, 0.0 ] +*/ +function zher( uplo, N, alpha, x, strideX, offsetX, 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 ( strideA1 === 0 ) { + throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideA1 ) ); + } + if ( strideA2 === 0 ) { + throw new RangeError( format( 'invalid argument. Ninth argument must be non-zero. Value: `%d`.', strideA2 ) ); + } + + if ( N === 0 || alpha === 0.0 ) { + return A; + } + return base( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ); +} + + +// EXPORTS // + +module.exports = zher; diff --git a/lib/node_modules/@stdlib/blas/base/zher/lib/zher.js b/lib/node_modules/@stdlib/blas/base/zher/lib/zher.js new file mode 100644 index 000000000000..31810fd70674 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/lib/zher.js @@ -0,0 +1,98 @@ +/** +* @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 {number} alpha - scalar constant +* @param {Complex128Array} x - input array +* @param {integer} strideX - `x` stride length +* @param {Complex128Array} 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 {Complex128Array} `A` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +* var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); +* +* zher( 'row-major', 'lower', x.length, 2.0, x, 1, A, 2 ); +* // A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.0, 0.0 ] +*/ +function zher( order, uplo, N, alpha, x, strideX, A, LDA ) { + var sa1; + var sa2; + var ox; + + 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 ( LDA < max( 1, N ) ) { + throw new RangeError( format( 'invalid argument. Eighth 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 ); + return ndarray( uplo, N, alpha, x, strideX, ox, A, sa1, sa2, 0 ); +} + + +// EXPORTS // + +module.exports = zher; diff --git a/lib/node_modules/@stdlib/blas/base/zher/package.json b/lib/node_modules/@stdlib/blas/base/zher/package.json new file mode 100644 index 000000000000..6d32ce8a22f0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/package.json @@ -0,0 +1,78 @@ +{ + "name": "@stdlib/blas/base/zher", + "version": "0.0.0", + "description": "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.", + "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 1", + "linear", + "algebra", + "subroutines", + "zher", + "hermitian", + "vector", + "typed", + "array", + "ndarray", + "complex", + "complex128", + "float", + "float64", + "single", + "float64array" + ], + "__stdlib__": { + "wasm": false + } +} diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 000000000000..ed45f41cde75 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_complex_access_pattern.json @@ -0,0 +1,20 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 2.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, + "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/zher/test/fixtures/column_major_l.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_l.json new file mode 100644 index 000000000000..216fac5f9044 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_l.json @@ -0,0 +1,20 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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/zher/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_oa.json new file mode 100644 index 000000000000..1ce2f550a537 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_oa.json @@ -0,0 +1,21 @@ + +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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/zher/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1_sa2.json new file mode 100644 index 000000000000..78597ba3bb6f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1_sa2.json @@ -0,0 +1,20 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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, 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": 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/zher/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1_sa2n.json new file mode 100644 index 000000000000..ac6fd6284063 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1_sa2n.json @@ -0,0 +1,20 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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, 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": 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/zher/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1n_sa2.json new file mode 100644 index 000000000000..c7fc5ec7e816 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1n_sa2.json @@ -0,0 +1,20 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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, 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": 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/zher/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1n_sa2n.json new file mode 100644 index 000000000000..717f51ff123c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1n_sa2n.json @@ -0,0 +1,20 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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, 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": 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/zher/test/fixtures/column_major_u.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_u.json new file mode 100644 index 000000000000..c3d2c83dc35c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_u.json @@ -0,0 +1,20 @@ +{ + "order": "column-major", + "uplo": "upper", + "N": 3, + "alpha": 2.0, + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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": 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/zher/test/fixtures/column_major_xn.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_xn.json new file mode 100644 index 000000000000..b3718c26ddec --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_xn.json @@ -0,0 +1,20 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 5.0, 6.0, 3.0, 4.0, 1.0, 2.0 ], + "strideX": -1, + "offsetX": 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, 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/zher/test/fixtures/column_major_xp.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_xp.json new file mode 100644 index 000000000000..264021dbd4f9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_xp.json @@ -0,0 +1,20 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 2.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, + "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/zher/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 000000000000..c7bcbc0ead07 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_complex_access_pattern.json @@ -0,0 +1,20 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 2.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, + "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/zher/test/fixtures/row_major_l.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_l.json new file mode 100644 index 000000000000..55ca7b8ffe76 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_l.json @@ -0,0 +1,20 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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/zher/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_oa.json new file mode 100644 index 000000000000..169bbf183bfa --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_oa.json @@ -0,0 +1,20 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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/zher/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_sa1_sa2.json new file mode 100644 index 000000000000..8c41fa00bb77 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_sa1_sa2.json @@ -0,0 +1,21 @@ + +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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/zher/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_sa1_sa2n.json new file mode 100644 index 000000000000..63987f52d97e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_sa1_sa2n.json @@ -0,0 +1,20 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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/zher/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_sa1n_sa2.json new file mode 100644 index 000000000000..ed0a420fc571 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_sa1n_sa2.json @@ -0,0 +1,20 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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/zher/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_sa1n_sa2n.json new file mode 100644 index 000000000000..68caaea83163 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_sa1n_sa2n.json @@ -0,0 +1,20 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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/zher/test/fixtures/row_major_u.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_u.json new file mode 100644 index 000000000000..a6da60d5d443 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_u.json @@ -0,0 +1,20 @@ +{ + "order": "row-major", + "uplo": "upper", + "N": 3, + "alpha": 2.0, + "x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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/zher/test/fixtures/row_major_xn.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_xn.json new file mode 100644 index 000000000000..f1fdc963792d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_xn.json @@ -0,0 +1,20 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 5.0, 6.0, 3.0, 4.0, 1.0, 2.0 ], + "strideX": -1, + "offsetX": 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/zher/test/fixtures/row_major_xp.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_xp.json new file mode 100644 index 000000000000..6d0c8091f69c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_xp.json @@ -0,0 +1,20 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 2.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, + "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/zher/test/test.js b/lib/node_modules/@stdlib/blas/base/zher/test/test.js new file mode 100644 index 000000000000..71661a70f701 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/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 zher = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': isBrowser +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof zher, '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 zher.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 zher = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( zher, 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 zher; + var main; + + main = require( './../lib/zher.js' ); + + zher = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( zher, main, 'returns JavaScript implementation' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/zher/test/test.ndarray.js new file mode 100644 index 000000000000..7b4f6ff53f3b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/test.ndarray.js @@ -0,0 +1,674 @@ +/** +* @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 isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var zher = 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 roa = require( './fixtures/row_major_oa.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 coa = require( './fixtures/column_major_oa.json' ); +var csa1sa2 = require( './fixtures/column_major_sa1_sa2.json' ); +var csa1nsa2 = require( './fixtures/column_major_sa1n_sa2.json' ); +var csa1sa2n = require( './fixtures/column_major_sa1_sa2n.json' ); +var csa1nsa2n = require( './fixtures/column_major_sa1n_sa2n.json' ); +var 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 zher, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 10', function test( t ) { + t.strictEqual( zher.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 = 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() { + zher( value, data.N, data.alpha, new Complex128Array( data.x ), data.strideX, data.offsetX, new Complex128Array( 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() { + zher( data.uplo, value, data.alpha, new Complex128Array( data.x ), data.strideX, data.offsetX, new Complex128Array( 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() { + zher( data.uplo, data.N, data.alpha, new Complex128Array( data.x ), value, data.offsetX, new Complex128Array( 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() { + zher( data.uplo, data.N, data.alpha, new Complex128Array( data.x ), data.strideX, data.offsetX, new Complex128Array( data.A ), value, data.strideA2, data.offsetA ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid ninth 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() { + zher( data.uplo, data.N, data.alpha, new Complex128Array( data.x ), data.strideX, data.offsetX, new Complex128Array( 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; + + data = rl; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = cl; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = cu; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = ru; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = ru; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( 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; + + data = rl; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A ); + + out = zher( data.uplo, 0, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + out = zher( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( 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; + + data = cl; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A ); + + out = zher( data.uplo, 0, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + out = zher( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( 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; + + data = rsa1sa2; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1sa2; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1nsa2; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1nsa2; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1sa2n; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1sa2n; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = rsa1nsa2n; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = csa1nsa2n; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = roa; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = coa; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = rxp; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = cxp; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rxn; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cxn; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = rcap; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = ccap; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/test.zher.js b/lib/node_modules/@stdlib/blas/base/zher/test/test.zher.js new file mode 100644 index 000000000000..19f883864a44 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/test.zher.js @@ -0,0 +1,469 @@ +/** +* @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 isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var zher = require( './../lib/zher.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 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' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof zher, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 8', function test( t ) { + t.strictEqual( zher.length, 8, '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() { + zher( value, data.uplo, data.N, data.alpha, new Complex128Array( data.x ), data.strideX, new Complex128Array( 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() { + zher( data.order, value, data.N, data.alpha, new Complex128Array( data.x ), data.strideX, new Complex128Array( 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() { + zher( data.order, data.uplo, value, data.alpha, new Complex128Array( data.x ), data.strideX, new Complex128Array( 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() { + zher( data.order, data.uplo, data.N, data.alpha, new Complex128Array( data.x ), value, new Complex128Array( 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 = [ + 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() { + zher( data.order, data.uplo, data.N, data.alpha, new Complex128Array( data.x ), data.strideX, new Complex128Array( 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; + + data = rl; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.LDA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = cl; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.LDA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = ru; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.LDA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = cu; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.LDA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = rl; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + out = zher( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.LDA ); + t.strictEqual( isSameComplex128Array( 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; + + data = cl; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + out = zher( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.LDA ); + t.strictEqual( isSameComplex128Array( 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; + + data = rl; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A ); + + out = zher( data.order, data.uplo, 0, data.alpha, x, data.strideX, a, data.LDA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = cl; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A ); + + out = zher( data.order, data.uplo, 0, data.alpha, x, data.strideX, a, data.LDA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = rl; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A ); + + out = zher( data.order, data.uplo, data.N, 0.0, x, data.strideX, a, data.LDA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = cl; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A ); + + out = zher( data.order, data.uplo, data.N, 0.0, x, data.strideX, a, data.LDA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = rxp; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.LDA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = cxp; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.LDA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = rxn; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.LDA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = cxn; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.LDA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); From 3691a88eb44a7e9e7ae91aec66a8c7d22ca14f8a Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Wed, 4 Jun 2025 10:39:32 +0530 Subject: [PATCH 02/17] test: add fixtures --- 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 --- --- .../zher/test/fixtures/column_major_ox.json | 20 +++++++++ .../base/zher/test/fixtures/row_major_ox.json | 20 +++++++++ .../blas/base/zher/test/test.ndarray.js | 44 +++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_ox.json create mode 100644 lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_ox.json diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_ox.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_ox.json new file mode 100644 index 000000000000..e2bddb897053 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_ox.json @@ -0,0 +1,20 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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/zher/test/fixtures/row_major_ox.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_ox.json new file mode 100644 index 000000000000..f854a1ed993d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/row_major_ox.json @@ -0,0 +1,20 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 2.0, + "x": [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + "strideX": 1, + "offsetX": 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/zher/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/zher/test/test.ndarray.js index 7b4f6ff53f3b..07864945107e 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/zher/test/test.ndarray.js @@ -35,6 +35,7 @@ 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 roa = require( './fixtures/row_major_oa.json' ); +var rox = require( './fixtures/row_major_ox.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' ); @@ -46,6 +47,7 @@ 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 coa = require( './fixtures/column_major_oa.json' ); +var cox = require( './fixtures/column_major_ox.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' ); @@ -631,6 +633,48 @@ 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 ) { + var expected; + var data; + var out; + var a; + var x; + + data = rox; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( 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; + + data = cox; + + a = new Complex128Array( data.A ); + x = new Complex128Array( data.x ); + + expected = new Complex128Array( data.A_out ); + + out = zher( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( isSameComplex128Array( out, a ), true, 'returns expected value' ); + t.deepEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + tape( 'the function supports complex access patterns (row-major)', function test( t ) { var expected; var data; From 040dafee6d058be0fd31df576cea0f8fa84c7f1b Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Wed, 4 Jun 2025 10:52:21 +0530 Subject: [PATCH 03/17] 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: passed - 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/zher/README.md | 6 +++--- lib/node_modules/@stdlib/blas/base/zher/docs/repl.txt | 6 +++--- .../@stdlib/blas/base/zher/docs/types/index.d.ts | 4 ++-- lib/node_modules/@stdlib/blas/base/zher/lib/base.js | 2 +- lib/node_modules/@stdlib/blas/base/zher/lib/index.js | 2 +- lib/node_modules/@stdlib/blas/base/zher/lib/ndarray.js | 2 +- lib/node_modules/@stdlib/blas/base/zher/lib/zher.js | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/README.md b/lib/node_modules/@stdlib/blas/base/zher/README.md index f3ed6d7992c3..9e9cac3a86aa 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/README.md +++ b/lib/node_modules/@stdlib/blas/base/zher/README.md @@ -20,7 +20,7 @@ limitations under the License. # zher -> Perform the hermitian rank 1 operation `A = α*x*x**H + A`, where `α` 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 = α*x*x**H + A`, where `α` is a real scalar, `x` is an `N` element vector and `A` is an `N` by `N` hermitian matrix.
@@ -32,7 +32,7 @@ var zher = require( '@stdlib/blas/base/zher' ); #### zher( order, uplo, N, α, x, strideX, A, LDA ) -Performs the hermitian rank 1 operation `A = α*x*x**H + A`, where `α` is a real scalar, `X` is an `N` element vector and `A` is an `N` by `N` hermitian matrix. +Performs the hermitian rank 1 operation `A = α*x*x**H + A`, where `α` is a real scalar, `x` is an `N` element vector and `A` is an `N` by `N` hermitian matrix. ```javascript var Complex128Array = require( '@stdlib/array/complex128' ); @@ -90,7 +90,7 @@ zher( 'row-major', 'lower', x1.length, 2.0, x1, 1, A, 2 ); #### zher.ndarray( uplo, N, α, x, strideX, offsetX, A, strideA1, strideA2, offsetA ) -Performs the hermitian rank 1 operation `A = α*x*x**H + A`, where `α` 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 1 operation `A = α*x*x**H + A`, where `α` 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 Complex128Array = require( '@stdlib/array/complex128' ); diff --git a/lib/node_modules/@stdlib/blas/base/zher/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/zher/docs/repl.txt index 1eb84e3154d7..f6be489003e5 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/zher/docs/repl.txt @@ -1,7 +1,7 @@ {{alias}}( order, uplo, N, α, x, strideX, A, LDA ) Performs the hermitian rank 1 operation `A = α*x*x**H + A`, where - `α` is a real scalar, `X` is an `N` element vector and `A` is an + `α` is a real scalar, `x` is an `N` element vector and `A` is an `N` by `N` hermitian matrix. Indexing is relative to the first index. To introduce an offset, use typed @@ -68,7 +68,7 @@ {{alias}}.ndarray( uplo, N, α, x, strideX, offsetX, A, sa1, sa2, offsetA ) Performs the hermitian rank 1 operation `A = α*x*x**H + A`, where - `α` is a real scalar, `X` is an `N` element vector and `A` is an + `α` is a real scalar, `x` is an `N` element vector 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 @@ -94,7 +94,7 @@ Index increment for `x`. offsetX: integer - Starting index for `X`. + Starting index for `x`. A: Complex128Array Input matrix. diff --git a/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts index e1d7ee903dc2..15fb36d9edbd 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts @@ -28,7 +28,7 @@ import { Layout, MatrixTriangle } from '@stdlib/types/blas'; */ interface Routine { /** - * 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 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 order - storage layout * @param uplo - specifies whether `A` is an upper or lower triangular part of matrix is supplied. @@ -52,7 +52,7 @@ interface Routine { ( order: Layout, uplo: MatrixTriangle, N: number, alpha: number, x: Complex128Array, strideX: number, A: Complex128Array, LDA: number ): Complex128Array; /** - * 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 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 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` diff --git a/lib/node_modules/@stdlib/blas/base/zher/lib/base.js b/lib/node_modules/@stdlib/blas/base/zher/lib/base.js index 27663f813057..2a4a27335bab 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/zher/lib/base.js @@ -27,7 +27,7 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); // 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 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. * * @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/zher/lib/index.js b/lib/node_modules/@stdlib/blas/base/zher/lib/index.js index 1dee9640c7ff..5b6c9cd0454e 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/zher/lib/index.js @@ -20,7 +20,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. +* 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/zher * diff --git a/lib/node_modules/@stdlib/blas/base/zher/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/zher/lib/ndarray.js index a3d065a06320..c94826c5812f 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/zher/lib/ndarray.js @@ -28,7 +28,7 @@ var base = require( './base.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 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} 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` diff --git a/lib/node_modules/@stdlib/blas/base/zher/lib/zher.js b/lib/node_modules/@stdlib/blas/base/zher/lib/zher.js index 31810fd70674..718b41730d95 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/lib/zher.js +++ b/lib/node_modules/@stdlib/blas/base/zher/lib/zher.js @@ -32,7 +32,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 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. From 02f4e7f38bf1038c43ba8b51cab7ba40f497a1bd Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:41:07 +0530 Subject: [PATCH 04/17] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/zher/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/package.json b/lib/node_modules/@stdlib/blas/base/zher/package.json index 6d32ce8a22f0..e5a3b05d1231 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/package.json +++ b/lib/node_modules/@stdlib/blas/base/zher/package.json @@ -55,13 +55,14 @@ "mathematics", "math", "blas", - "level 1", + "level 2", "linear", "algebra", "subroutines", "zher", "hermitian", "vector", + "matrix", "typed", "array", "ndarray", From 68c63b47a44fed0dc0e91b34b8555f9fba99c855 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 4 Jun 2025 18:08:20 +0530 Subject: [PATCH 05/17] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/zher/docs/repl.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/zher/docs/repl.txt index f6be489003e5..804554ea233a 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/zher/docs/repl.txt @@ -48,20 +48,20 @@ -------- // Standard usage: > var x = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] ); - > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); + > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 0.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); > {{alias}}( 'row-major', 'lower', 2, 2.0, x, 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/complex128}}( [ 3.0, 4.0, 1.0, 2.0 ] ); - > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); + > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 0.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); > {{alias}}( 'row-major', 'lower', 2, 2.0, x, -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/complex128}}( [ 0.0, 0.0, 3.0, 4.0, 1.0, 2.0 ] ); > var x1 = new {{alias:@stdlib/array/complex128}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); - > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); + > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 0.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); > {{alias}}( 'row-major', 'lower', 2, 2.0, x, -1, A, 2 ) [ 11.0, 0.0, 0.0, 0.0, 27.0, 2.0, 57.0, 0.0 ] @@ -116,7 +116,7 @@ Examples -------- > var x = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] ); - > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); + > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 0.0, 0.0, 0.0, 5.0, 6.0, 7.0, 0.0 ] ); > {{alias}}.ndarray( 'lower', 2, 2.0, x, 1, 0, A, 2, 1, 0 ) [ 11.0, 0.0, 0.0, 0.0, 27.0, 2.0, 57.0, 0.0 ] From a40daebe89f6b158d90abc61020896b697a77570 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Wed, 4 Jun 2025 18:29:51 +0530 Subject: [PATCH 06/17] chore: update jsdoc --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/zher/docs/types/index.d.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts index 15fb36d9edbd..b219adedcfa3 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts @@ -79,12 +79,16 @@ interface Routine { } /** -* Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant. +* 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 N - number of indexed elements -* @param ca - scalar constant -* @param cx - input array -* @param strideX - `cx` stride length +* @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 - input array +* @param strideX - `x` 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 From 57cea022c4dca8b024e7e9d3a0c65640da9dd988 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 6 Jun 2025 12:51:02 +0530 Subject: [PATCH 07/17] test: update fixtures --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../test/fixtures/column_major_complex_access_pattern.json | 6 +++--- .../blas/base/zher/test/fixtures/column_major_l.json | 6 +++--- .../blas/base/zher/test/fixtures/column_major_oa.json | 6 +++--- .../blas/base/zher/test/fixtures/column_major_ox.json | 6 +++--- .../blas/base/zher/test/fixtures/column_major_sa1_sa2.json | 6 +++--- .../blas/base/zher/test/fixtures/column_major_sa1_sa2n.json | 6 +++--- .../blas/base/zher/test/fixtures/column_major_sa1n_sa2.json | 6 +++--- .../base/zher/test/fixtures/column_major_sa1n_sa2n.json | 6 +++--- .../blas/base/zher/test/fixtures/column_major_u.json | 6 +++--- .../blas/base/zher/test/fixtures/column_major_xn.json | 6 +++--- .../blas/base/zher/test/fixtures/column_major_xp.json | 6 +++--- 11 files changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_complex_access_pattern.json index ed45f41cde75..bd26177e99ad 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_complex_access_pattern.json +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_complex_access_pattern.json @@ -8,9 +8,9 @@ "offsetX": 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, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] ], "LDA": 5, "strideA1": -4, diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_l.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_l.json index 216fac5f9044..8eb891c81141 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_l.json +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_l.json @@ -8,9 +8,9 @@ "offsetX": 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, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] ], "LDA": 3, "strideA1": 1, diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_oa.json index 1ce2f550a537..b7673e4599df 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_oa.json +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_oa.json @@ -9,9 +9,9 @@ "offsetX": 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, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] ], "LDA": 3, "strideA1": 1, diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_ox.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_ox.json index e2bddb897053..7f7c1a6ddf78 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_ox.json +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_ox.json @@ -8,9 +8,9 @@ "offsetX": 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, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] ], "LDA": 3, "strideA1": 1, diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1_sa2.json index 78597ba3bb6f..8315e8e77510 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1_sa2.json @@ -8,9 +8,9 @@ "offsetX": 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, 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, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] ], "LDA": 4, "strideA1": 3, diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1_sa2n.json index ac6fd6284063..7b3b82226150 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1_sa2n.json @@ -8,9 +8,9 @@ "offsetX": 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, 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, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] ], "LDA": 4, "strideA1": 3, diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1n_sa2.json index c7fc5ec7e816..4e6c3c09ca70 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1n_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1n_sa2.json @@ -8,9 +8,9 @@ "offsetX": 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, 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, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] ], "LDA": 4, "strideA1": -3, diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1n_sa2n.json index 717f51ff123c..1eade527ef65 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1n_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_sa1n_sa2n.json @@ -8,9 +8,9 @@ "offsetX": 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, 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, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] ], "LDA": 4, "strideA1": -3, diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_u.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_u.json index c3d2c83dc35c..1a93d925b824 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_u.json +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_u.json @@ -8,9 +8,9 @@ "offsetX": 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 ] + [ 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, diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_xn.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_xn.json index b3718c26ddec..8acba6029703 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_xn.json +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_xn.json @@ -8,9 +8,9 @@ "offsetX": 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, 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, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] ], "LDA": 3, "strideA1": 1, diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_xp.json b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_xp.json index 264021dbd4f9..6c22e03b0765 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_xp.json +++ b/lib/node_modules/@stdlib/blas/base/zher/test/fixtures/column_major_xp.json @@ -8,9 +8,9 @@ "offsetX": 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, 5.0, 0.0, 0.0, 0.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 0.0 ] ], "LDA": 3, "strideA1": 1, From d58b57086365b08946b3f56b23f66d36d9c4da9f Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Tue, 24 Jun 2025 18:48:05 +0530 Subject: [PATCH 08/17] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/zher/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/lib/index.js b/lib/node_modules/@stdlib/blas/base/zher/lib/index.js index 5b6c9cd0454e..3b2811927db7 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/zher/lib/index.js @@ -20,7 +20,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 3 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/zher * From d37473919e0f4d9ca51d9528d24bb4f17fc6f698 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Tue, 24 Jun 2025 18:52:46 +0530 Subject: [PATCH 09/17] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/zher/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/lib/index.js b/lib/node_modules/@stdlib/blas/base/zher/lib/index.js index 3b2811927db7..5ccd1425231f 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/zher/lib/index.js @@ -20,7 +20,7 @@ 'use strict'; /** -* BLAS level 3 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 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/zher * From a8448546eb15521950b46c85fb619822cdd10721 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 25 Jun 2025 12:46:01 +0530 Subject: [PATCH 10/17] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/zher/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/package.json b/lib/node_modules/@stdlib/blas/base/zher/package.json index e5a3b05d1231..b86fd7e00202 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/package.json +++ b/lib/node_modules/@stdlib/blas/base/zher/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/zher", "version": "0.0.0", - "description": "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.", + "description": "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.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", From 5756fb6185aacc1f4de3b49e2d471728f4aecbe5 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 25 Jun 2025 14:19:58 +0530 Subject: [PATCH 11/17] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts index b219adedcfa3..43160eb7e556 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts @@ -52,7 +52,7 @@ interface Routine { ( order: Layout, uplo: MatrixTriangle, N: number, alpha: number, x: Complex128Array, strideX: number, A: Complex128Array, LDA: number ): Complex128Array; /** - * 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 1 operation `A = alpha*x*x**H + A`, using alternative semantics indexing and where `alpha` is a real scalar, `x` is an `N` element vector 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` @@ -72,7 +72,7 @@ interface Routine { * var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] ); * var A = new Complex128Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 3.0, 4.0, 0.0 ] ); * - * zher( 'lower', x.length, 2.0, x, 1, 0, A, 2, 1, 0 ); + * zher.ndarray( 'lower', x.length, 2.0, x, 1, 0, A, 2, 1, 0 ); * // A => [ 11.0, 0.0, 0.0, 0.0, 24.0, -1.0, 54.0, 0.0 ] */ ndarray( uplo: MatrixTriangle, N: number, alpha: number, x: Complex128Array, strideX: number, offsetX: number, A: Complex128Array, strideA1: number, strideA2: number, offsetA: number ): Complex128Array; From bac739d5b9c1548d111e21ecfd6cb07f3474023d Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 25 Jun 2025 14:26:32 +0530 Subject: [PATCH 12/17] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../@stdlib/blas/base/zher/docs/types/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts index 43160eb7e556..6d529b139fac 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts @@ -28,7 +28,7 @@ import { Layout, MatrixTriangle } from '@stdlib/types/blas'; */ interface Routine { /** - * 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 1 operation `A = α*x*x**H + A`, where `α` is a real scalar, `x` is an `N` element vector 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. @@ -52,7 +52,7 @@ interface Routine { ( order: Layout, uplo: MatrixTriangle, N: number, alpha: number, x: Complex128Array, strideX: number, A: Complex128Array, LDA: number ): Complex128Array; /** - * Performs the hermitian rank 1 operation `A = alpha*x*x**H + A`, using alternative semantics indexing and 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 1 operation `A = α*x*x**H + A`, using alternative semantics indexing and where `α` is a real scalar, `x` is an `N` element vector 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` @@ -79,7 +79,7 @@ interface Routine { } /** -* 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 1 operation `A = α*x*x**H + A`, where `α` is a real scalar, `x` is an `N` element vector 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. From e1f78b3f447cd814c3187e0b2b8b5a843da5bb35 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 25 Jun 2025 14:34:42 +0530 Subject: [PATCH 13/17] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts index 6d529b139fac..47d0deceb003 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/zher/docs/types/index.d.ts @@ -89,7 +89,7 @@ interface Routine { * @param strideX - `x` 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 +* @returns input matrix * * @example * var Complex128Array = require( '@stdlib/array/complex128' ); From 199b17a52160f7ad7e31caecdc29d1544360007a Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 25 Jun 2025 18:16:50 +0530 Subject: [PATCH 14/17] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/zher/docs/types/test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/zher/docs/types/test.ts index 2ed0a4abcbc8..377985445f28 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/zher/docs/types/test.ts @@ -189,7 +189,7 @@ import zher = require( './index' ); zher.ndarray( undefined, 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError zher.ndarray( [], 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError zher.ndarray( {}, 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError - zher.ndarray.ndarray( 'row-major', ( x: number ): number => x, 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( 'row-major', ( x: number ): number => x, 10, 1.0, x, 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 565726bea799195482c328f839114a8291f142ad Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 25 Jun 2025 18:23:00 +0530 Subject: [PATCH 15/17] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/zher/docs/types/test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/zher/docs/types/test.ts index 377985445f28..bc8f9fa791ab 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/zher/docs/types/test.ts @@ -189,7 +189,7 @@ import zher = require( './index' ); zher.ndarray( undefined, 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError zher.ndarray( [], 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError zher.ndarray( {}, 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError - zher.ndarray( 'row-major', ( x: number ): number => x, 10, 1.0, x, 1, 0, A, 3, 1, 0 ); // $ExpectError + zher.ndarray( ( x: number ): number => x, 10, 1.0, x, 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 39cf8846638471688d99a1682c2f586c27967f7a Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Thu, 26 Jun 2025 10:24:15 +0530 Subject: [PATCH 16/17] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/zher/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/README.md b/lib/node_modules/@stdlib/blas/base/zher/README.md index 9e9cac3a86aa..09d79a7ef63c 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/README.md +++ b/lib/node_modules/@stdlib/blas/base/zher/README.md @@ -20,7 +20,7 @@ limitations under the License. # zher -> Perform the hermitian rank 1 operation `A = α*x*x**H + A`, where `α` 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 = α*x*x**H + A`.
@@ -73,7 +73,6 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript var Complex128Array = require( '@stdlib/array/complex128' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); // Initial array: var x0 = new Complex128Array( [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0 ] ); From 53d050745f3df0f8152729ac3e748fc736803f1a Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Thu, 26 Jun 2025 11:33:51 +0530 Subject: [PATCH 17/17] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../@stdlib/blas/base/zher/test/test.ndarray.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zher/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/zher/test/test.ndarray.js index 07864945107e..fca7f08e127a 100644 --- a/lib/node_modules/@stdlib/blas/base/zher/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/zher/test/test.ndarray.js @@ -188,7 +188,7 @@ tape( 'the function throws an error if provided an invalid ninth argument', func } }); -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 rank 1 operation `A = alpha*x*x**H + A` (row-major, lower)', function test( t ) { var expected; var data; var out; @@ -209,7 +209,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 rank 1 operation `A = alpha*x*x**H + A` (column-major, lower)', function test( t ) { var expected; var data; var out; @@ -230,7 +230,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 rank 1 operation `A = alpha*x*x**H + A` (column-major, upper)', function test( t ) { var expected; var data; var out; @@ -251,7 +251,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 rank 1 operation `A = alpha*x*x**H + A` (row-major, upper)', function test( t ) { var expected; var data; var out;