From 730fd557001e2ca51975e0ef877a7543ba69c025 Mon Sep 17 00:00:00 2001 From: Divit Date: Sat, 11 Apr 2026 19:13:48 +0000 Subject: [PATCH 01/40] add license --- .../@stdlib/blas/base/ctrsv/lib/base.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js new file mode 100644 index 000000000000..22e2c8d7c7ae --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js @@ -0,0 +1,17 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ \ No newline at end of file From 3ba563fb942d2433776f9f7ecb3f8c6a9be685ea Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 13:13:40 +0000 Subject: [PATCH 02/40] feat: adds branch 1 logic --- .../@stdlib/blas/base/ctrsv/lib/base.js | 149 +++++++++++++++++- 1 file changed, 148 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js index 22e2c8d7c7ae..6833905c5295 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js @@ -14,4 +14,151 @@ * 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. -*/ \ No newline at end of file +*/ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); + + +// MAIN // + +/** +* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. +* +* @private +* @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix +* @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {string} diag - specifies whether `A` has a unit diagonal +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {Complex64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Complex64Array} x - input vector +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @returns {Complex64Array} `x` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var A = new Complex64Array( [ ] ); +* var x = new Complex64Array( [ ] ); +* +* ctrsv( 'lower', 'no-transpose', 'non-unit', 3, A, 2, 1, 0, x, 1, 0 ); +* // x => [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] +*/ +function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len + var nonunit; + var viewA; + var viewX; + var retmp; + var imtmp; + var magsq; + var remul; + var immul; + var isrm; + var sign; + var rex; + var imx; + var rea; + var ima; + var ix0; + var ix1; + var sa0; + var sa1; + var oa2; + var ox; + var sx; + var oa; + var i0; + var i1; + var ia; + + // Layout + isrm = isRowMajor( [ strideA1, strideA2 ] ); + + // Diagonal + nonunit = ( diag === 'non-unit' ); + + // Reinterpret arrays to raw numeric views + viewA = reinterpret( A, 0 ); + viewX = reinterpret( x, 0 ); + + // Set sign to handle conjugation: flip the imaginary part for conjugate-transpose + if ( trans === 'conjugate-transpose' ) { + sign = -1; + } else { + sign = 1; + } + + if ( isrm ) { + // For row-major matrices, the last dimension has the fastest changing index... + sa0 = strideA2 * 2; // offset increment for innermost loop + sa1 = strideA1 * 2; // offset increment for outermost loop + } else { // isColMajor + // For column-major matrices, the first dimension has the fastest changing index... + sa0 = strideA1 * 2; // offset increment for innermost loop + sa1 = strideA2 * 2; // offset increment for outermost loop + } + + // Vector indexing base + oa = offsetA * 2; + ox = offsetX * 2; + + // Vector strides + sx = strideX * 2; + + if ( + ( !isrm && uplo === 'upper' && trans === 'no-transpose' ) || + ( isrm && uplo === 'lower' && trans !== 'no-transpose' ) + ) { + ix1 = ox + ( ( N - 1 ) * sx ); + for ( i1 = N - 1; i1 >= 0; i1-- ) { + rex = viewX[ ix1 ]; + imx = viewX[ ix1 + 1 ]; + if ( rex !== 0.0 || imx !== 0.0 ) { + oa2 = oa + ( sa1 * i1 ); + if ( nonunit ) { + ia = oa2 + ( sa0 * i1 ); + rea = viewA[ ia ]; + ima = sign * viewA[ ia + 1 ]; + magsq = f32( ( rea * rea ) + ( ima * ima ) ); + retmp = f32( f32( ( rex * rea ) + ( imx * ima ) ) / magsq ); + imtmp = f32( f32( ( imx * rea ) - ( rex * ima ) ) / magsq ); + viewX[ ix1 ] = retmp; + viewX[ ix1 + 1 ] = imtmp; + } else { + retmp = rex; + imtmp = imx; + } + ix0 = ix1; + for ( i0 = i1 - 1; i0 >= 0; i0-- ) { + ix0 -= sx; + ia = oa2 + ( sa0 * i0 ); + rea = viewA[ ia ]; + ima = sign * viewA[ ia + 1 ]; + rex = viewX[ ix0 ]; + imx = viewX[ ix0 + 1 ]; + remul = f32( ( retmp * rea ) - ( imtmp * ima ) ); + immul = f32( ( retmp * ima ) + ( imtmp * rea ) ); + viewX[ ix0 ] = f32( rex - remul ); + viewX[ ix0 + 1 ] = f32( imx - immul ); + } + } + ix1 -= sx; + } + return x; + } + +} + + +// EXPORTS // + +module.exports = ctrsv; \ No newline at end of file From 73793db4a86a2a7fe67c735424a214b088c639d8 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 13:14:03 +0000 Subject: [PATCH 03/40] test: add branch 1 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../test/fixtures/column_major_u_nt_nu.json | 21 +++++++++++++++++++ .../test/fixtures/column_major_u_nt_u.json | 21 +++++++++++++++++++ .../ctrsv/test/fixtures/row_major_l_t_nu.json | 21 +++++++++++++++++++ .../ctrsv/test/fixtures/row_major_l_t_u.json | 21 +++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_t_u.json diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_nt_nu.json new file mode 100644 index 000000000000..6b9da14f2f76 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_nt_nu.json @@ -0,0 +1,21 @@ +{ + "order": "column-major", + "uplo": "upper", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ], + [ 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ -0.25, 0.0, -0.125, 0.0, 0.5, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_nt_u.json new file mode 100644 index 000000000000..b4a5af638e30 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_nt_u.json @@ -0,0 +1,21 @@ +{ + "order": "column-major", + "uplo": "upper", + "trans": "no-transpose", + "diag": "unit", + "N": 3, + "A": [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ], + [ 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ -59.0, 35.0, 2.0, -28.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_t_nu.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_t_nu.json new file mode 100644 index 000000000000..e26266d94cb7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_t_nu.json @@ -0,0 +1,21 @@ +{ + "order": "row-major", + "uplo": "lower", + "trans": "transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ -0.25, 0.0, -0.125, 0.0, 0.5, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_t_u.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_t_u.json new file mode 100644 index 000000000000..8bc18092032d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_t_u.json @@ -0,0 +1,21 @@ +{ + "order": "row-major", + "uplo": "lower", + "trans": "transpose", + "diag": "unit", + "N": 3, + "A": [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ -59.0, 35.0, 2.0, -28.0, 3.0, 3.0 ] +} From cf297c342d08d6e7dd6d8888b983206b322509b4 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 13:36:17 +0000 Subject: [PATCH 04/40] feat: adds branch 2 logic --- .../@stdlib/blas/base/ctrsv/lib/base.js | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js index 6833905c5295..f71ba5e98f8c 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js @@ -155,7 +155,47 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX } return x; } - + if ( + ( !isrm && uplo === 'lower' && trans === 'no-transpose' ) || + ( isrm && uplo === 'upper' && trans !== 'no-transpose' ) + ) { + ix1 = ox; + for ( i1 = 0; i1 < N; i1++ ) { + rex = viewX[ ix1 ]; + imx = viewX[ ix1 + 1 ]; + if ( rex !== 0.0 || imx !== 0.0 ) { + oa2 = oa + ( sa1 * i1 ); + if ( nonunit ) { + ia = oa2 + ( sa0 * i1 ); + rea = viewA[ ia ]; + ima = sign * viewA[ ia + 1 ]; + magsq = f32( ( rea * rea ) + ( ima * ima ) ); + retmp = f32( f32( ( rex * rea ) + ( imx * ima ) ) / magsq ); + imtmp = f32( f32( ( imx * rea ) - ( rex * ima ) ) / magsq ); + viewX[ ix1 ] = retmp; + viewX[ ix1 + 1 ] = imtmp; + } else { + retmp = rex; + imtmp = imx; + } + ix0 = ix1; + for ( i0 = i1 + 1; i0 < N; i0++ ) { + ix0 += sx; + ia = oa2 + ( sa0 * i0 ); + rea = viewA[ ia ]; + ima = sign * viewA[ ia + 1 ]; + rex = viewX[ ix0 ]; + imx = viewX[ ix0 + 1 ]; + remul = f32( ( retmp * rea ) - ( imtmp * ima ) ); + immul = f32( ( retmp * ima ) + ( imtmp * rea ) ); + viewX[ ix0 ] = f32( rex - remul ); + viewX[ ix0 + 1 ] = f32( imx - immul ); + } + } + ix1 += sx; + } + return x; + } } From 4fe077da23d0f1731743265839f3d6f8b550a7cc Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 13:36:29 +0000 Subject: [PATCH 05/40] test: add branch 2 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../test/fixtures/column_major_l_nt_nu.json | 21 +++++++++++++++++++ .../test/fixtures/column_major_l_nt_u.json | 21 +++++++++++++++++++ .../ctrsv/test/fixtures/row_major_u_t_nu.json | 21 +++++++++++++++++++ .../ctrsv/test/fixtures/row_major_u_t_u.json | 21 +++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_t_u.json diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_nt_nu.json new file mode 100644 index 000000000000..bebc14a9f89b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_nt_nu.json @@ -0,0 +1,21 @@ +{ + "order": "column-major", + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_nt_u.json new file mode 100644 index 000000000000..2fcab6a107dd --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_nt_u.json @@ -0,0 +1,21 @@ +{ + "order": "column-major", + "uplo": "lower", + "trans": "no-transpose", + "diag": "unit", + "N": 3, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, -2.0, -17.0, -3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_t_nu.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_t_nu.json new file mode 100644 index 000000000000..ea995614ace0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_t_nu.json @@ -0,0 +1,21 @@ +{ + "order": "row-major", + "uplo": "upper", + "trans": "transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ], + [ 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_t_u.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_t_u.json new file mode 100644 index 000000000000..ff1635a04795 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_t_u.json @@ -0,0 +1,21 @@ +{ + "order": "row-major", + "uplo": "upper", + "trans": "transpose", + "diag": "unit", + "N": 3, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ], + [ 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, -2.0, -17.0, -3.0 ] +} From 21ec8e3e0c66cdddb01184b14779087b36b7f5ac Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 14:01:23 +0000 Subject: [PATCH 06/40] feat: adds branch 3 logic --- .../@stdlib/blas/base/ctrsv/lib/base.js | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js index f71ba5e98f8c..3c90ea065dcf 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js @@ -196,6 +196,44 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX } return x; } + if ( + ( !isrm && uplo === 'upper' && trans !== 'no-transpose' ) || + ( isrm && uplo === 'lower' && trans === 'no-transpose' ) + ) { + ix1 = ox; + for ( i1 = 0; i1 < N; i1++ ) { + oa2 = oa + ( sa1 * i1 ); + rex = viewX[ ix1 ]; + imx = viewX[ ix1 + 1 ]; + retmp = rex; + imtmp = imx; + ix0 = ox; + for ( i0 = 0; i0 < i1; i0++ ) { + ia = oa2 + ( sa0 * i0 ); + rea = viewA[ ia ]; + ima = sign * viewA[ ia + 1 ]; + rex = viewX[ ix0 ]; + imx = viewX[ ix0 + 1 ]; + retmp -= f32( ( rex * rea ) - ( imx * ima ) ); + imtmp -= f32( ( rex * ima ) + ( imx * rea ) ); + ix0 += sx; + } + if ( nonunit ) { + ia = oa2 + ( sa0 * i1 ); + rea = viewA[ ia ]; + ima = sign * viewA[ ia + 1 ]; + magsq = f32( ( rea * rea ) + ( ima * ima ) ); + remul = f32( ( retmp * rea ) + ( imtmp * ima ) ); + immul = f32( ( imtmp * rea ) - ( retmp * ima ) ); + retmp = f32( remul / magsq ); + imtmp = f32( immul / magsq ); + } + viewX[ ix1 ] = retmp; + viewX[ ix1 + 1 ] = imtmp; + ix1 += sx; + } + return x; + } } From 5a4648c035bf158751ee1e2e623aab62603dfd21 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 14:01:33 +0000 Subject: [PATCH 07/40] test: add branch 3 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../test/fixtures/column_major_u_t_nu.json | 21 +++++++++++++++++++ .../test/fixtures/column_major_u_t_u.json | 21 +++++++++++++++++++ .../test/fixtures/row_major_l_nt_nu.json | 21 +++++++++++++++++++ .../ctrsv/test/fixtures/row_major_l_nt_u.json | 21 +++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_nt_u.json diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_t_nu.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_t_nu.json new file mode 100644 index 000000000000..c7c5cf5c64e6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_t_nu.json @@ -0,0 +1,21 @@ +{ + "order": "column-major", + "uplo": "upper", + "trans": "transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ], + [ 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_t_u.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_t_u.json new file mode 100644 index 000000000000..96b73de112f7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_u_t_u.json @@ -0,0 +1,21 @@ +{ + "order": "column-major", + "uplo": "upper", + "trans": "transpose", + "diag": "unit", + "N": 3, + "A": [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ], + [ 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, -2.0, -17.0, -3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_nt_nu.json new file mode 100644 index 000000000000..b2ccc460d743 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_nt_nu.json @@ -0,0 +1,21 @@ +{ + "order": "row-major", + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_nt_u.json new file mode 100644 index 000000000000..6f820920021e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_nt_u.json @@ -0,0 +1,21 @@ +{ + "order": "row-major", + "uplo": "lower", + "trans": "no-transpose", + "diag": "unit", + "N": 3, + "A": [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, -2.0, -17.0, -3.0 ] +} From ed1e8803bb4d1758124a18eb37304fe548f3e856 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 14:14:19 +0000 Subject: [PATCH 08/40] feat: adds branch 4 logic --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ctrsv/lib/base.js | 46 ++++++++++++++++--- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js index 3c90ea065dcf..649c22175842 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js @@ -47,11 +47,11 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' ); * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * -* var A = new Complex64Array( [ ] ); -* var x = new Complex64Array( [ ] ); +* var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); * -* ctrsv( 'lower', 'no-transpose', 'non-unit', 3, A, 2, 1, 0, x, 1, 0 ); -* // x => [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] +* ctrsv( 'lower', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); +* // x => [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] */ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len var nonunit; @@ -155,7 +155,7 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX } return x; } - if ( + if ( ( !isrm && uplo === 'lower' && trans === 'no-transpose' ) || ( isrm && uplo === 'upper' && trans !== 'no-transpose' ) ) { @@ -234,9 +234,43 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX } return x; } + // ( !isrm && uplo === 'lower' && trans !== 'no-transpose' ) || ( isrm && uplo === 'upper' && trans === 'no-transpose' ) + ix1 = ox + ( ( N - 1 ) * sx ); + for ( i1 = N - 1; i1 >= 0; i1-- ) { + oa2 = oa + ( sa1 * i1 ); + rex = viewX[ ix1 ]; + imx = viewX[ ix1 + 1 ]; + retmp = rex; + imtmp = imx; + ix0 = ox + ( ( N - 1 ) * sx ); + for ( i0 = N - 1; i0 > i1; i0-- ) { + ia = oa2 + ( sa0 * i0 ); + rea = viewA[ ia ]; + ima = sign * viewA[ ia + 1 ]; + rex = viewX[ ix0 ]; + imx = viewX[ ix0 + 1 ]; + retmp -= f32( ( rex * rea ) - ( imx * ima ) ); + imtmp -= f32( ( rex * ima ) + ( imx * rea ) ); + ix0 -= sx; + } + if ( nonunit ) { + ia = oa2 + ( sa0 * i1 ); + rea = viewA[ ia ]; + ima = sign * viewA[ ia + 1 ]; + magsq = f32( ( rea * rea ) + ( ima * ima ) ); + remul = f32( ( retmp * rea ) + ( imtmp * ima ) ); + immul = f32( ( imtmp * rea ) - ( retmp * ima ) ); + retmp = f32( remul / magsq ); + imtmp = f32( immul / magsq ); + } + viewX[ ix1 ] = retmp; + viewX[ ix1 + 1 ] = imtmp; + ix1 -= sx; + } + return x; } // EXPORTS // -module.exports = ctrsv; \ No newline at end of file +module.exports = ctrsv; From 1bba77521f655263f3030e0464976f224afd70af Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 14:14:37 +0000 Subject: [PATCH 09/40] test: add branch 4 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../test/fixtures/column_major_l_t_nu.json | 21 +++++++++++++++++++ .../test/fixtures/column_major_l_t_u.json | 21 +++++++++++++++++++ .../test/fixtures/row_major_u_nt_nu.json | 21 +++++++++++++++++++ .../ctrsv/test/fixtures/row_major_u_nt_u.json | 21 +++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_nt_u.json diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_t_nu.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_t_nu.json new file mode 100644 index 000000000000..b64dfcb4b7b9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_t_nu.json @@ -0,0 +1,21 @@ +{ + "order": "column-major", + "uplo": "lower", + "trans": "transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ -0.25, 0.0, -0.125, 0.0, 0.5, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_t_u.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_t_u.json new file mode 100644 index 000000000000..0bbb7bf9544d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_t_u.json @@ -0,0 +1,21 @@ +{ + "order": "column-major", + "uplo": "lower", + "trans": "transpose", + "diag": "unit", + "N": 3, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ -59.0, 35.0, 2.0, -28.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_nt_nu.json new file mode 100644 index 000000000000..3c1808042fe3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_nt_nu.json @@ -0,0 +1,21 @@ +{ + "order": "row-major", + "uplo": "upper", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ], + [ 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ -0.25, 0.0, -0.125, 0.0, 0.5, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_nt_u.json new file mode 100644 index 000000000000..9f43f21e116e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_u_nt_u.json @@ -0,0 +1,21 @@ +{ + "order": "row-major", + "uplo": "upper", + "trans": "no-transpose", + "diag": "unit", + "N": 3, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ], + [ 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ -59.0, 35.0, 2.0, -28.0, 3.0, 3.0 ] +} From 51406445b61420df30a2002f77409360e8d84250 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 14:18:21 +0000 Subject: [PATCH 10/40] chore: add package.json --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ctrsv/package.json | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/package.json diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/package.json b/lib/node_modules/@stdlib/blas/base/ctrsv/package.json new file mode 100644 index 000000000000..ab88bd94b15c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/package.json @@ -0,0 +1,69 @@ +{ + "name": "@stdlib/blas/base/ctrsv", + "version": "0.0.0", + "description": "Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "browser": "./lib/main.js", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "level 2", + "ctrmv", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "complex", + "complex64", + "complex64array" + ] +} From d82d322c0305e5b12b338ef49123629e23fac27d Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 14:39:06 +0000 Subject: [PATCH 11/40] feat: add wrappers and entry point --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ctrsv/lib/ctrsv.js | 108 ++++++++++++++++++ .../@stdlib/blas/base/ctrsv/lib/index.js | 69 +++++++++++ .../@stdlib/blas/base/ctrsv/lib/main.js | 35 ++++++ .../@stdlib/blas/base/ctrsv/lib/ndarray.js | 95 +++++++++++++++ 4 files changed, 307 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/lib/ctrsv.js create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/lib/ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ctrsv.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ctrsv.js new file mode 100644 index 000000000000..4c4368e5c950 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ctrsv.js @@ -0,0 +1,108 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var 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 isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); +var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. +* +* @param {string} order - storage layout +* @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix +* @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {string} diag - specifies whether `A` has a unit diagonal +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {Complex64Array} A - input matrix +* @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Complex64Array} x - input vector +* @param {integer} strideX - `x` stride length +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must specify whether a lower or upper triangular matrix is supplied +* @throws {TypeError} third argument must be a valid transpose operation +* @throws {TypeError} fourth argument must be a valid diagonal type +* @throws {RangeError} fifth argument must be a nonnegative integer +* @throws {RangeError} seventh argument must be greater than or equal to max(1,N) +* @throws {RangeError} ninth argument must be non-zero +* @returns {Complex64Array} `x` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* +* ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, A, 3, x, 1 ); +* // x => [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +*/ +function ctrsv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { + 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 the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); + } + if ( !isTransposeOperation( trans ) ) { + throw new TypeError( format( 'invalid argument. Third argument must be a valid transpose operation. Value: `%s`.', trans ) ); + } + if ( !isDiagonal( diag ) ) { + throw new TypeError( format( 'invalid argument. Fourth argument must be a valid diagonal type. Value: `%s`.', diag ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( LDA < max( 1, N ) ) { + throw new RangeError( format( 'invalid argument. Seventh argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); + } + if ( strideX === 0 ) { + throw new RangeError( format( 'invalid argument. Ninth argument must be non-zero. Value: `%d`.', strideX ) ); + } + if ( N === 0 ) { + return x; + } + if ( order === 'column-major' ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + } + ox = stride2offset( N, strideX ); + return base( uplo, trans, diag, N, A, sa1, sa2, 0, x, strideX, ox ); +} + + +// EXPORTS // + +module.exports = ctrsv; diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/index.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/index.js new file mode 100644 index 000000000000..0ebe9205e4e4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/index.js @@ -0,0 +1,69 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* BLAS level 2 routine to solve one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. +* @module @stdlib/blas/base/ctrsv +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var ctrsv = require( '@stdlib/blas/base/ctrsv' ); +* +* var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* +* ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, A, 3, x, 1 ); +* // x => [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var ctrsv = require( '@stdlib/blas/base/ctrsv' ); +* +* var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* +* ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); +* // x => [ 1.0, 0.0, 0.0, 0.0, 0.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 ctrsv; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + ctrsv = main; +} else { + ctrsv = tmp; +} + + +// EXPORTS // + +module.exports = ctrsv; + +// exports: { "ndarray": "ctrsv.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/main.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/main.js new file mode 100644 index 000000000000..3b94f7fa1449 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var ctrsv = require( './ctrsv.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( ctrsv, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = ctrsv; diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ndarray.js new file mode 100644 index 000000000000..79e1a3e2a22a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ndarray.js @@ -0,0 +1,95 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); +var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. +* +* @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix +* @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {string} diag - specifies whether `A` has a unit diagonal +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {Complex64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Complex64Array} x - input vector +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @throws {TypeError} first argument must specify whether a lower or upper triangular matrix is supplied +* @throws {TypeError} second argument must be a valid transpose operation +* @throws {TypeError} third argument must be a valid diagonal type +* @throws {RangeError} fourth argument must be a nonnegative integer +* @throws {RangeError} sixth argument must be non-zero +* @throws {RangeError} seventh argument must be non-zero +* @throws {RangeError} tenth argument must be non-zero +* @returns {Complex64Array} `x` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* +* ctrsv( 'lower', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); +* // x => [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +*/ +function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( format( 'invalid argument. First argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); + } + if ( !isTransposeOperation( trans ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be a valid transpose operation. Value: `%s`.', trans ) ); + } + if ( !isDiagonal( diag ) ) { + throw new TypeError( format( 'invalid argument. Third argument must be a valid diagonal type. Value: `%s`.', diag ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( strideA1 === 0 ) { + throw new RangeError( format( 'invalid argument. Sixth argument must be non-zero. Value: `%d`.', strideA1 ) ); + } + if ( strideA2 === 0 ) { + throw new RangeError( format( 'invalid argument. Seventh argument must be non-zero. Value: `%d`.', strideA2 ) ); + } + if ( strideX === 0 ) { + throw new RangeError( format( 'invalid argument. Tenth argument must be non-zero. Value: `%d`.', strideX ) ); + } + if ( N === 0 ) { + return x; + } + return base( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = ctrsv; From a65b642ec9991b719bad6c58e470572524b9d906 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 17:32:32 +0000 Subject: [PATCH 12/40] test: add conjugate transpose 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../test/fixtures/column_major_l_ct_nu.json | 21 +++++++++++++++++++ .../test/fixtures/row_major_l_ct_nu.json | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_ct_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_ct_nu.json diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_ct_nu.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_ct_nu.json new file mode 100644 index 000000000000..f6196995aa99 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_ct_nu.json @@ -0,0 +1,21 @@ +{ + "order": "column-major", + "uplo": "lower", + "trans": "conjugate-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 0.0, -0.25, 0.0, -0.125, 0.0, 0.5 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_ct_nu.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_ct_nu.json new file mode 100644 index 000000000000..12f82791b370 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_ct_nu.json @@ -0,0 +1,21 @@ +{ + "order": "row-major", + "uplo": "lower", + "trans": "conjugate-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 0.0, -0.25, 0.0, -0.125, 0.0, 0.5 ] +} From e9d0975c94196d5e04384c66227179244061c5dc Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 17:36:20 +0000 Subject: [PATCH 13/40] test: add vector offset 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ctrsv/test/fixtures/column_major_ox.json | 21 +++++++++++++++++++ .../ctrsv/test/fixtures/row_major_ox.json | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_ox.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_ox.json diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_ox.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_ox.json new file mode 100644 index 000000000000..d9d40a6dc4b6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_ox.json @@ -0,0 +1,21 @@ +{ + "order": "column-major", + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 1, + "x_out": [ 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_ox.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_ox.json new file mode 100644 index 000000000000..7f28f26d0681 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_ox.json @@ -0,0 +1,21 @@ +{ + "order": "row-major", + "uplo": "lower", + "trans": "no-transpose", + "diag": "unit", + "N": 3, + "A": [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 2, + "x_out": [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 2.0, -2.0, -17.0, -3.0 ] +} From b2ce3b52e854f519e1d63e93fb55599561ae7757 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 17:41:00 +0000 Subject: [PATCH 14/40] test: add vector stride specific 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ctrsv/test/fixtures/column_major_xn.json | 21 +++++++++++++++++++ .../ctrsv/test/fixtures/column_major_xp.json | 21 +++++++++++++++++++ .../ctrsv/test/fixtures/row_major_xn.json | 21 +++++++++++++++++++ .../ctrsv/test/fixtures/row_major_xp.json | 21 +++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_xn.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_xp.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_xn.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_xp.json diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_xn.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_xn.json new file mode 100644 index 000000000000..6963761423ba --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_xn.json @@ -0,0 +1,21 @@ +{ + "order": "column-major", + "uplo": "lower", + "trans": "transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 3.0, 3.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0 ], + "strideX": -2, + "offsetX": 4, + "x_out": [ 0.5, 0.0, 0.0, 0.0, -0.125, 0.0, 0.0, 0.0, -0.25, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_xp.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_xp.json new file mode 100644 index 000000000000..4ee0a45bdf78 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_xp.json @@ -0,0 +1,21 @@ +{ + "order": "column-major", + "uplo": "lower", + "trans": "transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0 ], + "strideX": 2, + "offsetX": 0, + "x_out": [ -0.25, 0.0, 0.0, 0.0, -0.125, 0.0, 0.0, 0.0, 0.5, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_xn.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_xn.json new file mode 100644 index 000000000000..74cda46cc63c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_xn.json @@ -0,0 +1,21 @@ +{ + "order": "row-major", + "uplo": "lower", + "trans": "transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 3.0, 3.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0 ], + "strideX": -3, + "offsetX": 6, + "x_out": [ 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, -0.125, 0.0, 0.0, 0.0, 0.0, 0.0, -0.25, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_xp.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_xp.json new file mode 100644 index 000000000000..74573d4c0550 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_xp.json @@ -0,0 +1,21 @@ +{ + "order": "row-major", + "uplo": "lower", + "trans": "transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 0.0, 0.0, 3.0, 3.0 ], + "strideX": 3, + "offsetX": 0, + "x_out": [ -0.25, 0.0, 0.0, 0.0, 0.0, 0.0, -0.125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0 ] +} From c529d6453c143c7f168bb4f347c65b51e4c694d5 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 17:46:13 +0000 Subject: [PATCH 15/40] test: add matrix offset 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ctrsv/test/fixtures/column_major_oa.json | 19 +++++++++++++++++ .../ctrsv/test/fixtures/column_major_ox.json | 2 -- .../ctrsv/test/fixtures/row_major_oa.json | 21 +++++++++++++++++++ .../ctrsv/test/fixtures/row_major_ox.json | 2 -- 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_oa.json diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_oa.json new file mode 100644 index 000000000000..8b9e5305f6d1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_oa.json @@ -0,0 +1,19 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "unit", + "N": 3, + "A": [ 999.0, 999.0, 999.0, 999.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 2, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, -2.0, -17.0, -3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_ox.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_ox.json index d9d40a6dc4b6..85a6cb2780d2 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_ox.json +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_ox.json @@ -1,5 +1,4 @@ { - "order": "column-major", "uplo": "lower", "trans": "no-transpose", "diag": "non-unit", @@ -10,7 +9,6 @@ [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ], - "LDA": 3, "strideA1": 1, "strideA2": 3, "offsetA": 0, diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_oa.json new file mode 100644 index 000000000000..e3bb4cf8235c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_oa.json @@ -0,0 +1,21 @@ +{ + "order": "row-major", + "uplo": "lower", + "trans": "no-transpose", + "diag": "unit", + "N": 3, + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 4, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, -2.0, -17.0, -3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_ox.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_ox.json index 7f28f26d0681..082eb5ead658 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_ox.json +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_ox.json @@ -1,5 +1,4 @@ { - "order": "row-major", "uplo": "lower", "trans": "no-transpose", "diag": "unit", @@ -10,7 +9,6 @@ [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ], - "LDA": 3, "strideA1": 3, "strideA2": 1, "offsetA": 0, From 13e1efacaad292c6f76c1a5014dbd14274273c7c Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 18:31:31 +0000 Subject: [PATCH 16/40] test: add matrix stride specific 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../test/fixtures/column_major_sa1_sa2.json | 19 +++++++++++++++++++ .../test/fixtures/column_major_sa1_sa2n.json | 19 +++++++++++++++++++ .../test/fixtures/column_major_sa1n_sa2.json | 19 +++++++++++++++++++ .../test/fixtures/column_major_sa1n_sa2n.json | 19 +++++++++++++++++++ .../ctrsv/test/fixtures/row_major_oa.json | 2 -- .../test/fixtures/row_major_sa1_sa2.json | 19 +++++++++++++++++++ .../test/fixtures/row_major_sa1_sa2n.json | 19 +++++++++++++++++++ .../test/fixtures/row_major_sa1n_sa2.json | 19 +++++++++++++++++++ .../test/fixtures/row_major_sa1n_sa2n.json | 19 +++++++++++++++++++ 9 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1n_sa2n.json diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1_sa2.json new file mode 100644 index 000000000000..ccd0a10808fa --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1_sa2.json @@ -0,0 +1,19 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 3.0, 3.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 5.0, 5.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "strideA1": 2, + "strideA2": 6, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1_sa2n.json new file mode 100644 index 000000000000..476670d25b25 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1_sa2n.json @@ -0,0 +1,19 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 6.0, 6.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 999.0, 999.0, 5.0, 5.0, 999.0, 999.0, 1.0, 1.0, 999.0, 999.0, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 999.0, 999.0, 3.0, 3.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "strideA1": 3, + "strideA2": -8, + "offsetA": 16, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1n_sa2.json new file mode 100644 index 000000000000..fa163d9fc694 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1n_sa2.json @@ -0,0 +1,19 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 3.0, 3.0, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 1.0, 1.0, 999.0, 999.0, 999.0, 999.0, 5.0, 5.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 6.0, 6.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 0.0, 0.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "strideA1": -2, + "strideA2": 7, + "offsetA": 4, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1n_sa2n.json new file mode 100644 index 000000000000..17baa566eb36 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_sa1n_sa2n.json @@ -0,0 +1,19 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 6.0, 6.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 5.0, 5.0, 999.0, 999.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 3.0, 3.0, 999.0, 999.0, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 999.0, 999.0, 1.0, 1.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "strideA1": -3, + "strideA2": -7, + "offsetA": 20, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_oa.json index e3bb4cf8235c..5607a50b82ee 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_oa.json +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_oa.json @@ -1,5 +1,4 @@ { - "order": "row-major", "uplo": "lower", "trans": "no-transpose", "diag": "unit", @@ -10,7 +9,6 @@ [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ], - "LDA": 3, "strideA1": 3, "strideA2": 1, "offsetA": 4, diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1_sa2.json new file mode 100644 index 000000000000..75aa3e40b915 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1_sa2.json @@ -0,0 +1,19 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 1.0, 1.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 3.0, 3.0, 999.0, 999.0, 5.0, 5.0, 999.0, 999.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "strideA1": 6, + "strideA2": 2, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1_sa2n.json new file mode 100644 index 000000000000..4579f4ba1f72 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1_sa2n.json @@ -0,0 +1,19 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 1.0, 1.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 6.0, 6.0, 999.0, 999.0, 999.0, 999.0, 5.0, 5.0, 999.0, 999.0, 999.0, 999.0, 3.0, 3.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "strideA1": 8, + "strideA2": -3, + "offsetA": 6, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1n_sa2.json new file mode 100644 index 000000000000..31aa6edacd51 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1n_sa2.json @@ -0,0 +1,19 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 3.0, 3.0, 999.0, 999.0, 5.0, 5.0, 999.0, 999.0, 6.0, 6.0, 999.0, 999.0, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 1.0, 1.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 0.0, 0.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "strideA1": -7, + "strideA2": 2, + "offsetA": 14, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1n_sa2n.json new file mode 100644 index 000000000000..d908aa324b07 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_sa1n_sa2n.json @@ -0,0 +1,19 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 6.0, 6.0, 999.0, 999.0, 999.0, 999.0, 5.0, 5.0, 999.0, 999.0, 999.0, 999.0, 3.0, 3.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 999.0, 999.0, 2.0, 2.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 1.0, 1.0 ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ], + [ 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "strideA1": -7, + "strideA2": -3, + "offsetA": 20, + "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +} From a746249a4990aae79d3794119b3a767da5011d52 Mon Sep 17 00:00:00 2001 From: Divit Date: Sun, 12 Apr 2026 18:36:37 +0000 Subject: [PATCH 17/40] test: add complex access patterns 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../column_major_complex_access_pattern.json | 19 +++++++++++++++++++ .../row_major_complex_access_pattern.json | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_complex_access_pattern.json diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 000000000000..ae90468afc85 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_complex_access_pattern.json @@ -0,0 +1,19 @@ +{ + "uplo": "upper", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 999.0, 999.0, 6.0, 6.0, 999.0, 999.0, 5.0, 5.0, 999.0, 999.0, 3.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 1.0, 1.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ], + [ 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ] + ], + "strideA1": -2, + "strideA2": -9, + "offsetA": 23, + "x": [ 3.0, 3.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0 ], + "strideX": -2, + "offsetX": 4, + "x_out": [ 0.5, 0.0, 0.0, 0.0, -0.125, 0.0, 0.0, 0.0, -0.25, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 000000000000..d06ac63fd52e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_complex_access_pattern.json @@ -0,0 +1,19 @@ +{ + "uplo": "upper", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "A": [ 999.0, 999.0, 6.0, 6.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 5.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 3.0, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 1.0, 1.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ], + [ 0.0, 0.0, 0.0, 0.0, 6.0, 6.0 ] + ], + "strideA1": -9, + "strideA2": -2, + "offsetA": 23, + "x": [ 3.0, 3.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0 ], + "strideX": -2, + "offsetX": 4, + "x_out": [ 0.5, 0.0, 0.0, 0.0, -0.125, 0.0, 0.0, 0.0, -0.25, 0.0 ] +} From bc1a0805b5211f45a6cef85822c31806a78b53c9 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 09:16:21 +0000 Subject: [PATCH 18/40] test: add test suite --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/ctrsv/test/test.ctrsv.js | 801 ++++++++++++ .../@stdlib/blas/base/ctrsv/test/test.js | 82 ++ .../blas/base/ctrsv/test/test.ndarray.js | 1125 +++++++++++++++++ 3 files changed, 2008 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ctrsv.js create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/test.js create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ctrsv.js b/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ctrsv.js new file mode 100644 index 000000000000..3ecb6a47410f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ctrsv.js @@ -0,0 +1,801 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var ctrsv = require( './../lib/ctrsv.js' ); + + +// FIXTURES // + +var rlntnu = require( './fixtures/row_major_l_nt_nu.json' ); +var rlntu = require( './fixtures/row_major_l_nt_u.json' ); +var rltnu = require( './fixtures/row_major_l_t_nu.json' ); +var rltu = require( './fixtures/row_major_l_t_u.json' ); +var rlctnu = require( './fixtures/row_major_l_ct_nu.json' ); +var runtnu = require( './fixtures/row_major_u_nt_nu.json' ); +var runtu = require( './fixtures/row_major_u_nt_u.json' ); +var rutnu = require( './fixtures/row_major_u_t_nu.json' ); +var rutu = require( './fixtures/row_major_u_t_u.json' ); +var rxp = require( './fixtures/row_major_xp.json' ); +var rxn = require( './fixtures/row_major_xn.json' ); +var clntnu = require( './fixtures/column_major_l_nt_nu.json' ); +var clntu = require( './fixtures/column_major_l_nt_u.json' ); +var cltnu = require( './fixtures/column_major_l_t_nu.json' ); +var cltu = require( './fixtures/column_major_l_t_u.json' ); +var clctnu = require( './fixtures/column_major_l_ct_nu.json' ); +var cuntnu = require( './fixtures/column_major_u_nt_nu.json' ); +var cuntu = require( './fixtures/column_major_u_nt_u.json' ); +var cutnu = require( './fixtures/column_major_u_t_nu.json' ); +var cutu = require( './fixtures/column_major_u_t_u.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 ctrsv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 9', function test( t ) { + t.strictEqual( ctrsv.length, 9, '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; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + 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() { + ctrsv( value, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var data; + var i; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + 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() { + ctrsv( data.order, value, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', function test( t ) { + var values; + var data; + var i; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + 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() { + ctrsv( data.order, data.uplo, value, data.diag, data.N, a, data.LDA, x, data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourth argument', function test( t ) { + var values; + var data; + var i; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + 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() { + ctrsv( data.order, data.uplo, data.trans, value, data.N, a, data.LDA, x, data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { + var values; + var data; + var i; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + 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() { + ctrsv( data.order, data.uplo, data.trans, data.diag, value, a, data.LDA, x, data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid seventh argument', function test( t ) { + var values; + var data; + var i; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + 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() { + ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, value, x, data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid ninth argument', function test( t ) { + var values; + var data; + var i; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + 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() { + ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, value ); + }; + } +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = clntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rlntu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = clntu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rltnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cltnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, conjugate-transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rlctnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, conjugate-transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = clctnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rltu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cltu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = runtnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cuntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = runtu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cuntu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rutnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cutnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rutu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cutu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function returns a reference to the input vector', function test( t ) { + var data; + var out; + var a; + var x; + + data = rutu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `N` is zero, the function returns the input vector unchanged (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rutu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, 0, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero, the function returns the input vector unchanged (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cutu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, 0, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( x, expected, '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 Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + 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 Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative `x` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rxn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative `x` stride (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cxn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.js b/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.js new file mode 100644 index 000000000000..0d3defc9e979 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var ctrsv = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': IS_BROWSER +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof ctrsv, '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 ctrsv.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 ctrsv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( ctrsv, mock, 'returns expected value' ); + 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 ctrsv; + var main; + + main = require( './../lib/ctrsv.js' ); + + ctrsv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( ctrsv, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js new file mode 100644 index 000000000000..46f54ec02b3d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js @@ -0,0 +1,1125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var ctrsv = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var rlntnu = require( './fixtures/row_major_l_nt_nu.json' ); +var rlntu = require( './fixtures/row_major_l_nt_u.json' ); +var rltnu = require( './fixtures/row_major_l_t_nu.json' ); +var rltu = require( './fixtures/row_major_l_t_u.json' ); +var rlctnu = require( './fixtures/row_major_l_ct_nu.json' ); +var runtnu = require( './fixtures/row_major_u_nt_nu.json' ); +var runtu = require( './fixtures/row_major_u_nt_u.json' ); +var rutnu = require( './fixtures/row_major_u_t_nu.json' ); +var rutu = require( './fixtures/row_major_u_t_u.json' ); +var rxp = require( './fixtures/row_major_xp.json' ); +var rxn = require( './fixtures/row_major_xn.json' ); +var rox = require( './fixtures/row_major_ox.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 clntnu = require( './fixtures/column_major_l_nt_nu.json' ); +var clntu = require( './fixtures/column_major_l_nt_u.json' ); +var cltnu = require( './fixtures/column_major_l_t_nu.json' ); +var cltu = require( './fixtures/column_major_l_t_u.json' ); +var clctnu = require( './fixtures/column_major_l_ct_nu.json' ); +var cuntnu = require( './fixtures/column_major_u_nt_nu.json' ); +var cuntu = require( './fixtures/column_major_u_nt_u.json' ); +var cutnu = require( './fixtures/column_major_u_t_nu.json' ); +var cutu = require( './fixtures/column_major_u_t_u.json' ); +var cxp = require( './fixtures/column_major_xp.json' ); +var cxn = require( './fixtures/column_major_xn.json' ); +var cox = require( './fixtures/column_major_ox.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 ctrsv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 11', function test( t ) { + t.strictEqual( ctrsv.length, 11, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', function test( t ) { + var values; + var data; + var i; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + 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() { + ctrsv( value, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var data; + var i; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + 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() { + ctrsv( data.uplo, value, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', function test( t ) { + var values; + var data; + var i; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + 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() { + ctrsv( data.uplo, data.trans, value, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourth argument', function test( t ) { + var values; + var data; + var i; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + 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() { + ctrsv( data.uplo, data.trans, data.diag, value, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid sixth argument', function test( t ) { + var values; + var data; + var i; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + 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() { + ctrsv( data.uplo, data.trans, data.diag, data.N, a, value, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid seventh argument', function test( t ) { + var values; + var data; + var i; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + 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() { + ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, value, data.offsetA, x, data.strideX, data.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid tenth argument', function test( t ) { + var values; + var data; + var i; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + 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() { + ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, value, data.offsetX ); + }; + } +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = clntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rlntu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = clntu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rltnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cltnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, conjugate-transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rlctnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, conjugate-transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = clctnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rltu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cltu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = runtnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cuntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = runtu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cuntu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rutnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cutnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rutu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cutu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function returns a reference to the input vector', function test( t ) { + var data; + var out; + var a; + var x; + + data = rutu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'if `N` is zero, the function returns the input vector unchanged (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rutu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x ); + + out = ctrsv( data.uplo, data.trans, data.diag, 0, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero, the function returns the input vector unchanged (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cutu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x ); + + out = ctrsv( data.uplo, data.trans, data.diag, 0, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an `x` offset (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rox; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports an `x` offset (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cox; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + 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 Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + 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 Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + 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 Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative `x` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rxn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative `x` stride (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cxn; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports an `A` offset (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = roa; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports an `A` offset (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = coa; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1sa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1sa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1nsa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1nsa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1sa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1sa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports negative strides for `A` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1nsa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports negative strides for `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1nsa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rcap; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = ccap; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + + t.end(); +}); From 9b779886d62251a16ba934a747344f2a235819a4 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 09:18:54 +0000 Subject: [PATCH 19/40] chore: update copr right years --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js index 46f54ec02b3d..f2b4b9f8fd78 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 65a5fc8ee488d44c1ad8544a7c6957676c42d2e2 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 09:32:33 +0000 Subject: [PATCH 20/40] docs: add types and tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../blas/base/ctrsv/docs/types/index.d.ts | 120 ++++++ .../blas/base/ctrsv/docs/types/test.ts | 375 ++++++++++++++++++ 2 files changed, 495 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/docs/types/test.ts diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/ctrsv/docs/types/index.d.ts new file mode 100644 index 000000000000..05e06080a566 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/docs/types/index.d.ts @@ -0,0 +1,120 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Layout, MatrixTriangle, TransposeOperation, DiagonalType } from '@stdlib/types/blas'; +import { Complex64Array } from '@stdlib/types/array'; + +/** +* Interface describing `ctrsv`. +*/ +interface Routine { + /** + * Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. + * + * @param order - storage layout + * @param uplo - specifies whether `A` is an upper or lower triangular matrix + * @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed + * @param diag - specifies whether `A` has a unit diagonal + * @param N - number of elements along each dimension in the matrix `A` + * @param A - input matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param x - input vector + * @param strideX - `x` stride length + * @returns `x` + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * + * var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); + * var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); + * + * ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, A, 3, x, 1 ); + * // x => [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] + */ + ( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Complex64Array, LDA: number, x: Complex64Array, strideX: number ): Complex64Array; + + /** + * Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` using alternative indexing semantics and where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. + * + * @param uplo - specifies whether `A` is an upper or lower triangular matrix + * @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed + * @param diag - specifies whether `A` has a unit diagonal + * @param N - number of elements along each dimension in the matrix `A` + * @param A - input matrix + * @param strideA1 - stride of the first dimension of `A` + * @param strideA2 - stride of the first dimension of `A` + * @param offsetA - starting index for `A` + * @param x - input vector + * @param strideX - `x` stride length + * @param offsetX - starting index for `x` + * @returns `x` + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * + * var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); + * var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); + * + * ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); + * // x => [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] + */ + ndarray( uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Complex64Array, strideA1: number, strideA2: number, offsetA: number, x: Complex64Array, strideX: number, offsetX: number ): Complex64Array; +} + +/** +* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. +* +* @param order - storage layout +* @param uplo - specifies whether `A` is an upper or lower triangular matrix +* @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param diag - specifies whether `A` has a unit diagonal +* @param N - number of elements along each dimension in the matrix `A` +* @param A - input matrix +* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param x - input vector +* @param strideX - `x` stride length +* @returns `x` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* +* ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, A, 3, x, 1 ); +* // x => [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); +* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +* +* ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); +* // x => [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +*/ +declare var ctrsv: Routine; + + +// EXPORTS // + +export = ctrsv; diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/ctrsv/docs/types/test.ts new file mode 100644 index 000000000000..405eb52f0b03 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/docs/types/test.ts @@ -0,0 +1,375 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import Complex64Array = require( '@stdlib/array/complex64' ); +import ctrsv = require( './index' ); + + +// TESTS // + +// The function returns a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectType Complex64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv( 10, 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( true, 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( false, 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( null, 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( undefined, 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( [], 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( {}, 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( ( x: number ): number => x, 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv( 'row-major', 10, 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', true, 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', false, 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', null, 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', undefined, 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', [], 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', {}, 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', ( x: number ): number => x, 'no-transpose', 'non-unit', 10, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv( 'row-major', 'lower', 10, 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', true, 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', false, 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', null, 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', undefined, 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', [], 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', {}, 'non-unit', 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', ( x: number ): number => x, 'non-unit', 10, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv( 'row-major', 'lower', 'no-transpose', 10, 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', true, 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', false, 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', null, 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', undefined, 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', [], 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', {}, 10, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', ( x: number ): number => x, 10, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', '10', A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', true, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', false, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', null, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', undefined, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', [], A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', {}, A, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', ( x: number ): number => x, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, 10, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, '10', 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, true, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, false, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, null, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, undefined, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, [ '1' ], 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, {}, 10, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, ( x: number ): number => x, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, '10', x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, true, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, false, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, null, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, undefined, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, [], x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, {}, x, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, ( x: number ): number => x, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a Complex64Array... +{ + const A = new Complex64Array( 20 ); + + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, 10, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, '10', 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, true, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, false, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, null, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, undefined, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, [ '1' ], 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, {}, 1 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, '10' ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, true ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, false ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, null ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, undefined ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, [] ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, {} ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv(); // $ExpectError + ctrsv( 'row-major' ); // $ExpectError + ctrsv( 'row-major', 'lower' ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose' ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit' ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10 ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, x ); // $ExpectError + ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 10, A, 10, x, 1, 1 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectType Complex64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv.ndarray( 10, 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( true, 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( false, 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( null, 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( undefined, 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( [], 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( {}, 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( ( x: number ): number => x, 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv.ndarray( 'lower', 10, 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', true, 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', false, 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', null, 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', undefined, 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', [], 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', {}, 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', ( x: number ): number => x, 'non-unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a string... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv.ndarray( 'lower', 'no-transpose', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', true, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', false, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', null, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', undefined, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', [], 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', {}, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', ( x: number ): number => x, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', '10', A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', true, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', false, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', null, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', undefined, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', [], A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', {}, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', ( x: number ): number => x, A, 10, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, 10, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, '10', 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, true, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, false, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, null, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, undefined, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, [ '1' ], 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, {}, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, ( x: number ): number => x, 10, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, '10', 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, true, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, false, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, null, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, undefined, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, [], 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, {}, 1, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, ( x: number ): number => x, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, '10', 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, true, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, false, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, null, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, undefined, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, [], 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, {}, 0, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, ( x: number ): number => x, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, '10', x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, true, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, false, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, null, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, undefined, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, [], x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, {}, x, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, ( x: number ): number => x, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a Complex64Array... +{ + const A = new Complex64Array( 20 ); + + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, 10, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, '10', 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, true, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, false, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, null, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, undefined, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, [ '1' ], 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, {}, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, '10', 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, true, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, false, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, null, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, undefined, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, [], 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, {}, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eleventh argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, '10' ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, true ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, false ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, null ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, undefined ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, [] ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, {} ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctrsv.ndarray(); // $ExpectError + ctrsv.ndarray( 'lower' ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose' ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit' ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1 ); // $ExpectError + ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', 10, A, 10, 1, 0, x, 1, 0, 10 ); // $ExpectError +} From 125c2f781709625f4524ffcb1fecfa67c43086a5 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 09:46:17 +0000 Subject: [PATCH 21/40] docs: add repl file --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ctrsv/docs/repl.txt | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/docs/repl.txt diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/ctrsv/docs/repl.txt new file mode 100644 index 000000000000..6c85a8c2e432 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/docs/repl.txt @@ -0,0 +1,166 @@ + +{{alias}}( order, uplo, trans, diag, N, A, lda, x, sx ) + Solves one of the systems of equations `A*x = b` or `A^T*x = b` or + `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an + `N` by `N` unit, or non-unit, upper or lower triangular complex 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 `x` unchanged. + + Parameters + ---------- + order: string + Row-major (C-style) or column-major (Fortran-style) order. Must be + either 'row-major' or 'column-major'. + + uplo: string + Specifies whether `A` is an upper or lower triangular banded matrix. + + trans: string + Specifies whether `A` should be transposed, conjugate-transposed, or not + transposed. Accepted values typically include: 'no-transpose', + 'transpose', 'conjugate-transpose'. + + diag: string + Specifies whether `A` has a unit diagonal. + + N: integer + Number of elements along each dimension of `A`. + + A: Complex64Array + Input matrix. + + lda: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + x: Complex64Array + Input vector. + + sx: integer + Stride length for `x`. + + Returns + ------- + x: Complex64Array + Input vector. + + Examples + -------- + // Standard usage: + > var x = new {{alias:@stdlib/array/complex64}}([1.0,1.0,2.0,2.0,3.0,3.0]); + > var buf1 = [1.0,1.0,0.0,0.0,0.0,0.0]; + > var buf2 = [2.0,2.0,4.0,4.0,0.0,0.0]; + > var buf3 = [3.0,3.0,5.0,5.0,6.0,6.0]; + > var buf = buf1.concat( buf2, buf3 ); + > var A = new {{alias:@stdlib/array/complex64}}( buf ); + > var ord = 'row-major'; + > var uplo = 'lower'; + > var trans = 'no-transpose'; + > var diag = 'non-unit'; + > {{alias}}( ord, uplo, trans, diag, 3, A, 3, x, 1 ) + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] + + // Advanced indexing: + > x = new {{alias:@stdlib/array/complex64}}([3.0,3.0,2.0,2.0,1.0,1.0]); + > buf1 = [1.0,1.0,0.0,0.0,0.0,0.0]; + > buf2 = [2.0,2.0,4.0,4.0,0.0,0.0]; + > buf3 = [3.0,3.0,5.0,5.0,6.0,6.0]; + > buf = buf1.concat( buf2, buf3 ); + > A = new {{alias:@stdlib/array/complex64}}( buf ); + > ord = 'row-major'; + > uplo = 'lower'; + > trans = 'no-transpose'; + > diag = 'non-unit'; + > {{alias}}( ord, uplo, trans, diag, 3, A, 3, x, -1 ) + [ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ] + + // Using typed array views: + > var x0buf = [0.0,0.0,1.0,1.0,2.0,2.0,3.0,3.0]; + > var x0 = new {{alias:@stdlib/array/complex64}}( x0buf ); + > var x0bytes = x0.BYTES_PER_ELEMENT*1; + > var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, x0bytes ); + > buf1 = [1.0,1.0,0.0,0.0,0.0,0.0]; + > buf2 = [2.0,2.0,4.0,4.0,0.0,0.0]; + > buf3 = [3.0,3.0,5.0,5.0,6.0,6.0]; + > buf = buf1.concat( buf2, buf3 ); + > A = new {{alias:@stdlib/array/complex64}}( buf ); + > ord = 'row-major'; + > uplo = 'lower'; + > trans = 'no-transpose'; + > diag = 'non-unit'; + > {{alias}}( ord, uplo, trans, diag, 3, A, 3, x1, 1 ) + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] + + +{{alias}}.ndarray( uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox ) + Solves one of the systems of equations `A*x = b` or `A^T*x = b` or + `A^H*x = b` using alternative indexing semantics and where `b` and `x` are + `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, + upper or lower triangular complex matrix. + + While typed array views mandate a view offset based on the underlying buffer + , the offset parameters support indexing semantics based on starting + indices. + + Parameters + ---------- + uplo: string + Specifies whether `A` is an upper or lower triangular banded matrix. + + trans: string + Specifies whether `A` should be transposed, conjugate-transposed, or not + transposed. Accepted values typically include: 'no-transpose', + 'transpose', 'conjugate-transpose'. + + diag: string + Specifies whether `A` has a unit diagonal. + + N: integer + Number of elements along each dimension of `A`. + + A: Complex64Array + Input matrix. + + sa1: integer + Stride of the first dimension of `A`. + + sa2: integer + Stride of the second dimension of `A`. + + oa: integer + Starting index (offset) for `A`. + + x: Complex64Array + Input vector. + + sx: integer + Index increment for `x`. + + ox: integer + Starting index (offset) for `x`. + + Returns + ------- + x: Complex64Array + Input vector. + + Examples + -------- + > x = new {{alias:@stdlib/array/complex64}}([1.0,1.0,2.0,2.0,3.0,3.0]); + > buf1 = [1.0,1.0,0.0,0.0,0.0,0.0]; + > buf2 = [2.0,2.0,4.0,4.0,0.0,0.0]; + > buf3 = [3.0,3.0,5.0,5.0,6.0,6.0]; + > buf = buf1.concat( buf2, buf3 ); + > A = new {{alias:@stdlib/array/complex64}}( buf ); + > ord = 'row-major'; + > uplo = 'lower'; + > trans = 'no-transpose'; + > diag = 'non-unit'; + > {{alias}}.ndarray( uplo, trans, diag, 3, A, 3, 1, 0, x, 1, 0 ) + [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] + + See Also + -------- From e646e11ce4c2f6d573525dc51fbe18553e01a7c1 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 09:51:31 +0000 Subject: [PATCH 22/40] docs: add example --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ctrsv/examples/index.js | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/examples/index.js diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/examples/index.js b/lib/node_modules/@stdlib/blas/base/ctrsv/examples/index.js new file mode 100644 index 000000000000..f5263dbda2cc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/examples/index.js @@ -0,0 +1,51 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var logEach = require( '@stdlib/console/log-each' ); +var ctrsv = require( './../lib' ); + +function rand() { + return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); +} + +var N = 3; + +// Create random vectors: +var x = filledarrayBy( N, 'complex64', rand ); +console.log( x.get( 0 ).toString() ); + +// Define N-by-N banded matrix in compact format: +var A = filledarrayBy( N*N, 'complex64', rand ); +console.log( A.get( 0 ).toString() ); + +// Solves one of the matrix-vector operations `x := A*x`: +ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', N, A, N, x, 1 ); + +// Print the results: +logEach( '(%s)', x ); + +// Performs one of the matrix-vector operations `x := A*x` using alternative indexing semantics: +ctrsv.ndarray( 'upper', 'no-transpose', 'unit', N, A, N, 1, 0, x, 1, 0 ); + +// Print the results: +logEach( '(%s)', x ); From cfea9c5012375376e72f27f382fbb114d32c186f Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 09:56:30 +0000 Subject: [PATCH 23/40] bench: add benchmarks --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/ctrsv/benchmark/benchmark.js | 115 ++++++++++++++++++ .../base/ctrsv/benchmark/benchmark.ndarray.js | 115 ++++++++++++++++++ 2 files changed, 230 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.js new file mode 100644 index 000000000000..90fc4675d818 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.js @@ -0,0 +1,115 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var ctrsv = require( './../lib/ctrsv.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var xbuf; + var Abuf; + var A; + var x; + + xbuf = uniform( N*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + + Abuf = uniform( N*N*2, -100.0, 100.0, options ); + A = new Complex64Array( Abuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + var z; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = ctrsv( 'row-major', 'upper', 'transpose', 'non-unit', N, A, N, x, 1 ); + if ( isnanf( z[ i % ( z.length ) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z[ i % ( z.length ) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( format( '%s:size=%d', pkg, N*N ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..1713500509d2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.ndarray.js @@ -0,0 +1,115 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var ctrsv = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var xbuf; + var Abuf; + var A; + var x; + + xbuf = uniform( N*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + + Abuf = uniform( N*N*2, -100.0, 100.0, options ); + A = new Complex64Array( Abuf.buffer ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + var z; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = ctrsv( 'upper', 'transpose', 'non-unit', N, A, N, 1, 0, x, 1, 0 ); + if ( isnanf( z[ i%(z.length) ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z[ i%(z.length) ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( format( '%s:ndarray:size=%d', pkg, N*N ), f ); + } +} + +main(); From 8f17b92d3fc653ff523b0f2bb6929289f92bbbb8 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 13:17:02 +0000 Subject: [PATCH 24/40] docs: adds readme file --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: 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/ctrsv/README.md | 269 ++++++++++++++++++ 1 file changed, 269 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctrsv/README.md diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/README.md b/lib/node_modules/@stdlib/blas/base/ctrsv/README.md new file mode 100644 index 000000000000..10de31a46b38 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/README.md @@ -0,0 +1,269 @@ + + +# ctrsv + +> Solve one of the systems of equations `x = A*x` or `x = A^T*x` or `x = A^H*x`. + + +
+ +## Usage + +```javascript +var ctrsv = require( '@stdlib/blas/base/ctrsv' ); +``` + +#### ctrsv( order, uplo, trans, diag, N, A, LDA, x, sx ) + +Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); // eslint-disable-line max-params, max-len +var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); + +ctrsv( 'row-major', 'lower', 'no-transpose', 'unit', 3, A, 3, x, 1 ); +// x => [ 1.0, 1.0, 2.0, -2.0, -17.0, -3.0 ] +``` + +The function has the following parameters: + +- **order**: storage layout. +- **uplo**: specifies whether `A` is an upper or lower triangular matrix. +- **trans**: specifies whether `A` should be transposed, conjugate-transposed, or not transposed. +- **diag**: specifies whether `A` has a unit diagonal. +- **N**: number of elements along each dimension of `A`. +- **A**: input band matrix stored in linear memory as a [`Complex64Array`][@stdlib/array/complex64]. The band matrix is first stored in compact band form, where only the diagonals within the bandwidth are kept, and is then laid out sequentially in linear memory. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **x**: input [`Complex64Array`][@stdlib/array/complex64]. +- **sx**: stride length for `x`. + +The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); // eslint-disable-line max-params, max-len +var x = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); // eslint-disable-line max-params, max-len + +ctrsv( 'row-major', 'lower', 'no-transpose', 'unit', 3, A, 3, x, -1 ); +// x => [ -17.0, -3.0, 2.0, -2.0, 1.0, 1.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +// Initial arrays... +var x0 = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); // eslint-disable-line max-params, max-len +var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); // eslint-disable-line max-params, max-len + +// Create offset views... +var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd complex element + +ctrsv( 'row-major', 'lower', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); +// x1 => [ 1.0, 1.0, 2.0, -2.0, -17.0, -3.0 ] +``` + + + +#### ctrsv.ndarray( uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox ) + +Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b`, using alternative indexing semantics and where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); // eslint-disable-line max-params, max-len +var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); + +ctrsv.ndarray( 'lower', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); +// x => [ 1.0, 1.0, 2.0, -2.0, -17.0, -3.0 ] +``` + +The function has the following additional parameters: + +- **sa1**: stride of the first dimension of `A`. +- **sa2**: stride of the second dimension of `A`. +- **oa**: starting index for `A`. +- **ox**: starting index for `x`. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); // eslint-disable-line max-params, max-len +var x = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); // eslint-disable-line max-params, max-len + +ctrsv.ndarray( 'lower', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); +// x => [ -17.0, -3.0, 2.0, -2.0, 1.0, 1.0 ] +``` + +
+ + + +
+ +## Notes + +- `ctrsv()` corresponds to the [BLAS][blas] level 2 function [`ctrsv`][ctrsv]. +- Neither routine tests for singularity or near-singularity. Such tests must be performed before calling the routines. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var logEach = require( '@stdlib/console/log-each' ); +var ctrsv = require( '@stdlib/blas/base/ctrsv' ); + +function rand() { + return new Complex64( discreteUniform( 0, 255 ), discreteUniform( -128, 127 ) ); // eslint-disable-line max-params, max-len +} + +var N = 3; + +var A = filledarrayBy( N*N, 'complex64', rand ); +var x = filledarrayBy( N, 'complex64', rand ); + +ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', N, A, N, x, 1 ); + +// Print the results: +logEach( '(%s)', x ); + +ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', N, A, N, 1, 0, x, 2, 1 ); // eslint-disable-line max-params, max-len + +// Print the results: +logEach( '(%s)', x ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + From 7b72a4de13adde369aead58bd388f644e37a26b0 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 13:41:21 +0000 Subject: [PATCH 25/40] fix: fix comment --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/ctrsv/examples/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/examples/index.js b/lib/node_modules/@stdlib/blas/base/ctrsv/examples/index.js index f5263dbda2cc..0a2d9bca769d 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/examples/index.js @@ -44,7 +44,7 @@ ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', N, A, N, x, 1 ); // Print the results: logEach( '(%s)', x ); -// Performs one of the matrix-vector operations `x := A*x` using alternative indexing semantics: +// Solve one of the systems of equations `x := A*x` using alternative indexing semantics: ctrsv.ndarray( 'upper', 'no-transpose', 'unit', N, A, N, 1, 0, x, 1, 0 ); // Print the results: From febb477d8de3230728b4c4c83c9bfb9832a24eb2 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 13:55:01 +0000 Subject: [PATCH 26/40] test: improves test coverage --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/ctrsv/test/fixtures/column_major_l_ct_nu.json | 4 ++-- .../blas/base/ctrsv/test/fixtures/row_major_l_ct_nu.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_ct_nu.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_ct_nu.json index f6196995aa99..336ff7924e1e 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_ct_nu.json +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/column_major_l_ct_nu.json @@ -14,8 +14,8 @@ "strideA1": 1, "strideA2": 3, "offsetA": 0, - "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "x": [ 0.0, 1.0, 0.0, 2.0, 0.0, 3.0 ], "strideX": 1, "offsetX": 0, - "x_out": [ 0.0, -0.25, 0.0, -0.125, 0.0, 0.5 ] + "x_out": [ 0.125, -0.125, 0.0625, -0.0625, -0.25, 0.25 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_ct_nu.json b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_ct_nu.json index 12f82791b370..8ff721f4ac3f 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_ct_nu.json +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/fixtures/row_major_l_ct_nu.json @@ -14,8 +14,8 @@ "strideA1": 3, "strideA2": 1, "offsetA": 0, - "x": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + "x": [ 0.0, 1.0, 0.0, 2.0, 0.0, 3.0 ], "strideX": 1, "offsetX": 0, - "x_out": [ 0.0, -0.25, 0.0, -0.125, 0.0, 0.5 ] + "x_out": [ 0.125, -0.125, 0.0625, -0.0625, -0.25, 0.25 ] } From 0e99a058fbba7daf4e5c60408853b7878969ab3e Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 14:09:52 +0000 Subject: [PATCH 27/40] refactor: updates x vector index to increment with loop pointer directly --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ctrsv/lib/base.js | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js index 649c22175842..983764d19ff9 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js @@ -118,8 +118,8 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ( !isrm && uplo === 'upper' && trans === 'no-transpose' ) || ( isrm && uplo === 'lower' && trans !== 'no-transpose' ) ) { - ix1 = ox + ( ( N - 1 ) * sx ); for ( i1 = N - 1; i1 >= 0; i1-- ) { + ix1 = ox + ( i1 * sx ); rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; if ( rex !== 0.0 || imx !== 0.0 ) { @@ -137,9 +137,8 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX retmp = rex; imtmp = imx; } - ix0 = ix1; for ( i0 = i1 - 1; i0 >= 0; i0-- ) { - ix0 -= sx; + ix0 = ox + ( i0 * sx ); ia = oa2 + ( sa0 * i0 ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; @@ -151,7 +150,6 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX viewX[ ix0 + 1 ] = f32( imx - immul ); } } - ix1 -= sx; } return x; } @@ -159,8 +157,8 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ( !isrm && uplo === 'lower' && trans === 'no-transpose' ) || ( isrm && uplo === 'upper' && trans !== 'no-transpose' ) ) { - ix1 = ox; for ( i1 = 0; i1 < N; i1++ ) { + ix1 = ox + ( i1 * sx ); rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; if ( rex !== 0.0 || imx !== 0.0 ) { @@ -178,9 +176,8 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX retmp = rex; imtmp = imx; } - ix0 = ix1; for ( i0 = i1 + 1; i0 < N; i0++ ) { - ix0 += sx; + ix0 = ox + ( i0 * sx ); ia = oa2 + ( sa0 * i0 ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; @@ -192,7 +189,6 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX viewX[ ix0 + 1 ] = f32( imx - immul ); } } - ix1 += sx; } return x; } @@ -200,15 +196,15 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ( !isrm && uplo === 'upper' && trans !== 'no-transpose' ) || ( isrm && uplo === 'lower' && trans === 'no-transpose' ) ) { - ix1 = ox; for ( i1 = 0; i1 < N; i1++ ) { + ix1 = ox + ( i1 * sx ); oa2 = oa + ( sa1 * i1 ); rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; retmp = rex; imtmp = imx; - ix0 = ox; for ( i0 = 0; i0 < i1; i0++ ) { + ix0 = ox + ( i0 * sx ); ia = oa2 + ( sa0 * i0 ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; @@ -216,7 +212,6 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX imx = viewX[ ix0 + 1 ]; retmp -= f32( ( rex * rea ) - ( imx * ima ) ); imtmp -= f32( ( rex * ima ) + ( imx * rea ) ); - ix0 += sx; } if ( nonunit ) { ia = oa2 + ( sa0 * i1 ); @@ -230,20 +225,19 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX } viewX[ ix1 ] = retmp; viewX[ ix1 + 1 ] = imtmp; - ix1 += sx; } return x; } // ( !isrm && uplo === 'lower' && trans !== 'no-transpose' ) || ( isrm && uplo === 'upper' && trans === 'no-transpose' ) - ix1 = ox + ( ( N - 1 ) * sx ); for ( i1 = N - 1; i1 >= 0; i1-- ) { + ix1 = ox + ( i1 * sx ); oa2 = oa + ( sa1 * i1 ); rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; retmp = rex; imtmp = imx; - ix0 = ox + ( ( N - 1 ) * sx ); for ( i0 = N - 1; i0 > i1; i0-- ) { + ix0 = ox + ( i0 * sx ); ia = oa2 + ( sa0 * i0 ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; @@ -251,7 +245,6 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX imx = viewX[ ix0 + 1 ]; retmp -= f32( ( rex * rea ) - ( imx * ima ) ); imtmp -= f32( ( rex * ima ) + ( imx * rea ) ); - ix0 -= sx; } if ( nonunit ) { ia = oa2 + ( sa0 * i1 ); @@ -265,7 +258,6 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX } viewX[ ix1 ] = retmp; viewX[ ix1 + 1 ] = imtmp; - ix1 -= sx; } return x; } From 383d6af07668a2b873199c4bdd4a1bb36e87c7c0 Mon Sep 17 00:00:00 2001 From: Divit Date: Wed, 15 Apr 2026 07:03:01 +0000 Subject: [PATCH 28/40] test: remove strideA1 and strideA2 validations and tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ctrsv/lib/ndarray.js | 8 --- .../blas/base/ctrsv/test/test.ndarray.js | 56 ------------------- 2 files changed, 64 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ndarray.js index 79e1a3e2a22a..a6a839c6fda9 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ndarray.js @@ -47,8 +47,6 @@ var base = require( './base.js' ); * @throws {TypeError} second argument must be a valid transpose operation * @throws {TypeError} third argument must be a valid diagonal type * @throws {RangeError} fourth argument must be a nonnegative integer -* @throws {RangeError} sixth argument must be non-zero -* @throws {RangeError} seventh argument must be non-zero * @throws {RangeError} tenth argument must be non-zero * @returns {Complex64Array} `x` * @@ -74,12 +72,6 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX if ( N < 0 ) { throw new RangeError( format( 'invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.', N ) ); } - if ( strideA1 === 0 ) { - throw new RangeError( format( 'invalid argument. Sixth argument must be non-zero. Value: `%d`.', strideA1 ) ); - } - if ( strideA2 === 0 ) { - throw new RangeError( format( 'invalid argument. Seventh argument must be non-zero. Value: `%d`.', strideA2 ) ); - } if ( strideX === 0 ) { throw new RangeError( format( 'invalid argument. Tenth argument must be non-zero. Value: `%d`.', strideX ) ); } diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js index f2b4b9f8fd78..c06fadc8caec 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js @@ -204,62 +204,6 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun } }); -tape( 'the function throws an error if provided an invalid sixth argument', function test( t ) { - var values; - var data; - var i; - var a; - var x; - - data = rlntnu; - - a = new Complex64Array( data.A ); - x = new Complex64Array( data.x ); - - 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() { - ctrsv( data.uplo, data.trans, data.diag, data.N, a, value, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - }; - } -}); - -tape( 'the function throws an error if provided an invalid seventh argument', function test( t ) { - var values; - var data; - var i; - var a; - var x; - - data = rlntnu; - - a = new Complex64Array( data.A ); - x = new Complex64Array( data.x ); - - 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() { - ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, value, data.offsetA, x, data.strideX, data.offsetX ); - }; - } -}); - tape( 'the function throws an error if provided an invalid tenth argument', function test( t ) { var values; var data; From 5ad9f8ea24ae7a146793361e12469bae14bd6833 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 16 Apr 2026 17:27:31 +0000 Subject: [PATCH 29/40] refactor: update x index recalculation to stride addition --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ctrsv/lib/base.js | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js index 983764d19ff9..649c22175842 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js @@ -118,8 +118,8 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ( !isrm && uplo === 'upper' && trans === 'no-transpose' ) || ( isrm && uplo === 'lower' && trans !== 'no-transpose' ) ) { + ix1 = ox + ( ( N - 1 ) * sx ); for ( i1 = N - 1; i1 >= 0; i1-- ) { - ix1 = ox + ( i1 * sx ); rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; if ( rex !== 0.0 || imx !== 0.0 ) { @@ -137,8 +137,9 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX retmp = rex; imtmp = imx; } + ix0 = ix1; for ( i0 = i1 - 1; i0 >= 0; i0-- ) { - ix0 = ox + ( i0 * sx ); + ix0 -= sx; ia = oa2 + ( sa0 * i0 ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; @@ -150,6 +151,7 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX viewX[ ix0 + 1 ] = f32( imx - immul ); } } + ix1 -= sx; } return x; } @@ -157,8 +159,8 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ( !isrm && uplo === 'lower' && trans === 'no-transpose' ) || ( isrm && uplo === 'upper' && trans !== 'no-transpose' ) ) { + ix1 = ox; for ( i1 = 0; i1 < N; i1++ ) { - ix1 = ox + ( i1 * sx ); rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; if ( rex !== 0.0 || imx !== 0.0 ) { @@ -176,8 +178,9 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX retmp = rex; imtmp = imx; } + ix0 = ix1; for ( i0 = i1 + 1; i0 < N; i0++ ) { - ix0 = ox + ( i0 * sx ); + ix0 += sx; ia = oa2 + ( sa0 * i0 ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; @@ -189,6 +192,7 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX viewX[ ix0 + 1 ] = f32( imx - immul ); } } + ix1 += sx; } return x; } @@ -196,15 +200,15 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ( !isrm && uplo === 'upper' && trans !== 'no-transpose' ) || ( isrm && uplo === 'lower' && trans === 'no-transpose' ) ) { + ix1 = ox; for ( i1 = 0; i1 < N; i1++ ) { - ix1 = ox + ( i1 * sx ); oa2 = oa + ( sa1 * i1 ); rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; retmp = rex; imtmp = imx; + ix0 = ox; for ( i0 = 0; i0 < i1; i0++ ) { - ix0 = ox + ( i0 * sx ); ia = oa2 + ( sa0 * i0 ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; @@ -212,6 +216,7 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX imx = viewX[ ix0 + 1 ]; retmp -= f32( ( rex * rea ) - ( imx * ima ) ); imtmp -= f32( ( rex * ima ) + ( imx * rea ) ); + ix0 += sx; } if ( nonunit ) { ia = oa2 + ( sa0 * i1 ); @@ -225,19 +230,20 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX } viewX[ ix1 ] = retmp; viewX[ ix1 + 1 ] = imtmp; + ix1 += sx; } return x; } // ( !isrm && uplo === 'lower' && trans !== 'no-transpose' ) || ( isrm && uplo === 'upper' && trans === 'no-transpose' ) + ix1 = ox + ( ( N - 1 ) * sx ); for ( i1 = N - 1; i1 >= 0; i1-- ) { - ix1 = ox + ( i1 * sx ); oa2 = oa + ( sa1 * i1 ); rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; retmp = rex; imtmp = imx; + ix0 = ox + ( ( N - 1 ) * sx ); for ( i0 = N - 1; i0 > i1; i0-- ) { - ix0 = ox + ( i0 * sx ); ia = oa2 + ( sa0 * i0 ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; @@ -245,6 +251,7 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX imx = viewX[ ix0 + 1 ]; retmp -= f32( ( rex * rea ) - ( imx * ima ) ); imtmp -= f32( ( rex * ima ) + ( imx * rea ) ); + ix0 -= sx; } if ( nonunit ) { ia = oa2 + ( sa0 * i1 ); @@ -258,6 +265,7 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX } viewX[ ix1 ] = retmp; viewX[ ix1 + 1 ] = imtmp; + ix1 -= sx; } return x; } From 535ec3a7000f207201f17a1fae935e863846a49f Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 16 Apr 2026 17:30:55 +0000 Subject: [PATCH 30/40] refactor: improve float32 precision for addition assignment --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js index 649c22175842..88f51ba7ded8 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js @@ -214,8 +214,8 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0 + 1 ]; - retmp -= f32( ( rex * rea ) - ( imx * ima ) ); - imtmp -= f32( ( rex * ima ) + ( imx * rea ) ); + retmp = f32( retmp - f32( ( rex * rea ) - ( imx * ima ) ) ); + imtmp = f32( imtmp - f32( ( rex * ima ) + ( imx * rea ) ) ); ix0 += sx; } if ( nonunit ) { @@ -249,8 +249,8 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0 + 1 ]; - retmp -= f32( ( rex * rea ) - ( imx * ima ) ); - imtmp -= f32( ( rex * ima ) + ( imx * rea ) ); + retmp = f32( retmp - f32( ( rex * rea ) - ( imx * ima ) ) ); + imtmp = f32( imtmp - f32( ( rex * ima ) + ( imx * rea ) ) ); ix0 -= sx; } if ( nonunit ) { From 7b6fb6bfc87b74706458e9a3ac80ce3cdb925822 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 16 Apr 2026 18:57:59 +0000 Subject: [PATCH 31/40] refactor: update a index recalculation to stride addition --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ctrsv/lib/base.js | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js index 88f51ba7ded8..68e23a0057cd 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js @@ -62,6 +62,7 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX var magsq; var remul; var immul; + var ixend; var isrm; var sign; var rex; @@ -119,13 +120,13 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ( isrm && uplo === 'lower' && trans !== 'no-transpose' ) ) { ix1 = ox + ( ( N - 1 ) * sx ); + oa2 = oa + ( ( sa1 + sa0 ) * ( N - 1 ) ); for ( i1 = N - 1; i1 >= 0; i1-- ) { rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; if ( rex !== 0.0 || imx !== 0.0 ) { - oa2 = oa + ( sa1 * i1 ); if ( nonunit ) { - ia = oa2 + ( sa0 * i1 ); + ia = oa2; rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; magsq = f32( ( rea * rea ) + ( ima * ima ) ); @@ -137,10 +138,9 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX retmp = rex; imtmp = imx; } - ix0 = ix1; + ia = oa2 - sa0; + ix0 = ix1 - sx; for ( i0 = i1 - 1; i0 >= 0; i0-- ) { - ix0 -= sx; - ia = oa2 + ( sa0 * i0 ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; @@ -149,8 +149,11 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX immul = f32( ( retmp * ima ) + ( imtmp * rea ) ); viewX[ ix0 ] = f32( rex - remul ); viewX[ ix0 + 1 ] = f32( imx - immul ); + ix0 -= sx; + ia -= sa0; } } + oa2 -= ( sa1 + sa0 ); ix1 -= sx; } return x; @@ -160,13 +163,13 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ( isrm && uplo === 'upper' && trans !== 'no-transpose' ) ) { ix1 = ox; + oa2 = oa; for ( i1 = 0; i1 < N; i1++ ) { rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; if ( rex !== 0.0 || imx !== 0.0 ) { - oa2 = oa + ( sa1 * i1 ); if ( nonunit ) { - ia = oa2 + ( sa0 * i1 ); + ia = oa2; rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; magsq = f32( ( rea * rea ) + ( ima * ima ) ); @@ -178,10 +181,9 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX retmp = rex; imtmp = imx; } - ix0 = ix1; + ia = oa2 + sa0; + ix0 = ix1 + sx; for ( i0 = i1 + 1; i0 < N; i0++ ) { - ix0 += sx; - ia = oa2 + ( sa0 * i0 ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; @@ -190,8 +192,11 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX immul = f32( ( retmp * ima ) + ( imtmp * rea ) ); viewX[ ix0 ] = f32( rex - remul ); viewX[ ix0 + 1 ] = f32( imx - immul ); + ia += sa0; + ix0 += sx; } } + oa2 += ( sa1 + sa0 ); ix1 += sx; } return x; @@ -201,15 +206,15 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ( isrm && uplo === 'lower' && trans === 'no-transpose' ) ) { ix1 = ox; + oa2 = oa; for ( i1 = 0; i1 < N; i1++ ) { - oa2 = oa + ( sa1 * i1 ); rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; retmp = rex; imtmp = imx; ix0 = ox; + ia = oa2; for ( i0 = 0; i0 < i1; i0++ ) { - ia = oa2 + ( sa0 * i0 ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; @@ -217,9 +222,9 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX retmp = f32( retmp - f32( ( rex * rea ) - ( imx * ima ) ) ); imtmp = f32( imtmp - f32( ( rex * ima ) + ( imx * rea ) ) ); ix0 += sx; + ia += sa0; } if ( nonunit ) { - ia = oa2 + ( sa0 * i1 ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; magsq = f32( ( rea * rea ) + ( ima * ima ) ); @@ -231,30 +236,32 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX viewX[ ix1 ] = retmp; viewX[ ix1 + 1 ] = imtmp; ix1 += sx; + oa2 += sa1; } return x; } // ( !isrm && uplo === 'lower' && trans !== 'no-transpose' ) || ( isrm && uplo === 'upper' && trans === 'no-transpose' ) ix1 = ox + ( ( N - 1 ) * sx ); + oa2 = oa + ( ( sa1 + sa0 ) * ( N - 1 ) ); + ixend = ox + ( ( N - 1 ) * sx ); for ( i1 = N - 1; i1 >= 0; i1-- ) { - oa2 = oa + ( sa1 * i1 ); rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; retmp = rex; imtmp = imx; - ix0 = ox + ( ( N - 1 ) * sx ); + ix0 = ixend; + ia = oa2; for ( i0 = N - 1; i0 > i1; i0-- ) { - ia = oa2 + ( sa0 * i0 ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0 + 1 ]; retmp = f32( retmp - f32( ( rex * rea ) - ( imx * ima ) ) ); imtmp = f32( imtmp - f32( ( rex * ima ) + ( imx * rea ) ) ); + ia -= sa0; ix0 -= sx; } if ( nonunit ) { - ia = oa2 + ( sa0 * i1 ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; magsq = f32( ( rea * rea ) + ( ima * ima ) ); @@ -266,6 +273,7 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX viewX[ ix1 ] = retmp; viewX[ ix1 + 1 ] = imtmp; ix1 -= sx; + oa2 -= sa1; } return x; } From 633f30bbcc71bdbf133a040a1ee9711e7ee396a2 Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 16 Apr 2026 19:02:59 +0000 Subject: [PATCH 32/40] chore: varible updated --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js index 68e23a0057cd..3339c991f5e9 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js @@ -242,8 +242,8 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX } // ( !isrm && uplo === 'lower' && trans !== 'no-transpose' ) || ( isrm && uplo === 'upper' && trans === 'no-transpose' ) ix1 = ox + ( ( N - 1 ) * sx ); + ixend = ix1; oa2 = oa + ( ( sa1 + sa0 ) * ( N - 1 ) ); - ixend = ox + ( ( N - 1 ) * sx ); for ( i1 = N - 1; i1 >= 0; i1-- ) { rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; From 30b7d831ec43c73b810fdd651abd804baa3367cf Mon Sep 17 00:00:00 2001 From: Divit Date: Thu, 16 Apr 2026 19:15:29 +0000 Subject: [PATCH 33/40] chore: clean up --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js index 3339c991f5e9..28b8ab29cc57 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js @@ -65,6 +65,7 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX var ixend; var isrm; var sign; + var doa2; var rex; var imx; var rea; @@ -115,12 +116,14 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX // Vector strides sx = strideX * 2; + doa2 = sa1 + sa0; + if ( ( !isrm && uplo === 'upper' && trans === 'no-transpose' ) || ( isrm && uplo === 'lower' && trans !== 'no-transpose' ) ) { ix1 = ox + ( ( N - 1 ) * sx ); - oa2 = oa + ( ( sa1 + sa0 ) * ( N - 1 ) ); + oa2 = oa + ( doa2 * ( N - 1 ) ); for ( i1 = N - 1; i1 >= 0; i1-- ) { rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; @@ -153,7 +156,7 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ia -= sa0; } } - oa2 -= ( sa1 + sa0 ); + oa2 -= doa2; ix1 -= sx; } return x; @@ -196,7 +199,7 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ix0 += sx; } } - oa2 += ( sa1 + sa0 ); + oa2 += doa2; ix1 += sx; } return x; @@ -243,7 +246,7 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX // ( !isrm && uplo === 'lower' && trans !== 'no-transpose' ) || ( isrm && uplo === 'upper' && trans === 'no-transpose' ) ix1 = ox + ( ( N - 1 ) * sx ); ixend = ix1; - oa2 = oa + ( ( sa1 + sa0 ) * ( N - 1 ) ); + oa2 = oa + ( doa2 * ( N - 1 ) ); for ( i1 = N - 1; i1 >= 0; i1-- ) { rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; From a62eb37f36cc7851fff1169256f643b24c13bdbb Mon Sep 17 00:00:00 2001 From: Divit Date: Sat, 18 Apr 2026 18:30:56 +0000 Subject: [PATCH 34/40] chore: clean up in docs --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: 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 --- --- .../blas/base/ctrsv/benchmark/benchmark.js | 4 ++-- .../base/ctrsv/benchmark/benchmark.ndarray.js | 4 ++-- .../@stdlib/blas/base/ctrsv/docs/repl.txt | 18 ++++++++---------- .../blas/base/ctrsv/docs/types/index.d.ts | 6 +++--- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.js index 90fc4675d818..e29b003c40ea 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.js @@ -74,12 +74,12 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { z = ctrsv( 'row-major', 'upper', 'transpose', 'non-unit', N, A, N, x, 1 ); - if ( isnanf( z[ i % ( z.length ) ] ) ) { + if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnanf( z[ i % ( z.length ) ] ) ) { + if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.ndarray.js index 1713500509d2..9a3bf2bb98c9 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/benchmark/benchmark.ndarray.js @@ -74,12 +74,12 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { z = ctrsv( 'upper', 'transpose', 'non-unit', N, A, N, 1, 0, x, 1, 0 ); - if ( isnanf( z[ i%(z.length) ] ) ) { + if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnanf( z[ i%(z.length) ] ) ) { + if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/ctrsv/docs/repl.txt index 6c85a8c2e432..687ba4125f8f 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/docs/repl.txt @@ -1,8 +1,8 @@ {{alias}}( order, uplo, trans, diag, N, A, lda, x, sx ) Solves one of the systems of equations `A*x = b` or `A^T*x = b` or - `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an - `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. + `A^H*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by + `N` unit, or non-unit, upper or lower triangular matrix. Indexing is relative to the first index. To introduce an offset, use typed array views. @@ -20,8 +20,7 @@ trans: string Specifies whether `A` should be transposed, conjugate-transposed, or not - transposed. Accepted values typically include: 'no-transpose', - 'transpose', 'conjugate-transpose'. + transposed. diag: string Specifies whether `A` has a unit diagonal. @@ -98,11 +97,11 @@ {{alias}}.ndarray( uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox ) Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` using alternative indexing semantics and where `b` and `x` are - `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, - upper or lower triangular complex matrix. + `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or + lower triangular matrix. - While typed array views mandate a view offset based on the underlying buffer - , the offset parameters support indexing semantics based on starting + While typed array views mandate a view offset based on the underlying + buffer, the offset parameters support indexing semantics based on starting indices. Parameters @@ -112,8 +111,7 @@ trans: string Specifies whether `A` should be transposed, conjugate-transposed, or not - transposed. Accepted values typically include: 'no-transpose', - 'transpose', 'conjugate-transpose'. + transposed. diag: string Specifies whether `A` has a unit diagonal. diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/ctrsv/docs/types/index.d.ts index 05e06080a566..c4f9f13ec8f0 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/docs/types/index.d.ts @@ -28,7 +28,7 @@ import { Complex64Array } from '@stdlib/types/array'; */ interface Routine { /** - * Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. + * Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param order - storage layout * @param uplo - specifies whether `A` is an upper or lower triangular matrix @@ -53,7 +53,7 @@ interface Routine { ( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Complex64Array, LDA: number, x: Complex64Array, strideX: number ): Complex64Array; /** - * Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` using alternative indexing semantics and where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. + * Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` using alternative indexing semantics and where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param uplo - specifies whether `A` is an upper or lower triangular matrix * @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed @@ -81,7 +81,7 @@ interface Routine { } /** -* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. +* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param order - storage layout * @param uplo - specifies whether `A` is an upper or lower triangular matrix From 3382c5338dc14e8beb68178d0cd9f817637ffff5 Mon Sep 17 00:00:00 2001 From: Divit Date: Sat, 18 Apr 2026 18:32:07 +0000 Subject: [PATCH 35/40] chore: clean up in examples --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ctrsv/examples/index.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/examples/index.js b/lib/node_modules/@stdlib/blas/base/ctrsv/examples/index.js index 0a2d9bca769d..642cb9200545 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/examples/index.js @@ -30,22 +30,15 @@ function rand() { var N = 3; -// Create random vectors: var x = filledarrayBy( N, 'complex64', rand ); -console.log( x.get( 0 ).toString() ); - -// Define N-by-N banded matrix in compact format: var A = filledarrayBy( N*N, 'complex64', rand ); -console.log( A.get( 0 ).toString() ); -// Solves one of the matrix-vector operations `x := A*x`: ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', N, A, N, x, 1 ); // Print the results: -logEach( '(%s)', x ); +logEach( '%s', x ); -// Solve one of the systems of equations `x := A*x` using alternative indexing semantics: ctrsv.ndarray( 'upper', 'no-transpose', 'unit', N, A, N, 1, 0, x, 1, 0 ); // Print the results: -logEach( '(%s)', x ); +logEach( '%s', x ); From 9afb978226fee4710b1439b9ce4f4e0ca596d2c3 Mon Sep 17 00:00:00 2001 From: Divit Date: Sat, 18 Apr 2026 18:43:39 +0000 Subject: [PATCH 36/40] chore: clean up in lib --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ctrsv/lib/base.js | 139 ++++++++---------- .../@stdlib/blas/base/ctrsv/lib/ctrsv.js | 2 +- .../@stdlib/blas/base/ctrsv/lib/index.js | 2 +- .../@stdlib/blas/base/ctrsv/lib/ndarray.js | 2 +- 4 files changed, 68 insertions(+), 77 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js index 28b8ab29cc57..311b7c9ca383 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js @@ -28,7 +28,7 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' ); // MAIN // /** -* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. +* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @private * @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix @@ -82,61 +82,52 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX var i1; var ia; - // Layout - isrm = isRowMajor( [ strideA1, strideA2 ] ); + // Note on variable naming convention: sa#, ix#, i# where # corresponds to the loop number, with `0` being the innermost loop... - // Diagonal + isrm = isRowMajor( [ strideA1, strideA2 ] ); nonunit = ( diag === 'non-unit' ); - // Reinterpret arrays to raw numeric views + if ( isrm ) { + // For row-major matrices, the last dimension has the fastest changing index... + sa0 = strideA2 * 2; // stride increment for innermost loop + sa1 = strideA1 * 2; // stride increment for outermost loop + } else { // isColMajor + // For column-major matrices, the first dimension has the fastest changing index... + sa0 = strideA1 * 2; // stride increment for innermost loop + sa1 = strideA2 * 2; // stride increment for outermost loop + } + // Reinterpret arrays to real-valued views viewA = reinterpret( A, 0 ); viewX = reinterpret( x, 0 ); - - // Set sign to handle conjugation: flip the imaginary part for conjugate-transpose if ( trans === 'conjugate-transpose' ) { sign = -1; } else { sign = 1; } - - if ( isrm ) { - // For row-major matrices, the last dimension has the fastest changing index... - sa0 = strideA2 * 2; // offset increment for innermost loop - sa1 = strideA1 * 2; // offset increment for outermost loop - } else { // isColMajor - // For column-major matrices, the first dimension has the fastest changing index... - sa0 = strideA1 * 2; // offset increment for innermost loop - sa1 = strideA2 * 2; // offset increment for outermost loop - } - - // Vector indexing base oa = offsetA * 2; ox = offsetX * 2; - - // Vector strides sx = strideX * 2; - doa2 = sa1 + sa0; if ( ( !isrm && uplo === 'upper' && trans === 'no-transpose' ) || ( isrm && uplo === 'lower' && trans !== 'no-transpose' ) ) { - ix1 = ox + ( ( N - 1 ) * sx ); - oa2 = oa + ( doa2 * ( N - 1 ) ); + ix1 = ox + ((N-1)*sx); + oa2 = oa + (doa2*(N-1)); for ( i1 = N - 1; i1 >= 0; i1-- ) { rex = viewX[ ix1 ]; - imx = viewX[ ix1 + 1 ]; + imx = viewX[ ix1+1 ]; if ( rex !== 0.0 || imx !== 0.0 ) { if ( nonunit ) { ia = oa2; rea = viewA[ ia ]; - ima = sign * viewA[ ia + 1 ]; - magsq = f32( ( rea * rea ) + ( ima * ima ) ); - retmp = f32( f32( ( rex * rea ) + ( imx * ima ) ) / magsq ); - imtmp = f32( f32( ( imx * rea ) - ( rex * ima ) ) / magsq ); + ima = sign * viewA[ ia+1 ]; + magsq = f32(f32(rea*rea) + f32(ima*ima)); + retmp = f32((f32(rex*rea) + f32(imx*ima)) / magsq ); + imtmp = f32((f32(imx*rea) - f32(rex*ima)) / magsq ); viewX[ ix1 ] = retmp; - viewX[ ix1 + 1 ] = imtmp; + viewX[ ix1+1 ] = imtmp; } else { retmp = rex; imtmp = imx; @@ -145,13 +136,13 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ix0 = ix1 - sx; for ( i0 = i1 - 1; i0 >= 0; i0-- ) { rea = viewA[ ia ]; - ima = sign * viewA[ ia + 1 ]; + ima = sign * viewA[ ia+1 ]; rex = viewX[ ix0 ]; - imx = viewX[ ix0 + 1 ]; - remul = f32( ( retmp * rea ) - ( imtmp * ima ) ); - immul = f32( ( retmp * ima ) + ( imtmp * rea ) ); - viewX[ ix0 ] = f32( rex - remul ); - viewX[ ix0 + 1 ] = f32( imx - immul ); + imx = viewX[ ix0+1 ]; + remul = f32(f32(retmp*rea) - f32(imtmp*ima)); + immul = f32(f32(retmp*ima) + f32(imtmp*rea)); + viewX[ ix0 ] = f32(rex-remul); + viewX[ ix0+1 ] = f32(imx-immul); ix0 -= sx; ia -= sa0; } @@ -169,17 +160,17 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX oa2 = oa; for ( i1 = 0; i1 < N; i1++ ) { rex = viewX[ ix1 ]; - imx = viewX[ ix1 + 1 ]; + imx = viewX[ ix1+1 ]; if ( rex !== 0.0 || imx !== 0.0 ) { if ( nonunit ) { ia = oa2; rea = viewA[ ia ]; - ima = sign * viewA[ ia + 1 ]; - magsq = f32( ( rea * rea ) + ( ima * ima ) ); - retmp = f32( f32( ( rex * rea ) + ( imx * ima ) ) / magsq ); - imtmp = f32( f32( ( imx * rea ) - ( rex * ima ) ) / magsq ); + ima = sign * viewA[ ia+1 ]; + magsq = f32(f32(rea*rea) + f32(ima*ima)); + retmp = f32(f32(f32(rex*rea) + f32(imx*ima)) / magsq ); + imtmp = f32(f32(f32(imx*rea) - f32(rex*ima)) / magsq ); viewX[ ix1 ] = retmp; - viewX[ ix1 + 1 ] = imtmp; + viewX[ ix1+1 ] = imtmp; } else { retmp = rex; imtmp = imx; @@ -188,13 +179,13 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ix0 = ix1 + sx; for ( i0 = i1 + 1; i0 < N; i0++ ) { rea = viewA[ ia ]; - ima = sign * viewA[ ia + 1 ]; + ima = sign * viewA[ ia+1 ]; rex = viewX[ ix0 ]; - imx = viewX[ ix0 + 1 ]; - remul = f32( ( retmp * rea ) - ( imtmp * ima ) ); - immul = f32( ( retmp * ima ) + ( imtmp * rea ) ); - viewX[ ix0 ] = f32( rex - remul ); - viewX[ ix0 + 1 ] = f32( imx - immul ); + imx = viewX[ ix0+1 ]; + remul = f32(f32(retmp*rea) - f32(imtmp*ima)); + immul = f32(f32(retmp*ima) + f32(imtmp*rea)); + viewX[ ix0 ] = f32(rex-remul); + viewX[ ix0+1 ] = f32(imx-immul); ia += sa0; ix0 += sx; } @@ -212,69 +203,69 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX oa2 = oa; for ( i1 = 0; i1 < N; i1++ ) { rex = viewX[ ix1 ]; - imx = viewX[ ix1 + 1 ]; + imx = viewX[ ix1+1 ]; retmp = rex; imtmp = imx; ix0 = ox; ia = oa2; for ( i0 = 0; i0 < i1; i0++ ) { rea = viewA[ ia ]; - ima = sign * viewA[ ia + 1 ]; + ima = sign * viewA[ ia+1 ]; rex = viewX[ ix0 ]; - imx = viewX[ ix0 + 1 ]; - retmp = f32( retmp - f32( ( rex * rea ) - ( imx * ima ) ) ); - imtmp = f32( imtmp - f32( ( rex * ima ) + ( imx * rea ) ) ); + imx = viewX[ ix0+1 ]; + retmp = f32(retmp - f32(rex*rea) - f32(imx*ima)); + imtmp = f32(imtmp - f32(rex*ima) + f32(imx*rea)); ix0 += sx; ia += sa0; } if ( nonunit ) { rea = viewA[ ia ]; - ima = sign * viewA[ ia + 1 ]; - magsq = f32( ( rea * rea ) + ( ima * ima ) ); - remul = f32( ( retmp * rea ) + ( imtmp * ima ) ); - immul = f32( ( imtmp * rea ) - ( retmp * ima ) ); - retmp = f32( remul / magsq ); - imtmp = f32( immul / magsq ); + ima = sign * viewA[ ia+1 ]; + magsq = f32(f32(rea*rea) + f32(ima*ima)); + remul = f32(f32(retmp*rea) + f32(imtmp*ima)); + immul = f32(f32(imtmp*rea) - f32(retmp*ima)); + retmp = f32(remul / magsq); + imtmp = f32(immul / magsq); } viewX[ ix1 ] = retmp; - viewX[ ix1 + 1 ] = imtmp; + viewX[ ix1+1 ] = imtmp; ix1 += sx; oa2 += sa1; } return x; } // ( !isrm && uplo === 'lower' && trans !== 'no-transpose' ) || ( isrm && uplo === 'upper' && trans === 'no-transpose' ) - ix1 = ox + ( ( N - 1 ) * sx ); + ix1 = ox + ((N-1)*sx); ixend = ix1; - oa2 = oa + ( doa2 * ( N - 1 ) ); + oa2 = oa + (doa2*(N-1)); for ( i1 = N - 1; i1 >= 0; i1-- ) { rex = viewX[ ix1 ]; - imx = viewX[ ix1 + 1 ]; + imx = viewX[ ix1+1 ]; retmp = rex; imtmp = imx; ix0 = ixend; ia = oa2; for ( i0 = N - 1; i0 > i1; i0-- ) { rea = viewA[ ia ]; - ima = sign * viewA[ ia + 1 ]; + ima = sign * viewA[ ia+1 ]; rex = viewX[ ix0 ]; - imx = viewX[ ix0 + 1 ]; - retmp = f32( retmp - f32( ( rex * rea ) - ( imx * ima ) ) ); - imtmp = f32( imtmp - f32( ( rex * ima ) + ( imx * rea ) ) ); + imx = viewX[ ix0+1 ]; + retmp = f32(retmp - f32(rex*rea) - f32(imx*ima)); + imtmp = f32(imtmp - f32(rex*ima) + f32(imx*rea)); ia -= sa0; ix0 -= sx; } if ( nonunit ) { rea = viewA[ ia ]; - ima = sign * viewA[ ia + 1 ]; - magsq = f32( ( rea * rea ) + ( ima * ima ) ); - remul = f32( ( retmp * rea ) + ( imtmp * ima ) ); - immul = f32( ( imtmp * rea ) - ( retmp * ima ) ); - retmp = f32( remul / magsq ); - imtmp = f32( immul / magsq ); + ima = sign * viewA[ ia+1 ]; + magsq = f32(f32(rea*rea) + f32(ima*ima)); + remul = f32(f32(retmp*rea) + f32(imtmp*ima)); + immul = f32(f32(imtmp*rea) - f32(retmp*ima)); + retmp = f32(remul / magsq); + imtmp = f32(immul / magsq); } viewX[ ix1 ] = retmp; - viewX[ ix1 + 1 ] = imtmp; + viewX[ ix1+1 ] = imtmp; ix1 -= sx; oa2 -= sa1; } diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ctrsv.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ctrsv.js index 4c4368e5c950..0ed3c6da66ae 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ctrsv.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ctrsv.js @@ -33,7 +33,7 @@ var base = require( './base.js' ); // MAIN // /** -* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. +* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param {string} order - storage layout * @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/index.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/index.js index 0ebe9205e4e4..89dc3c023b2c 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* BLAS level 2 routine to solve one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. +* BLAS level 2 routine to solve one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * @module @stdlib/blas/base/ctrsv * * @example diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ndarray.js index a6a839c6fda9..722dc428f4e9 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/ndarray.js @@ -30,7 +30,7 @@ var base = require( './base.js' ); // MAIN // /** -* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. +* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix * @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed From 9e0fe593054c4aad483835212207bd9a0e7a1c5c Mon Sep 17 00:00:00 2001 From: Divit Date: Sat, 18 Apr 2026 18:58:36 +0000 Subject: [PATCH 37/40] fix: fix accumalition in base --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ctrsv/README.md | 40 ++++++++++++------- .../@stdlib/blas/base/ctrsv/lib/base.js | 16 ++++---- .../@stdlib/blas/base/ctrsv/package.json | 2 +- 3 files changed, 35 insertions(+), 23 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/README.md b/lib/node_modules/@stdlib/blas/base/ctrsv/README.md index 10de31a46b38..6d62b842e59e 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/README.md +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/README.md @@ -33,12 +33,14 @@ var ctrsv = require( '@stdlib/blas/base/ctrsv' ); #### ctrsv( order, uplo, trans, diag, N, A, LDA, x, sx ) -Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. +Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. + + ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); -var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); // eslint-disable-line max-params, max-len +var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); ctrsv( 'row-major', 'lower', 'no-transpose', 'unit', 3, A, 3, x, 1 ); @@ -59,11 +61,13 @@ The function has the following parameters: The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, + + ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); -var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); // eslint-disable-line max-params, max-len -var x = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); // eslint-disable-line max-params, max-len +var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); +var x = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); ctrsv( 'row-major', 'lower', 'no-transpose', 'unit', 3, A, 3, x, -1 ); // x => [ -17.0, -3.0, 2.0, -2.0, 1.0, 1.0 ] @@ -73,12 +77,14 @@ Note that indexing is relative to the first index. To introduce an offset, use [ + + ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); // Initial arrays... -var x0 = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); // eslint-disable-line max-params, max-len -var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); // eslint-disable-line max-params, max-len +var x0 = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); +var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); // Create offset views... var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd complex element @@ -91,12 +97,14 @@ ctrsv( 'row-major', 'lower', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); #### ctrsv.ndarray( uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox ) -Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b`, using alternative indexing semantics and where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix. +Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b`, using alternative indexing semantics and where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. + + ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); -var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); // eslint-disable-line max-params, max-len +var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ); ctrsv.ndarray( 'lower', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); @@ -112,11 +120,13 @@ The function has the following additional parameters: While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, + + ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); -var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); // eslint-disable-line max-params, max-len -var x = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); // eslint-disable-line max-params, max-len +var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); +var x = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); ctrsv.ndarray( 'lower', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); // x => [ -17.0, -3.0, 2.0, -2.0, 1.0, 1.0 ] @@ -143,6 +153,8 @@ ctrsv.ndarray( 'lower', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); + + ```javascript var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); @@ -151,7 +163,7 @@ var logEach = require( '@stdlib/console/log-each' ); var ctrsv = require( '@stdlib/blas/base/ctrsv' ); function rand() { - return new Complex64( discreteUniform( 0, 255 ), discreteUniform( -128, 127 ) ); // eslint-disable-line max-params, max-len + return new Complex64( discreteUniform( 0, 255 ), discreteUniform( -128, 127 ) ); } var N = 3; @@ -162,12 +174,12 @@ var x = filledarrayBy( N, 'complex64', rand ); ctrsv( 'row-major', 'lower', 'no-transpose', 'non-unit', N, A, N, x, 1 ); // Print the results: -logEach( '(%s)', x ); +logEach( '%s', x ); -ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', N, A, N, 1, 0, x, 2, 1 ); // eslint-disable-line max-params, max-len +ctrsv.ndarray( 'lower', 'no-transpose', 'non-unit', N, A, N, 1, 0, x, 2, 1 ); // Print the results: -logEach( '(%s)', x ); +logEach( '%s', x ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js index 311b7c9ca383..6294253c7b9c 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js @@ -141,8 +141,8 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX imx = viewX[ ix0+1 ]; remul = f32(f32(retmp*rea) - f32(imtmp*ima)); immul = f32(f32(retmp*ima) + f32(imtmp*rea)); - viewX[ ix0 ] = f32(rex-remul); - viewX[ ix0+1 ] = f32(imx-immul); + viewX[ ix0 ] = f32(rex - remul); + viewX[ ix0+1 ] = f32(imx - immul); ix0 -= sx; ia -= sa0; } @@ -184,8 +184,8 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX imx = viewX[ ix0+1 ]; remul = f32(f32(retmp*rea) - f32(imtmp*ima)); immul = f32(f32(retmp*ima) + f32(imtmp*rea)); - viewX[ ix0 ] = f32(rex-remul); - viewX[ ix0+1 ] = f32(imx-immul); + viewX[ ix0 ] = f32(rex - remul); + viewX[ ix0+1 ] = f32(imx - immul); ia += sa0; ix0 += sx; } @@ -213,8 +213,8 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ima = sign * viewA[ ia+1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0+1 ]; - retmp = f32(retmp - f32(rex*rea) - f32(imx*ima)); - imtmp = f32(imtmp - f32(rex*ima) + f32(imx*rea)); + retmp = f32(retmp - f32(f32(rex*rea) - f32(imx*ima))); + imtmp = f32(imtmp - f32(f32(rex*ima) + f32(imx*rea))); ix0 += sx; ia += sa0; } @@ -250,8 +250,8 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ima = sign * viewA[ ia+1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0+1 ]; - retmp = f32(retmp - f32(rex*rea) - f32(imx*ima)); - imtmp = f32(imtmp - f32(rex*ima) + f32(imx*rea)); + retmp = f32(retmp - f32(f32(rex*rea) - f32(imx*ima))); + imtmp = f32(imtmp - f32(f32(rex*ima) + f32(imx*rea))); ia -= sa0; ix0 -= sx; } diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/package.json b/lib/node_modules/@stdlib/blas/base/ctrsv/package.json index ab88bd94b15c..05463dd6f9a1 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/package.json +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/ctrsv", "version": "0.0.0", - "description": "Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix.", + "description": "Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b`.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", From 0efbe107cc1a9f792ef9d2d043b47e22b2cebab6 Mon Sep 17 00:00:00 2001 From: Divit Date: Tue, 21 Apr 2026 18:21:55 +0000 Subject: [PATCH 38/40] chore: match example with text --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/ctrsv/lib/base.js | 6 +- .../blas/base/ctrsv/test/test.ctrsv.js | 134 ++++++------ .../blas/base/ctrsv/test/test.ndarray.js | 194 +++++++++--------- 3 files changed, 167 insertions(+), 167 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js index 6294253c7b9c..e2616c4556bc 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/lib/base.js @@ -96,7 +96,7 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX sa0 = strideA1 * 2; // stride increment for innermost loop sa1 = strideA2 * 2; // stride increment for outermost loop } - // Reinterpret arrays to real-valued views + // Reinterpret arrays as real-valued views of interleaved real and imaginary components: viewA = reinterpret( A, 0 ); viewX = reinterpret( x, 0 ); if ( trans === 'conjugate-transpose' ) { @@ -124,8 +124,8 @@ function ctrsv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX rea = viewA[ ia ]; ima = sign * viewA[ ia+1 ]; magsq = f32(f32(rea*rea) + f32(ima*ima)); - retmp = f32((f32(rex*rea) + f32(imx*ima)) / magsq ); - imtmp = f32((f32(imx*rea) - f32(rex*ima)) / magsq ); + retmp = f32(f32(f32(rex*rea) + f32(imx*ima)) / magsq ); + imtmp = f32(f32(f32(imx*rea) - f32(rex*ima)) / magsq ); viewX[ ix1 ] = retmp; viewX[ ix1+1 ] = imtmp; } else { diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ctrsv.js b/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ctrsv.js index 3ecb6a47410f..f08c8c1204b8 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ctrsv.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ctrsv.js @@ -279,7 +279,7 @@ tape( 'the function throws an error if provided an invalid ninth argument', func } }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, no transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, lower, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -294,13 +294,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, no transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, lower, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -315,13 +315,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, no transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, lower, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -336,13 +336,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, no transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, lower, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -357,13 +357,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, lower, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -378,13 +378,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, lower, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -399,13 +399,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, conjugate-transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, lower, conjugate-transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -420,13 +420,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, conjugate-transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, lower, conjugate-transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -441,13 +441,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, lower, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -462,13 +462,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, lower, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -483,13 +483,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, no transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, upper, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -504,13 +504,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, no transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, upper, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -525,13 +525,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, no transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, upper, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -546,13 +546,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, no transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, upper, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -567,13 +567,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, upper, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -588,13 +588,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, upper, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -609,13 +609,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, upper, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -630,13 +630,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, upper, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -651,8 +651,8 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -669,7 +669,7 @@ tape( 'the function returns a reference to the input vector', function test( t ) x = new Complex64Array( data.x ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); t.end(); }); @@ -689,8 +689,8 @@ tape( 'if `N` is zero, the function returns the input vector unchanged (row-majo expected = new Complex64Array( data.x ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, 0, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( x, expected, 'returns expected value' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -710,8 +710,8 @@ tape( 'if `N` is zero, the function returns the input vector unchanged (column-m expected = new Complex64Array( data.x ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, 0, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( x, expected, 'returns expected value' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -731,8 +731,8 @@ tape( 'the function supports specifying an `x` stride (row-major)', function tes expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -752,8 +752,8 @@ tape( 'the function supports specifying an `x` stride (column-major)', function expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -773,8 +773,8 @@ tape( 'the function supports a negative `x` stride (row-major)', function test( expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -794,8 +794,8 @@ tape( 'the function supports a negative `x` stride (column-major)', function tes expected = new Complex64Array( data.x_out ); out = ctrsv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js index c06fadc8caec..5125a5212b70 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/test/test.ndarray.js @@ -232,7 +232,7 @@ tape( 'the function throws an error if provided an invalid tenth argument', func } }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, no transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, lower, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -247,13 +247,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, no transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, lower, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -268,13 +268,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, no transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, lower, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -289,13 +289,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, no transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, lower, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -310,13 +310,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, lower, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -331,13 +331,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, lower, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -352,13 +352,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, conjugate-transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, lower, conjugate-transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -373,13 +373,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, conjugate-transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, lower, conjugate-transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -394,13 +394,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, lower, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -415,13 +415,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, lower, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -436,13 +436,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, no transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, upper, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -457,13 +457,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, no transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, upper, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -478,13 +478,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, no transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, upper, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -499,13 +499,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, no transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, upper, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -520,13 +520,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, upper, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -541,13 +541,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, transpose, non-unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, upper, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -562,13 +562,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (row-major, upper, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -583,13 +583,13 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); -tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, transpose, unit)', function test( t ) { +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` (column-major, upper, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -604,8 +604,8 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -622,7 +622,7 @@ tape( 'the function returns a reference to the input vector', function test( t ) x = new Complex64Array( data.x ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); t.end(); }); @@ -642,8 +642,8 @@ tape( 'if `N` is zero, the function returns the input vector unchanged (row-majo expected = new Complex64Array( data.x ); out = ctrsv( data.uplo, data.trans, data.diag, 0, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( x, expected, 'returns expected value' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -663,8 +663,8 @@ tape( 'if `N` is zero, the function returns the input vector unchanged (column-m expected = new Complex64Array( data.x ); out = ctrsv( data.uplo, data.trans, data.diag, 0, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( x, expected, 'returns expected value' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -684,8 +684,8 @@ tape( 'the function supports an `x` offset (row-major)', function test( t ) { expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -705,8 +705,8 @@ tape( 'the function supports an `x` offset (column-major)', function test( t ) { expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -726,8 +726,8 @@ tape( 'the function supports specifying an `x` stride (row-major)', function tes expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -747,8 +747,8 @@ tape( 'the function supports specifying an `x` stride (column-major)', function expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -768,8 +768,8 @@ tape( 'the function supports specifying an `x` stride (column-major)', function expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -789,8 +789,8 @@ tape( 'the function supports a negative `x` stride (row-major)', function test( expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -810,8 +810,8 @@ tape( 'the function supports a negative `x` stride (column-major)', function tes expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -831,8 +831,8 @@ tape( 'the function supports an `A` offset (row-major)', function test( t ) { expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -852,8 +852,8 @@ tape( 'the function supports an `A` offset (column-major)', function test( t ) { expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -873,8 +873,8 @@ tape( 'the function supports specifying the strides of the first and second dime expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -894,8 +894,8 @@ tape( 'the function supports specifying the strides of the first and second dime expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -915,8 +915,8 @@ tape( 'the function supports a negative stride for the first dimension of `A` (r expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -936,8 +936,8 @@ tape( 'the function supports a negative stride for the first dimension of `A` (c expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -957,8 +957,8 @@ tape( 'the function supports a negative stride for the second dimension of `A` ( expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -978,8 +978,8 @@ tape( 'the function supports a negative stride for the second dimension of `A` ( expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -999,8 +999,8 @@ tape( 'the function supports negative strides for `A` (row-major)', function tes expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1020,8 +1020,8 @@ tape( 'the function supports negative strides for `A` (column-major)', function expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1041,8 +1041,8 @@ tape( 'the function supports complex access patterns (row-major)', function test expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -1062,8 +1062,8 @@ tape( 'the function supports complex access patterns (column-major)', function t expected = new Complex64Array( data.x_out ); out = ctrsv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); - t.strictEqual( isSameComplex64Array( out, x ), true, 'returns expected values' ); - t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected values' ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); t.end(); }); From f2bcb4df199ae9b5bd1c954eb187c9498a9a1227 Mon Sep 17 00:00:00 2001 From: Divit Date: Tue, 21 Apr 2026 18:25:14 +0000 Subject: [PATCH 39/40] chore: clean up --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/ctrsv/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/README.md b/lib/node_modules/@stdlib/blas/base/ctrsv/README.md index 6d62b842e59e..4ab8a3121dd6 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/README.md +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/README.md @@ -59,7 +59,7 @@ The function has the following parameters: - **x**: input [`Complex64Array`][@stdlib/array/complex64]. - **sx**: stride length for `x`. -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, +The stride parameters determine how elements in the input arrays are accessed at runtime. to iterate over every other element in `x` and `y`, @@ -67,10 +67,10 @@ The stride parameters determine how elements in the input arrays are accessed at var Complex64Array = require( '@stdlib/array/complex64' ); var A = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] ); -var x = new Complex64Array( [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] ); +var x = new Complex64Array( [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0 ] ); -ctrsv( 'row-major', 'lower', 'no-transpose', 'unit', 3, A, 3, x, -1 ); -// x => [ -17.0, -3.0, 2.0, -2.0, 1.0, 1.0 ] +ctrsv( 'row-major', 'lower', 'no-transpose', 'unit', 3, A, 3, x, 2 ); +// x => [ 1.0, 1.0, 0.0, 0.0, 2.0, -2.0, 0.0, 0.0, -17.0, -3.0 ] ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. From 672f9f7724779c15390d5b165a8373ac2a83b11f Mon Sep 17 00:00:00 2001 From: Divit Date: Tue, 21 Apr 2026 18:27:49 +0000 Subject: [PATCH 40/40] fix: fixs example text --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/ctrsv/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctrsv/README.md b/lib/node_modules/@stdlib/blas/base/ctrsv/README.md index 4ab8a3121dd6..85bc0dcc9f64 100644 --- a/lib/node_modules/@stdlib/blas/base/ctrsv/README.md +++ b/lib/node_modules/@stdlib/blas/base/ctrsv/README.md @@ -59,7 +59,7 @@ The function has the following parameters: - **x**: input [`Complex64Array`][@stdlib/array/complex64]. - **sx**: stride length for `x`. -The stride parameters determine how elements in the input arrays are accessed at runtime. to iterate over every other element in `x` and `y`, +The stride parameters determine how elements in the input arrays are accessed at runtime. to iterate over every other element in `x`,