From 7a0ef6ce031f0c809a715eab1fb5097087e36413 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 16:05:10 +0000 Subject: [PATCH 01/29] add license --- .../@stdlib/blas/base/ctbsv/lib/base.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js new file mode 100644 index 000000000000..415f5c25c2d3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/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. +*/ From 6d1f80c62d34b6842508a882bab78d71f3f35d72 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 18:47:00 +0000 Subject: [PATCH 02/29] 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 | 26 ++++++++++++++++++ .../test/fixtures/column_major_u_nt_u.json | 26 ++++++++++++++++++ .../ctbsv/test/fixtures/row_major_l_t_nu.json | 27 +++++++++++++++++++ .../ctbsv/test/fixtures/row_major_l_t_u.json | 27 +++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_t_u.json diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_nt_nu.json new file mode 100644 index 000000000000..78a6a6e1c96a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_nt_nu.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "uplo": "upper", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ], + "A_compact": [ + [ 0.0, 0.0, 2.0, 2.0, 4.0, 4.0 ], + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 0.0, 0.0 ], + [ 0.0, 0.0, 3.0, 3.0, 4.0, 4.0 ], + [ 0.0, 0.0, 0.0, 0.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "x": [ 0.0, 10.0, 0.0, 36.0, 0.0, 30.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_nt_u.json new file mode 100644 index 000000000000..e10e7f933cfb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_nt_u.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "uplo": "upper", + "trans": "no-transpose", + "diag": "unit", + "N": 3, + "K": 1, + "A": [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ], + "A_compact": [ + [ 0.0, 0.0, 2.0, 2.0, 4.0, 4.0 ], + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 0.0, 0.0 ], + [ 0.0, 0.0, 3.0, 3.0, 4.0, 4.0 ], + [ 0.0, 0.0, 0.0, 0.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "x": [ 1.0, 9.0, 2.0, 26.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_t_nu.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_t_nu.json new file mode 100644 index 000000000000..fa10e19d1d83 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_t_nu.json @@ -0,0 +1,27 @@ +{ + "order": "row-major", + "uplo": "lower", + "trans": "transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 1.0 ], + [ 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "x": [ 0.0, 10.0, 0.0, 36.0, 0.0, 30.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_t_u.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_t_u.json new file mode 100644 index 000000000000..5a10bc6d4145 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_t_u.json @@ -0,0 +1,27 @@ +{ + "order": "row-major", + "uplo": "lower", + "trans": "transpose", + "diag": "unit", + "N": 3, + "K": 1, + "A": [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 1.0, 3.0, 4.0, 4.0, 1.0, 5.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 1.0 ], + [ 2.0, 2.0, 1.0, 3.0 ], + [ 4.0, 4.0, 1.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 1.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 1.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 9.0, 2.0, 26.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} From ace9abe5c79639dcca7aa6108105202504d32749 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 18:47:45 +0000 Subject: [PATCH 03/29] feat: add branch 1 logic --- .../@stdlib/blas/base/ctbsv/lib/base.js | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js index 415f5c25c2d3..3062a02a1cc9 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js @@ -15,3 +15,158 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); +var max = require( '@stdlib/math/base/special/max' ); +var min = require( '@stdlib/math/base/special/min' ); + + +// MAIN // + +/** +* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `x = A^H*x` 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 band matrix, with ( `K` + 1 ) diagonals. +* +* @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 {NonNegativeInteger} K - number of super-diagonals or sub-diagonals of the matrix `A` +* @param {Complex64Array} A - input complex 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 complex vector +* @param {integer} strideX - stride length for `x` +* @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( [ ] ); +* +* ctbsv( 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, 1, 0, x, 1, 0 ); +* // x => [ ] +*/ +function ctbmv( uplo, trans, diag, N, K, 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 ] ); + 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' ) + ) { + for ( i1 = N - 1; i1 >= 0; i1-- ) { + ix1 = ox + ( i1 * sx ); + rex = viewX[ ix1 ]; + imx = viewX[ ix1 + 1 ]; + retmp = rex; + imtmp = imx; + oa2 = oa + ( i1 * sa1 ) + ( K * sa0 ); + for ( i0 = i1 + 1; i0 <= min( N - 1, i1 + K ); i0++ ) { + ix0 = ox + ( i0 * sa0); + ia = oa2 + ( ( i0 - i1 ) * ( sa1 - sa0 ) ); + rea = viewA[ ia ]; + ima = sign * viewA[ ia + 1 ]; + rex = viewX[ ix0 ]; + imx = viewX[ ix0 + 1 ]; + retmp -= f32( ( rea * rex ) - ( ima * imx ) ); + imtmp -= f32( ( rea * imx ) + ( ima * rex ) ); + } + if ( nonunit ) { + rea = viewA[ oa2 ]; + ima = sign * viewA[ oa2 + 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; + } + return x; + } + if ( + ( !isrm && uplo === 'lower' && trans === 'no-transpose' ) || + ( isrm && uplo === 'upper' && trans !== 'no-transpose' ) + ) { + + } + if ( + ( !isrm && uplo === 'upper' && trans !== 'no-transpose' ) || + ( isrm && uplo === 'lower' && trans === 'no-transpose' ) + ) { + + } + // ( !isrm && uplo === 'lower' && trans !== 'no-transpose' ) || ( isrm && uplo === 'upper' && trans === 'no-transpose' ) + +} + + +// EXPORTS // + +module.exports = ctbmv; \ No newline at end of file From d679e2464a2e8746bebcc1438b336c5720d28844 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 18:55:40 +0000 Subject: [PATCH 04/29] feat: add branch 2 logic --- .../@stdlib/blas/base/ctbsv/lib/base.js | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js index 3062a02a1cc9..cb317e2145f3 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js @@ -154,7 +154,36 @@ function ctbmv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri ( !isrm && uplo === 'lower' && trans === 'no-transpose' ) || ( isrm && uplo === 'upper' && trans !== 'no-transpose' ) ) { - + for ( i1 = 0; i1 < N; i1++ ) { + ix1 = ox + ( i1 * sx ); + rex = viewX[ ix1 ]; + imx = viewX[ ix1 + 1 ]; + retmp = rex; + imtmp = imx; + oa2 = oa + ( i1 * sa1 ); + for ( i0 = max( 0, i1 - K ); i0 < i1; i0++ ) { + ix0 = ox + ( i0 * sx ); + ia = oa2 + ( ( i0 - i1 ) * ( sa1 - sa0 ) ); + rea = viewA[ ia ]; + ima = sign * viewA[ ia + 1 ]; + rex = viewX[ ix0 ]; + imx = viewX[ ix0 + 1 ]; + retmp -= f32( ( rea * rex ) - ( ima * imx ) ); + imtmp -= f32( ( rea * imx ) + ( ima * rex ) ); + } + if ( nonunit ) { + rea = viewA[ oa2 ]; + ima = sign * viewA[ oa2 + 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; + } + return x; } if ( ( !isrm && uplo === 'upper' && trans !== 'no-transpose' ) || From 1a64e4f4fcc6c4cacf572c4188aef4267b9d13a1 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 18:56:09 +0000 Subject: [PATCH 05/29] 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 | 26 ++++++++++++++++++ .../test/fixtures/column_major_l_nt_u.json | 26 ++++++++++++++++++ .../ctbsv/test/fixtures/row_major_u_t_nu.json | 27 +++++++++++++++++++ .../ctbsv/test/fixtures/row_major_u_t_u.json | 27 +++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_t_u.json diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_nt_nu.json new file mode 100644 index 000000000000..fe7bc14a57c7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_nt_nu.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_nt_u.json new file mode 100644 index 000000000000..09f00ead132c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_nt_u.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "uplo": "lower", + "trans": "no-transpose", + "diag": "unit", + "N": 3, + "K": 1, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 6.0, 3.0, 19.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_t_nu.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_t_nu.json new file mode 100644 index 000000000000..76f5ce2487c3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_t_nu.json @@ -0,0 +1,27 @@ +{ + "order": "row-major", + "uplo": "upper", + "trans": "transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 1.0, 2.0, 2.0 ], + [ 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 0.0, 0.0 ], + [ 0.0, 0.0, 3.0, 3.0, 4.0, 4.0 ], + [ 0.0, 0.0, 0.0, 0.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_t_u.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_t_u.json new file mode 100644 index 000000000000..cb8b58079cef --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_t_u.json @@ -0,0 +1,27 @@ +{ + "order": "row-major", + "uplo": "upper", + "trans": "transpose", + "diag": "unit", + "N": 3, + "K": 1, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 1.0, 2.0, 2.0 ], + [ 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 0.0, 0.0 ], + [ 0.0, 0.0, 3.0, 3.0, 4.0, 4.0 ], + [ 0.0, 0.0, 0.0, 0.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 6.0, 3.0, 19.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} From 61b17686de2461f98a9dd75c8c63626b12da7962 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 19:05:41 +0000 Subject: [PATCH 06/29] 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 | 26 ++++++++++++++++++ .../test/fixtures/column_major_u_t_u.json | 26 ++++++++++++++++++ .../test/fixtures/row_major_l_nt_nu.json | 27 +++++++++++++++++++ .../ctbsv/test/fixtures/row_major_l_nt_u.json | 27 +++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_u.json diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_t_nu.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_t_nu.json new file mode 100644 index 000000000000..9c1dea61dff3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_t_nu.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "uplo": "upper", + "trans": "transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ], + "A_compact": [ + [ 0.0, 0.0, 2.0, 2.0, 4.0, 4.0 ], + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 0.0, 0.0 ], + [ 0.0, 0.0, 3.0, 3.0, 4.0, 4.0 ], + [ 0.0, 0.0, 0.0, 0.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_t_u.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_t_u.json new file mode 100644 index 000000000000..7fdcad729f00 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_u_t_u.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "uplo": "upper", + "trans": "transpose", + "diag": "unit", + "N": 3, + "K": 1, + "A": [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ], + "A_compact": [ + [ 0.0, 0.0, 2.0, 2.0, 4.0, 4.0 ], + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 0.0, 0.0 ], + [ 0.0, 0.0, 3.0, 3.0, 4.0, 4.0 ], + [ 0.0, 0.0, 0.0, 0.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 6.0, 3.0, 19.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_nu.json new file mode 100644 index 000000000000..5d317fb39fb8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_nu.json @@ -0,0 +1,27 @@ +{ + "order": "row-major", + "uplo": "lower", + "trans": "no-transpose", + "diag": "unit", + "N": 3, + "K": 1, + "A": [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 1.0 ], + [ 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 2.0, 6.0, 3.0, 19.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_u.json new file mode 100644 index 000000000000..6a460a46900b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_u.json @@ -0,0 +1,27 @@ +{ + "order": "row-major", + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 1.0 ], + [ 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} From 2daf6e009d1bcdfc516c827919e16575c0be7969 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 19:06:00 +0000 Subject: [PATCH 07/29] feat: add branch 3 logic --- .../@stdlib/blas/base/ctbsv/lib/base.js | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js index cb317e2145f3..8d7f1e1dc731 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js @@ -189,7 +189,36 @@ function ctbmv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri ( !isrm && uplo === 'upper' && trans !== 'no-transpose' ) || ( isrm && uplo === 'lower' && trans === 'no-transpose' ) ) { - + for ( i1 = 0; i1 < N; i1++ ) { + ix1 = ox + ( i1 * sx ); + rex = viewX[ ix1 ]; + imx = viewX[ ix1 + 1 ]; + retmp = rex; + imtmp = imx; + oa2 = oa + ( i1 * sa1 ) + ( K * sa0 ); + for ( i0 = max( 0, i1 - K ); i0 < i1; i0++ ) { + ix0 = ox + ( i0 * sx ); + ia = oa2 + ( ( i0 - i1 ) * sa0 ); + rea = viewA[ ia ]; + ima = sign * viewA[ ia + 1 ]; + rex = viewX[ ix0 ]; + imx = viewX[ ix0 + 1 ]; + retmp -= f32( ( rea * rex ) - ( ima * imx ) ); + imtmp -= f32( ( rea * imx ) + ( ima * rex ) ); + } + if ( nonunit ) { + rea = viewA[ oa2 ]; + ima = sign * viewA[ oa2 + 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; + } + return x; } // ( !isrm && uplo === 'lower' && trans !== 'no-transpose' ) || ( isrm && uplo === 'upper' && trans === 'no-transpose' ) From 40cd6888826ffade6c7eb3a66480d4f2c0615f0a Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 19:22:24 +0000 Subject: [PATCH 08/29] feat: add 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/ctbsv/lib/base.js | 41 ++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js index 8d7f1e1dc731..dfad738d08d0 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js @@ -50,13 +50,13 @@ var min = require( '@stdlib/math/base/special/min' ); * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * -* var A = new Complex64Array( [ ] ); -* var x = new Complex64Array( [ ] ); +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] ); +* var x = new Complex64Array( [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] ); * * ctbsv( 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, 1, 0, x, 1, 0 ); -* // x => [ ] +* // x => [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] */ -function ctbmv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len +function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len var nonunit; var viewA; var viewX; @@ -221,10 +221,39 @@ function ctbmv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri return x; } // ( !isrm && uplo === 'lower' && trans !== 'no-transpose' ) || ( isrm && uplo === 'upper' && trans === 'no-transpose' ) - + for ( i1 = N - 1; i1 >= 0; i1-- ) { + ix1 = ox + ( i1 * sx ); + rex = viewX[ ix1 ]; + imx = viewX[ ix1 + 1 ]; + retmp = rex; + imtmp = imx; + oa2 = oa + ( i1 * sa1 ); + for ( i0 = min( N - 1, i1 + K ); i0 > i1; i0-- ) { + ix0 = ox + ( i0 * sx ); + ia = oa2 + ( ( i0 - i1 ) * sa0 ); + rea = viewA[ ia ]; + ima = sign * viewA[ ia + 1 ]; + rex = viewX[ ix0 ]; + imx = viewX[ ix0 + 1 ]; + retmp -= f32( ( rea * rex ) - ( ima * imx ) ); + imtmp -= f32( ( rea * imx ) + ( ima * rex ) ); + } + if ( nonunit ) { + rea = viewA[ oa2 ]; + ima = sign * viewA[ oa2 + 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; + } + return x; } // EXPORTS // -module.exports = ctbmv; \ No newline at end of file +module.exports = ctbsv; From ffa6fe4384ed8959e2ad5c392e829b14029d37f5 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 13 Apr 2026 19:23:03 +0000 Subject: [PATCH 09/29] 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 | 26 ++++++++++++++++++ .../test/fixtures/column_major_l_t_u.json | 26 ++++++++++++++++++ .../test/fixtures/row_major_l_nt_nu.json | 4 +-- .../ctbsv/test/fixtures/row_major_l_nt_u.json | 4 +-- .../test/fixtures/row_major_u_nt_nu.json | 27 +++++++++++++++++++ .../ctbsv/test/fixtures/row_major_u_nt_u.json | 27 +++++++++++++++++++ 6 files changed, 110 insertions(+), 4 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_nt_u.json diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_t_nu.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_t_nu.json new file mode 100644 index 000000000000..4dcfb1bf06f6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_t_nu.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "uplo": "lower", + "trans": "transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "x": [ 0.0, 10.0, 0.0, 36.0, 0.0, 30.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_t_u.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_t_u.json new file mode 100644 index 000000000000..d839d8fc9843 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_t_u.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "uplo": "lower", + "trans": "transpose", + "diag": "unit", + "N": 3, + "K": 1, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "x": [ 1.0, 9.0, 2.0, 26.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_nu.json index 5d317fb39fb8..6a460a46900b 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_nu.json @@ -2,7 +2,7 @@ "order": "row-major", "uplo": "lower", "trans": "no-transpose", - "diag": "unit", + "diag": "non-unit", "N": 3, "K": 1, "A": [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ], @@ -20,7 +20,7 @@ "strideA1": 2, "strideA2": 1, "offsetA": 0, - "x": [ 1.0, 1.0, 2.0, 6.0, 3.0, 19.0 ], + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], "strideX": 1, "offsetX": 0, "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_u.json index 6a460a46900b..5d317fb39fb8 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_u.json +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_nt_u.json @@ -2,7 +2,7 @@ "order": "row-major", "uplo": "lower", "trans": "no-transpose", - "diag": "non-unit", + "diag": "unit", "N": 3, "K": 1, "A": [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ], @@ -20,7 +20,7 @@ "strideA1": 2, "strideA2": 1, "offsetA": 0, - "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "x": [ 1.0, 1.0, 2.0, 6.0, 3.0, 19.0 ], "strideX": 1, "offsetX": 0, "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_nt_nu.json new file mode 100644 index 000000000000..a612b4464be0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_nt_nu.json @@ -0,0 +1,27 @@ +{ + "order": "row-major", + "uplo": "upper", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 1.0, 2.0, 2.0 ], + [ 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 0.0, 0.0 ], + [ 0.0, 0.0, 3.0, 3.0, 4.0, 4.0 ], + [ 0.0, 0.0, 0.0, 0.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "x": [ 0.0, 10.0, 0.0, 36.0, 0.0, 30.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_nt_u.json new file mode 100644 index 000000000000..f36032709763 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_u_nt_u.json @@ -0,0 +1,27 @@ +{ + "order": "row-major", + "uplo": "upper", + "trans": "no-transpose", + "diag": "unit", + "N": 3, + "K": 1, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 1.0, 2.0, 2.0 ], + [ 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 0.0, 0.0 ], + [ 0.0, 0.0, 3.0, 3.0, 4.0, 4.0 ], + [ 0.0, 0.0, 0.0, 0.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 9.0, 2.0, 26.0, 3.0, 3.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} From ca3c70a7e95e6606eae3ec0aab1825a9f797f98a Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 17 Apr 2026 05:00:56 +0000 Subject: [PATCH 10/29] test: add conjugate transpose case 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 | 26 ++++++++++++++++++ .../test/fixtures/row_major_l_ct_nu.json | 27 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_ct_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_ct_nu.json diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_ct_nu.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_ct_nu.json new file mode 100644 index 000000000000..c782dd3d2345 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_l_ct_nu.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + "uplo": "lower", + "trans": "conjugate-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "x": [ 10.0, 0.0, 36.0, 0.0, 30.0, 0.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_ct_nu.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_ct_nu.json new file mode 100644 index 000000000000..01d524ac4e24 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_l_ct_nu.json @@ -0,0 +1,27 @@ +{ + "order": "row-major", + "uplo": "lower", + "trans": "conjugate-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 1.0 ], + [ 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "x": [ 10.0, 0.0, 36.0, 0.0, 30.0, 0.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} From 0eb382cc41073c7efe57f0192817613da885eaa8 Mon Sep 17 00:00:00 2001 From: Divit Date: Fri, 17 Apr 2026 06:03:58 +0000 Subject: [PATCH 11/29] test: add x 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 --- --- .../ctbsv/test/fixtures/column_major_ox.json | 26 ++++++++++++++++++ .../ctbsv/test/fixtures/row_major_ox.json | 27 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_ox.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_ox.json diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_ox.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_ox.json new file mode 100644 index 000000000000..bf5555e3ef79 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_ox.json @@ -0,0 +1,26 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 4, + "K": 2, + "A": [ 1.0, 1.0, -2.0, -2.0, 3.0, 3.0, 4.0, 4.0, -5.0, -5.0, 6.0, 6.0, 7.0, 7.0, -8.0, -8.0, 0.0, 0.0, 9.0, 9.0, 0.0, 0.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 1.0, 4.0, 4.0, 7.0, 7.0, 9.0, 9.0 ], + [ -2.0, -2.0, -5.0, -5.0, -8.0, -8.0, 0.0, 0.0 ], + [ 3.0, 3.0, 6.0, 6.0, 0.0, 0.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ -2.0, -2.0, 4.0, 4.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 3.0, -5.0, -5.0, 7.0, 7.0, 0.0, 0.0 ], + [ 0.0, 0.0, 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ] + ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 12.0, 0.0, 28.0, 0.0, 48.0 ], + "strideX": 1, + "offsetX": 2, + "x_out": [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_ox.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_ox.json new file mode 100644 index 000000000000..fc9284de471a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_ox.json @@ -0,0 +1,27 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 4, + "K": 2, + "A": [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, -2.0, -2.0, 4.0, 4.0, 3.0, 3.0, -5.0, -5.0, 7.0, 7.0, 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ], + "A_compact": [ + [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0 ], + [ 0.0, 0.0, -2.0, -2.0, 4.0, 4.0 ], + [ 3.0, 3.0, -5.0, -5.0, 7.0, 7.0 ], + [ 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ -2.0, -2.0, 4.0, 4.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 3.0, -5.0, -5.0, 7.0, 7.0, 0.0, 0.0 ], + [ 0.0, 0.0, 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ] + ], + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 0.0, 0.0, 0.0, 2.0, 0.0, 12.0, 0.0, 28.0, 0.0, 48.0 ], + "strideX": 1, + "offsetX": 1, + "x_out": [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] +} From c5f461fc5db9e233353febb48846de20c64a0833 Mon Sep 17 00:00:00 2001 From: Divit Date: Sat, 25 Apr 2026 09:15:39 +0000 Subject: [PATCH 12/29] test: add vctor stride combination 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 --- --- .../ctbsv/test/fixtures/column_major_xn.json | 26 ++++++++++++++++++ .../ctbsv/test/fixtures/column_major_xp.json | 26 ++++++++++++++++++ .../ctbsv/test/fixtures/row_major_xn.json | 27 +++++++++++++++++++ .../ctbsv/test/fixtures/row_major_xp.json | 27 +++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xn.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xp.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xn.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xp.json diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xn.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xn.json new file mode 100644 index 000000000000..b8677af54156 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xn.json @@ -0,0 +1,26 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 4, + "K": 2, + "A": [ 1.0, 1.0, -2.0, -2.0, 3.0, 3.0, 4.0, 4.0, -5.0, -5.0, 6.0, 6.0, 7.0, 7.0, -8.0, -8.0, 0.0, 0.0, 9.0, 9.0, 0.0, 0.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 1.0, 4.0, 4.0, 7.0, 7.0, 9.0, 9.0 ], + [ -2.0, -2.0, -5.0, -5.0, -8.0, -8.0, 0.0, 0.0 ], + [ 3.0, 3.0, 6.0, 6.0, 0.0, 0.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ -2.0, -2.0, 4.0, 4.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 3.0, -5.0, -5.0, 7.0, 7.0, 0.0, 0.0 ], + [ 0.0, 0.0, 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ] + ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 0.0, 48.0, 0.0, 0.0, 0.0, 28.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 2.0 ], + "strideX": -2, + "offsetX": 6, + "x_out": [ 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xp.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xp.json new file mode 100644 index 000000000000..e24871a78a05 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xp.json @@ -0,0 +1,26 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 4, + "K": 2, + "A": [ 1.0, 1.0, -2.0, -2.0, 3.0, 3.0, 4.0, 4.0, -5.0, -5.0, 6.0, 6.0, 7.0, 7.0, -8.0, -8.0, 0.0, 0.0, 9.0, 9.0, 0.0, 0.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 1.0, 4.0, 4.0, 7.0, 7.0, 9.0, 9.0 ], + [ -2.0, -2.0, -5.0, -5.0, -8.0, -8.0, 0.0, 0.0 ], + [ 3.0, 3.0, 6.0, 6.0, 0.0, 0.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ -2.0, -2.0, 4.0, 4.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 3.0, -5.0, -5.0, 7.0, 7.0, 0.0, 0.0 ], + [ 0.0, 0.0, 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ] + ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 0.0, 2.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 28.0, 0.0, 0.0, 0.0, 48.0 ], + "strideX": 2, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xn.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xn.json new file mode 100644 index 000000000000..3e7206b41561 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xn.json @@ -0,0 +1,27 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 4, + "K": 2, + "A": [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, -2.0, -2.0, 4.0, 4.0, 3.0, 3.0, -5.0, -5.0, 7.0, 7.0, 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ], + "A_compact": [ + [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0 ], + [ 0.0, 0.0, -2.0, -2.0, 4.0, 4.0 ], + [ 3.0, 3.0, -5.0, -5.0, 7.0, 7.0 ], + [ 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ -2.0, -2.0, 4.0, 4.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 3.0, -5.0, -5.0, 7.0, 7.0, 0.0, 0.0 ], + [ 0.0, 0.0, 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ] + ], + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 0.0, 48.0, 0.0, 0.0, 0.0, 28.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 2.0 ], + "strideX": -2, + "offsetX": 6, + "x_out": [ 4.0, 4.0, 0.0, 0.0, 3.0, 3.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xp.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xp.json new file mode 100644 index 000000000000..4267e1627978 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xp.json @@ -0,0 +1,27 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 4, + "K": 2, + "A": [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, -2.0, -2.0, 4.0, 4.0, 3.0, 3.0, -5.0, -5.0, 7.0, 7.0, 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ], + "A_compact": [ + [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0 ], + [ 0.0, 0.0, -2.0, -2.0, 4.0, 4.0 ], + [ 3.0, 3.0, -5.0, -5.0, 7.0, 7.0 ], + [ 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], + [ -2.0, -2.0, 4.0, 4.0, 0.0, 0.0, 0.0, 0.0 ], + [ 3.0, 3.0, -5.0, -5.0, 7.0, 7.0, 0.0, 0.0 ], + [ 0.0, 0.0, 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ] + ], + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 0.0, 2.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 28.0, 0.0, 0.0, 0.0, 48.0 ], + "strideX": 2, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0 ] +} From ca7b85ed4a40d58cde2e57e9dca7511469669e22 Mon Sep 17 00:00:00 2001 From: Divit Date: Sat, 25 Apr 2026 09:26:37 +0000 Subject: [PATCH 13/29] test: add A 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 --- --- .../ctbsv/test/fixtures/column_major_oa.json | 24 ++++++++++++++++++ .../ctbsv/test/fixtures/row_major_oa.json | 25 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_oa.json diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_oa.json new file mode 100644 index 000000000000..e40272a47971 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_oa.json @@ -0,0 +1,24 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "strideA1": 1, + "strideA2": 2, + "offsetA": 3, + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_oa.json new file mode 100644 index 000000000000..ca5cdf53b5d1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_oa.json @@ -0,0 +1,25 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 1.0 ], + [ 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "strideA1": 2, + "strideA2": 1, + "offsetA": 2, + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} From c6df74aabcd86e256b8d5f7992a62f481fa67310 Mon Sep 17 00:00:00 2001 From: Divit Date: Sat, 25 Apr 2026 09:34:16 +0000 Subject: [PATCH 14/29] test: add A matix stride combination 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 | 24 ++++++++++++++++++ .../test/fixtures/column_major_sa1_sa2n.json | 24 ++++++++++++++++++ .../test/fixtures/column_major_sa1n_sa2.json | 24 ++++++++++++++++++ .../test/fixtures/column_major_sa1n_sa2n.json | 24 ++++++++++++++++++ .../test/fixtures/row_major_sa1_sa2.json | 25 +++++++++++++++++++ .../test/fixtures/row_major_sa1_sa2n.json | 25 +++++++++++++++++++ .../test/fixtures/row_major_sa1n_sa2.json | 25 +++++++++++++++++++ .../test/fixtures/row_major_sa1n_sa2n.json | 25 +++++++++++++++++++ 8 files changed, 196 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1n_sa2n.json diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1_sa2.json new file mode 100644 index 000000000000..02e9ba0c20ca --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1_sa2.json @@ -0,0 +1,24 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "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, 4.0, 4.0, 999.0, 999.0, 5.0, 5.0, 999.0, 999.0, 0.0, 0.0 ], + "A_compact": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "strideA1": 2, + "strideA2": 4, + "offsetA": 0, + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1_sa2n.json new file mode 100644 index 000000000000..63ce8e12a6b8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1_sa2n.json @@ -0,0 +1,24 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 5.0, 5.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 3.0, 3.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 1.0, 1.0, 999.0, 999.0, 2.0, 2.0 ], + "A_compact": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "strideA1": 2, + "strideA2": -4, + "offsetA": 8, + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1n_sa2.json new file mode 100644 index 000000000000..8747adccf139 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1n_sa2.json @@ -0,0 +1,24 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 2.0, 2.0, 999.0, 999.0, 999.0, 999.0, 1.0, 1.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 999.0, 999.0, 3.0, 3.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 5.0, 5.0 ], + "A_compact": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "strideA1": -3, + "strideA2": 5, + "offsetA": 3, + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1n_sa2n.json new file mode 100644 index 000000000000..e7a8648cb86a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_sa1n_sa2n.json @@ -0,0 +1,24 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 0.0, 0.0, 999.0, 999.0, 5.0, 5.0, 999.0, 999.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 3.0, 3.0, 999.0, 999.0, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 1.0, 1.0 ], + "A_compact": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "strideA1": -2, + "strideA2": -5, + "offsetA": 12, + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1_sa2.json new file mode 100644 index 000000000000..7089d1e2ad66 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1_sa2.json @@ -0,0 +1,25 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 0.0, 0.0, 999.0, 999.0, 1.0, 1.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 3.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 5.0, 5.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 1.0 ], + [ 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "strideA1": 8, + "strideA2": 2, + "offsetA": 0, + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1_sa2n.json new file mode 100644 index 000000000000..03ce1ffb43e3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1_sa2n.json @@ -0,0 +1,25 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 1.0, 1.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 3.0, 999.0, 999.0, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 5.0, 999.0, 999.0, 999.0, 999.0, 4.0, 4.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 1.0 ], + [ 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "strideA1": 8, + "strideA2": -3, + "offsetA": 3, + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1n_sa2.json new file mode 100644 index 000000000000..f554d22732a6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1n_sa2.json @@ -0,0 +1,25 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 4.0, 4.0, 999.0, 999.0, 5.0, 5.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, 1.0, 1.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 1.0 ], + [ 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "strideA1": -4, + "strideA2": 2, + "offsetA": 8, + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1n_sa2n.json new file mode 100644 index 000000000000..84dbee732d35 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_sa1n_sa2n.json @@ -0,0 +1,25 @@ +{ + "uplo": "lower", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 5.0, 5.0, 999.0, 999.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 3.0, 999.0, 999.0, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 1.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 1.0, 1.0 ], + [ 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ], + [ 2.0, 2.0, 3.0, 3.0, 0.0, 0.0 ], + [ 0.0, 0.0, 4.0, 4.0, 5.0, 5.0 ] + ], + "strideA1": -7, + "strideA2": -3, + "offsetA": 17, + "x": [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ], + "strideX": 1, + "offsetX": 0, + "x_out": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +} From e63be684336549565531e2a6201d4f43c122bfab Mon Sep 17 00:00:00 2001 From: Divit Date: Sat, 25 Apr 2026 09:39:10 +0000 Subject: [PATCH 15/29] 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 | 24 ++++++++++++++++++ .../row_major_complex_access_pattern.json | 25 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_complex_access_pattern.json diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 000000000000..3f56ff37ea6d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_complex_access_pattern.json @@ -0,0 +1,24 @@ +{ + "uplo": "upper", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 5.0, 999.0, 999.0, 999.0, 999.0, 4.0, 4.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 3.0, 999.0, 999.0, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 1.0, 999.0, 999.0, 999.0, 999.0, 0.0, 0.0 ], + "A_compact": [ + [ 0.0, 0.0, 2.0, 2.0, 4.0, 4.0 ], + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 0.0, 0.0 ], + [ 0.0, 0.0, 3.0, 3.0, 4.0, 4.0 ], + [ 0.0, 0.0, 0.0, 0.0, 5.0, 5.0 ] + ], + "strideA1": -3, + "strideA2": -7, + "offsetA": 20, + "x": [ 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 0.0, 36.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10.0 ], + "strideX": -3, + "offsetX": 6, + "x_out": [ 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 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 000000000000..85ea7faa5596 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_complex_access_pattern.json @@ -0,0 +1,25 @@ +{ + "uplo": "upper", + "trans": "no-transpose", + "diag": "non-unit", + "N": 3, + "K": 1, + "A": [ 999.0, 999.0, 999.0, 999.0, 0.0, 0.0, 999.0, 999.0, 5.0, 5.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 4.0, 4.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, 999.0, 999.0, 2.0, 2.0, 999.0, 999.0, 1.0, 1.0 ], + "A_compact": [ + [ 1.0, 1.0, 2.0, 2.0 ], + [ 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 0.0, 0.0 ] + ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 0.0, 0.0 ], + [ 0.0, 0.0, 3.0, 3.0, 4.0, 4.0 ], + [ 0.0, 0.0, 0.0, 0.0, 5.0, 5.0 ] + ], + "strideA1": -8, + "strideA2": -2, + "offsetA": 20, + "x": [ 0.0, 30.0, 0.0, 0.0, 0.0, 0.0, 0.0, 36.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10.0 ], + "strideX": -3, + "offsetX": 6, + "x_out": [ 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 ] +} From 78864f12d0beb1a7d72d17fae76878f54835ebe2 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 27 Apr 2026 05:27:39 +0000 Subject: [PATCH 16/29] 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: 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/ctbsv/lib/base.js | 36 +++--- .../@stdlib/blas/base/ctbsv/lib/ctbsv.js | 113 ++++++++++++++++++ .../@stdlib/blas/base/ctbsv/lib/index.js | 70 +++++++++++ .../@stdlib/blas/base/ctbsv/lib/main.js | 35 ++++++ .../@stdlib/blas/base/ctbsv/lib/ndarray.js | 93 ++++++++++++++ .../@stdlib/blas/base/ctbsv/package.json | 68 +++++++++++ 6 files changed, 394 insertions(+), 21 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/lib/ctbsv.js create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/lib/ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/package.json diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js index dfad738d08d0..92f609adedad 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js @@ -30,7 +30,7 @@ var min = require( '@stdlib/math/base/special/min' ); // MAIN // /** -* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `x = A^H*x` 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 band matrix, with ( `K` + 1 ) diagonals. +* Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `x = A^H*x` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular band matrix, with ( `K` + 1 ) diagonals. * * @private * @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix @@ -38,11 +38,11 @@ var min = require( '@stdlib/math/base/special/min' ); * @param {string} diag - specifies whether `A` has a unit diagonal * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {NonNegativeInteger} K - number of super-diagonals or sub-diagonals of the matrix `A` -* @param {Complex64Array} A - input complex matrix +* @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 complex vector +* @param {Complex64Array} x - input vector * @param {integer} strideX - stride length for `x` * @param {NonNegativeInteger} offsetX - starting index for `x` * @returns {Complex64Array} `x` @@ -83,36 +83,30 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri var i1; var ia; - // Layout + // Note on variable naming convention: sa#, ix#, i# where # corresponds to the loop number, with `0` being the innermost loop... + 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 as real-valued views of interleaved real and imaginary components: 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 ( diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/ctbsv.js b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/ctbsv.js new file mode 100644 index 000000000000..b25c5c94a268 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/ctbsv.js @@ -0,0 +1,113 @@ +/** +* @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 `x = A^H*x` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular band matrix, with ( `K` + 1 ) diagonals. +* +* @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 {NonNegativeInteger} K - number of super-diagonals or sub-diagonals of the matrix `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} sixth argument must be a nonnegative integer +* @throws {RangeError} eighth argument must be greater than or equal to max(1,N) +* @throws {RangeError} tenth argument must be non-zero +* @returns {Complex64Array} `x` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] ); +* var x = new Complex64Array( [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] ); +* +* ctbsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x, 1 ); +* // x => [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +*/ +function ctbsv( order, uplo, trans, diag, N, K, 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 ( K < 0 ) { + throw new RangeError( format( 'invalid argument. Sixth argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( LDA < max( 1, K + 1 ) ) { + throw new RangeError( 'invalid argument. Eighth argument must be greater than or equal to ( K + 1 ). Value: `%d`.', LDA ); + } + if ( strideX === 0 ) { + throw new RangeError( format( 'invalid argument. Tenth 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, K, A, sa1, sa2, 0, x, strideX, ox ); +} + + +// EXPORTS // + +module.exports = ctbsv; diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/index.js b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/index.js new file mode 100644 index 000000000000..e704bfad7eee --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/index.js @@ -0,0 +1,70 @@ +/** +* @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 solves one of the systems of equations `A*x = b` or `A^T*x = b` or `x = A^H*x` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular band matrix, with ( `K` + 1 ) diagonals. +* +* @module @stdlib/blas/base/ctbsv +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var ctbsv = require( '@stdlib/blas/base/ctbsv' ); +* +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] ); +* var x = new Complex64Array( [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] ); +* +* ctbsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x, 1 ); +* // x => [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var ctbsv = require( '@stdlib/blas/base/ctbsv' ); +* +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] ); +* var x = new Complex64Array( [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] ); +* +* ctbsv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, 1, 0, x, 1, 0 ); +* // x => [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.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 ctbsv; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + ctbsv = main; +} else { + ctbsv = tmp; +} + + +// EXPORTS // + +module.exports = ctbsv; + +// exports: { "ndarray": "ctbsv.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/main.js b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/main.js new file mode 100644 index 000000000000..e6dc44c6bd14 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/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 ctbsv = require( './ctbsv.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( ctbsv, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = ctbsv; diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/ndarray.js new file mode 100644 index 000000000000..f16f558cef41 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/ndarray.js @@ -0,0 +1,93 @@ +/** +* @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 `x = A^H*x` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular band matrix, with ( `K` + 1 ) diagonals. +* +* @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 {NonNegativeInteger} K - number of super-diagonals or sub-diagonals of the matrix `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} fifth argument must be a nonnegative integer +* @throws {RangeError} eleventh argument must be non-zero +* @returns {Complex64Array} `x` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] ); +* var x = new Complex64Array( [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] ); +* +* ctbsv( 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, 1, 0, x, 1, 0 ); +* // x => [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +*/ +function ctbsv( uplo, trans, diag, N, K, 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 ( K < 0 ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', K ) ); + } + if ( strideX === 0 ) { + throw new RangeError( format( 'invalid argument. Eleventh argument must be non-zero. Value: `%d`.', strideA2 ) ); + } + if ( N === 0 ) { + return x; + } + return base( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, strideX, offsetX ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = ctbsv; diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/package.json b/lib/node_modules/@stdlib/blas/base/ctbsv/package.json new file mode 100644 index 000000000000..9617e9387f6e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/blas/base/ctbsv", + "version": "0.0.0", + "description": "Solve 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", + "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", + "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", + "ctbsv", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "complex64", + "float", + "complex64array" + ] +} From f19e48a9c7bbc1513ed144535ca87fba1aaade06 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 27 Apr 2026 06:43:06 +0000 Subject: [PATCH 17/29] 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 --- --- .../ctbsv/test/fixtures/column_major_xn.json | 2 + .../ctbsv/test/fixtures/column_major_xp.json | 2 + .../ctbsv/test/fixtures/row_major_xn.json | 2 + .../ctbsv/test/fixtures/row_major_xp.json | 2 + .../blas/base/ctbsv/test/test.ctbsv.js | 831 +++++++++++++ .../@stdlib/blas/base/ctbsv/test/test.js | 82 ++ .../blas/base/ctbsv/test/test.ndarry.js | 1099 +++++++++++++++++ 7 files changed, 2020 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/test.ctbsv.js create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/test.js create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/test/test.ndarry.js diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xn.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xn.json index b8677af54156..44b925d2905d 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xn.json +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xn.json @@ -1,4 +1,5 @@ { + "order": "column-major", "uplo": "lower", "trans": "no-transpose", "diag": "non-unit", @@ -16,6 +17,7 @@ [ 3.0, 3.0, -5.0, -5.0, 7.0, 7.0, 0.0, 0.0 ], [ 0.0, 0.0, 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ] ], + "LDA": 3, "strideA1": 1, "strideA2": 3, "offsetA": 0, diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xp.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xp.json index e24871a78a05..3622edb293cb 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xp.json +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/column_major_xp.json @@ -1,4 +1,5 @@ { + "order": "column-major", "uplo": "lower", "trans": "no-transpose", "diag": "non-unit", @@ -16,6 +17,7 @@ [ 3.0, 3.0, -5.0, -5.0, 7.0, 7.0, 0.0, 0.0 ], [ 0.0, 0.0, 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ] ], + "LDA": 3, "strideA1": 1, "strideA2": 3, "offsetA": 0, diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xn.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xn.json index 3e7206b41561..fc9029928258 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xn.json +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xn.json @@ -1,4 +1,5 @@ { + "order": "row-major", "uplo": "lower", "trans": "no-transpose", "diag": "non-unit", @@ -17,6 +18,7 @@ [ 3.0, 3.0, -5.0, -5.0, 7.0, 7.0, 0.0, 0.0 ], [ 0.0, 0.0, 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ] ], + "LDA": 3, "strideA1": 3, "strideA2": 1, "offsetA": 0, diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xp.json b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xp.json index 4267e1627978..4d1701f92a83 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xp.json +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/fixtures/row_major_xp.json @@ -1,4 +1,5 @@ { + "order": "row-major", "uplo": "lower", "trans": "no-transpose", "diag": "non-unit", @@ -17,6 +18,7 @@ [ 3.0, 3.0, -5.0, -5.0, 7.0, 7.0, 0.0, 0.0 ], [ 0.0, 0.0, 6.0, 6.0, -8.0, -8.0, 9.0, 9.0 ] ], + "LDA": 3, "strideA1": 3, "strideA2": 1, "offsetA": 0, diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/test.ctbsv.js b/lib/node_modules/@stdlib/blas/base/ctbsv/test/test.ctbsv.js new file mode 100644 index 000000000000..bb62c72dc0ee --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/test.ctbsv.js @@ -0,0 +1,831 @@ +/** +* @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 ctbsv = require( './../lib/ctbsv.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 ctbsv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 10', function test( t ) { + t.strictEqual( ctbsv.length, 10, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', function test( t ) { + var values; + var data; + var i; + 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() { + ctbsv( value, data.uplo, data.trans, data.diag, data.N, data.K, 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() { + ctbsv( data.order, value, data.trans, data.diag, data.N, data.K, 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() { + ctbsv( data.order, data.uplo, value, data.diag, data.N, data.K, 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() { + ctbsv( data.order, data.uplo, data.trans, value, data.N, data.K, 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() { + ctbsv( data.order, data.uplo, data.trans, data.diag, value, data.K, a, data.LDA, x, data.strideX ); + }; + } +}); + +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 = [ + -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() { + ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, value, a, data.LDA, x, data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid eighth 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() { + ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, value, x, data.strideX ); + }; + } +}); + +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() { + ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, value ); + }; + } +}); + +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; + var a; + var x; + + data = rlntnu; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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` or `A^H*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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + 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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + + 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 = ctbsv( data.order, data.uplo, data.trans, data.diag, 0, data.K, a, data.LDA, x, data.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, '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 = ctbsv( data.order, data.uplo, data.trans, data.diag, 0, data.K, a, data.LDA, x, data.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rxp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` stride (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cxp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + 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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + 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 = ctbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, a, data.LDA, x, data.strideX ); + 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/ctbsv/test/test.js b/lib/node_modules/@stdlib/blas/base/ctbsv/test/test.js new file mode 100644 index 000000000000..549565ffa6bf --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/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 ctbsv = 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 ctbsv, '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 ctbsv.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 ctbsv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( ctbsv, 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 ctbsv; + var main; + + main = require( './../lib/ctbsv.js' ); + + ctbsv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( ctbsv, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/test/test.ndarry.js b/lib/node_modules/@stdlib/blas/base/ctbsv/test/test.ndarry.js new file mode 100644 index 000000000000..35cf128d5d87 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/test/test.ndarry.js @@ -0,0 +1,1099 @@ +/** +* @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 ctbsv = 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 ctbsv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 12', function test( t ) { + t.strictEqual( ctbsv.length, 12, '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() { + ctbsv( value, data.trans, data.diag, data.N, data.K, 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() { + ctbsv( data.uplo, value, data.diag, data.N, data.K, 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() { + ctbsv( data.uplo, data.trans, value, data.N, data.K, 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() { + ctbsv( data.uplo, data.trans, data.diag, value, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + }; + } +}); + +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() { + ctbsv( data.uplo, data.trans, data.diag, data.N, value, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid eleventh 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() { + ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + 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` or `A^H*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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + 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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + + 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 = ctbsv( data.uplo, data.trans, data.diag, 0, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, '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 = ctbsv( data.uplo, data.trans, data.diag, 0, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, '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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + 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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rxp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` stride (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cxp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` stride (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cxp; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + 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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + 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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + 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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + 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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (row-major)', function test( t ) { + var expected; + var 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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1sa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1nsa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1nsa2; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1sa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1sa2n; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + 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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + 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 = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rcap; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = ccap; + + a = new Complex64Array( data.A ); + x = new Complex64Array( data.x ); + + expected = new Complex64Array( data.x_out ); + + out = ctbsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.strictEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); From f12aae06d55d86fd57e4e0518e571ff09687c380 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 27 Apr 2026 06:49:14 +0000 Subject: [PATCH 18/29] docs: add types --- 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/ctbsv/docs/types/index.d.ts | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/index.d.ts diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/index.d.ts new file mode 100644 index 000000000000..0f5ec622ec80 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/index.d.ts @@ -0,0 +1,123 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Layout, MatrixTriangle, TransposeOperation, DiagonalType } from '@stdlib/types/blas'; +import { Complex64Array } from '@stdlib/types/array'; + +/** +* Interface describing `ctbsv`. +*/ +interface Routine { + /** + * Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `x = A^H*x` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular band matrix, with ( `K` + 1 ) diagonals. + * + * @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 K - number of super-diagonals or sub-diagonals of 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 - stride length for `x` + * @returns `x` + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * + * var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] ); + * var x = new Complex64Array( [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] ); + * + * ctbsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x, 1 ); + * // x => [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] + */ + ( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, K: 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 `x = A^H*x`, using alternative indexing semantics and where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular band matrix, with (`K` + 1) diagonals. + * + * @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 K - number of super-diagonals or sub-diagonals of the matrix `A` + * @param A - input matrix + * @param strideA1 - stride of the first dimension of `A` + * @param strideA2 - stride of the second dimension of `A` + * @param offsetA - starting index for `A` + * @param x - input vector + * @param strideX - stride length for `x` + * @param offsetX - starting index for `x` + * @returns `x` + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * + * var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] ); + * var x = new Complex64Array( [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] ); + * + * ctbsv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, 1, 0, x, 1, 0 ); + * // x => [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] + */ + ndarray( uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, K: 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 `x = A^H*x` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular band matrix, with ( `K` + 1 ) diagonals. +* +* @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 K - number of super-diagonals or sub-diagonals of 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 - stride length for `x` +* @returns `x` +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] ); +* var x = new Complex64Array( [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] ); +* +* ctbsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x, 1 ); +* // x => [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] ); +* var x = new Complex64Array( [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] ); +* +* ctbsv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, 1, 0, x, 1, 0 ); +* // x => [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +*/ +declare var ctbsv: Routine; + + +// EXPORTS // + +export = ctbsv; From ae00aa2ec64270710ebc32e31299c3320811e4d0 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 27 Apr 2026 06:55:05 +0000 Subject: [PATCH 19/29] docs: add types 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: na - task: lint_license_headers status: passed --- --- .../blas/base/ctbsv/docs/types/tests.ts | 407 ++++++++++++++++++ 1 file changed, 407 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/tests.ts diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/tests.ts b/lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/tests.ts new file mode 100644 index 000000000000..e8bde4bae4dc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/tests.ts @@ -0,0 +1,407 @@ +/* +* @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 ctbsv = require( './index' ); + + +// TESTS // + +// The function returns a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 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 ); + + ctbsv( 10, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( true, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( false, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( null, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( undefined, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( [], 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( {}, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( ( x: number ): number => x, 'upper', 'no-transpose', 'unit', 10, 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 ); + + ctbsv( 'row-major', 10, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', true, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', false, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', null, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', undefined, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', [], 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', {}, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', ( x: number ): number => x, 'no-transpose', 'unit', 10, 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 ); + + ctbsv( 'row-major', 'upper', 10, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', true, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', false, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', null, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', undefined, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', [], 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', {}, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', ( x: number ): number => x, 'unit', 10, 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 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 10, 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', true, 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', false, 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', null, 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', undefined, 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', [], 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', {}, 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', ( x: number ): number => x, 10, 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 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', '10', 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', true, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', false, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', null, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', undefined, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', [], 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', {}, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', ( x: number ): number => x, 10, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, '10', A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, true, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, false, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, null, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, undefined, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, [], A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, {}, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, ( x: number ): number => x, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, 10, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, '10', 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, true, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, false, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, null, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, undefined, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, [ '1' ], 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, {}, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, ( x: number ): number => x, 10, x, 1 ); // $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 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, '10', x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, true, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, false, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, null, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, undefined, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, [], x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, {}, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, ( x: number ): number => x, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a Complex64Array... +{ + const A = new Complex64Array( 20 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 10, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, '10', 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, true, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, false, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, null, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, undefined, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, [ '1' ], 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, {}, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, '10' ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, true ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, false ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, null ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, undefined ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, [] ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, {} ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 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 ); + + ctbsv(); // $ExpectError + ctbsv( 'row-major' ); // $ExpectError + ctbsv( 'row-major', 'upper' ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose' ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit' ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 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 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 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 ); + + ctbsv.ndarray( 10, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( true, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( false, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( null, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( undefined, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( [], 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( {}, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( ( x: number ): number => x, 'no-transpose', 'unit', 10, 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 ); + + ctbsv.ndarray( 'upper', 10, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', true, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', false, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', null, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', undefined, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', [], 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', {}, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', ( x: number ): number => x, 'unit', 10, 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 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 10, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', true, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', false, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', null, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', undefined, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', [], 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', {}, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', ( x: number ): number => x, 10, 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 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', '10', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', true, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', false, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', null, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', undefined, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', [], 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', {}, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', ( x: number ): number => x, 10, 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 number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, '10', A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, true, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, false, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, null, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, undefined, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, [], A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, {}, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, ( x: number ): number => x, A, 10, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, 10, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, '10', 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, true, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, false, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, null, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, undefined, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, [ '1' ], 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, {}, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, ( x: number ): number => x, 10, 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 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, '10', 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, true, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, false, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, null, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, undefined, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, [], 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, {}, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, ( x: number ): number => x, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eighth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, '10', 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, true, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, false, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, null, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, undefined, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, [], 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, {}, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, ( x: number ): number => x, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an ninth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, '10', x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, true, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, false, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, null, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, undefined, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, [], x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, {}, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, ( x: number ): number => x, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a Complex64Array... +{ + const A = new Complex64Array( 20 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, 10, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, '10', 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, true, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, false, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, null, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, undefined, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, [ '1' ], 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, {}, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eleventh argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, '10', 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, true, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, false, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, null, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, undefined, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, [], 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, {}, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an twelfth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, '10' ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, true ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, false ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, null ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, undefined ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, [] ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, {} ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 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 ); + + ctbsv.ndarray(); // $ExpectError + ctbsv.ndarray( 'upper' ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose' ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit' ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0, 10 ); // $ExpectError +} From 4fb42dac7d79b84e133fb6bc0b5bf2bc3853f5c3 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 27 Apr 2026 06:55:31 +0000 Subject: [PATCH 20/29] docs: add types 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/ctbsv/docs/types/test.ts | 407 ++++++++++++++++++ 1 file changed, 407 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/test.ts diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/test.ts new file mode 100644 index 000000000000..af9009a5e838 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/test.ts @@ -0,0 +1,407 @@ +/* +* @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 ctbsv = require( '@stdlib/blas/base/ctbsv' ); + + +// TESTS // + +// The function returns a Complex64Array... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 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 ); + + ctbsv( 10, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( true, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( false, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( null, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( undefined, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( [], 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( {}, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( ( x: number ): number => x, 'upper', 'no-transpose', 'unit', 10, 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 ); + + ctbsv( 'row-major', 10, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', true, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', false, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', null, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', undefined, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', [], 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', {}, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', ( x: number ): number => x, 'no-transpose', 'unit', 10, 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 ); + + ctbsv( 'row-major', 'upper', 10, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', true, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', false, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', null, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', undefined, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', [], 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', {}, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', ( x: number ): number => x, 'unit', 10, 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 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 10, 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', true, 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', false, 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', null, 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', undefined, 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', [], 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', {}, 10, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', ( x: number ): number => x, 10, 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 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', '10', 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', true, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', false, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', null, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', undefined, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', [], 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', {}, 10, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', ( x: number ): number => x, 10, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, '10', A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, true, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, false, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, null, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, undefined, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, [], A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, {}, A, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, ( x: number ): number => x, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, 10, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, '10', 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, true, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, false, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, null, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, undefined, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, [ '1' ], 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, {}, 10, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, ( x: number ): number => x, 10, x, 1 ); // $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 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, '10', x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, true, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, false, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, null, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, undefined, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, [], x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, {}, x, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, ( x: number ): number => x, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a Complex64Array... +{ + const A = new Complex64Array( 20 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 10, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, '10', 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, true, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, false, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, null, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, undefined, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, [ '1' ], 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, {}, 1 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, '10' ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, true ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, false ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, null ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, undefined ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, [] ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, {} ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 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 ); + + ctbsv(); // $ExpectError + ctbsv( 'row-major' ); // $ExpectError + ctbsv( 'row-major', 'upper' ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose' ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit' ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10 ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x ); // $ExpectError + ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 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 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 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 ); + + ctbsv.ndarray( 10, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( true, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( false, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( null, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( undefined, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( [], 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( {}, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( ( x: number ): number => x, 'no-transpose', 'unit', 10, 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 ); + + ctbsv.ndarray( 'upper', 10, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', true, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', false, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', null, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', undefined, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', [], 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', {}, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', ( x: number ): number => x, 'unit', 10, 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 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 10, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', true, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', false, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', null, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', undefined, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', [], 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', {}, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', ( x: number ): number => x, 10, 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 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', '10', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', true, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', false, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', null, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', undefined, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', [], 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', {}, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', ( x: number ): number => x, 10, 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 number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, '10', A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, true, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, false, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, null, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, undefined, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, [], A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, {}, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, ( x: number ): number => x, A, 10, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a Complex64Array... +{ + const x = new Complex64Array( 10 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, 10, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, '10', 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, true, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, false, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, null, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, undefined, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, [ '1' ], 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, {}, 10, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, ( x: number ): number => x, 10, 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 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, '10', 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, true, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, false, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, null, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, undefined, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, [], 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, {}, 1, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, ( x: number ): number => x, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eighth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, '10', 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, true, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, false, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, null, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, undefined, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, [], 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, {}, 0, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, ( x: number ): number => x, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an ninth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, '10', x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, true, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, false, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, null, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, undefined, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, [], x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, {}, x, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, ( x: number ): number => x, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a Complex64Array... +{ + const A = new Complex64Array( 20 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, 10, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, '10', 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, true, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, false, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, null, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, undefined, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, [ '1' ], 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, {}, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eleventh argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, '10', 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, true, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, false, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, null, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, undefined, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, [], 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, {}, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an twelfth argument which is not a number... +{ + const x = new Complex64Array( 10 ); + const A = new Complex64Array( 20 ); + + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, '10' ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, true ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, false ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, null ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, undefined ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, [] ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, {} ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 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 ); + + ctbsv.ndarray(); // $ExpectError + ctbsv.ndarray( 'upper' ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose' ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit' ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1 ); // $ExpectError + ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0, 10 ); // $ExpectError +} From b35329dae2d00e323c4659e586b2bb8231c7b221 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 27 Apr 2026 07:05:32 +0000 Subject: [PATCH 21/29] 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/ctbsv/docs/repl.txt | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/docs/repl.txt diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/ctbsv/docs/repl.txt new file mode 100644 index 000000000000..552af753894a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/docs/repl.txt @@ -0,0 +1,160 @@ + +{{alias}}( order, uplo, trans, diag, N, K, A, lda, x, sx ) + Solves one of the systems of equations `A*x = b` or `A^T*x = b` or + `x = A^H*x` where `b` and `x` are `N` element vectors and `A` is an `N` by + `N` unit, or non-unit, upper or lower triangular band matrix, with ( `K` + 1 + ) diagonals. + + 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. + + diag: string + Specifies whether `A` has a unit diagonal. + + N: integer + Number of elements along each dimension of `A`. + + K: integer + Number of super-diagonals or sub-diagonals of the matrix `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; + > x = new {{alias:@stdlib/array/complex64}}([0.0,2.0,0.0,16.0,0.0,46.0]); + > var buf = [0.0,0.0,1.0,1.0,2.0,2.0,3.0,3.0,4.0,4.0,5.0,5.0]; + > 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, 1, A, 2, x, 1 ) + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] + + // Advanced indexing: + > x = new {{alias:@stdlib/array/complex64}}([0.0,46.0,0.0,16.0,0.0,2.0]); + > buf = [0.0,0.0,1.0,1.0,2.0,2.0,3.0,3.0,4.0,4.0,5.0,5.0]; + > A = new {{alias:@stdlib/array/complex64}}( buf ); + > ord = 'row-major'; + > uplo = 'lower'; + > trans = 'no-transpose'; + > diag = 'non-unit'; + > {{alias}}( ord, uplo, trans, diag, 3, 1, A, 2, x, -1 ) + [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] + + // Using typed array views: + > var x0buf = [0.0,0.0,0.0,2.0,0.0,16.0,0.0,46.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 ); + > buf = [0.0,0.0,1.0,1.0,2.0,2.0,3.0,3.0,4.0,4.0,5.0,5.0]; + > A = new {{alias:@stdlib/array/complex64}}( buf ); + > ord = 'row-major'; + > uplo = 'lower'; + > trans = 'no-transpose'; + > diag = 'non-unit'; + > {{alias}}( ord, uplo, trans, diag, 3, 1, A, 2, x1, 1 ) + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] + + +{{alias}}.ndarray( uplo, trans, diag, N, K, A, sa1, sa2, oa, x, sx, ox ) + Solves one of the systems of equations `x = A*x` or `x = A^T*x` or + `x = A^H*x`, using alternative indexing semantics and where `x` is an `N` + element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower + triangular band matrix, with ( `K` + 1 ) diagonals. + + 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. + + diag: string + Specifies whether `A` has a unit diagonal. + + N: integer + Number of elements along each dimension of `A`. + + K: integer + Number of super-diagonals or sub-diagonals of the matrix `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}}([0.0,2.0,0.0,16.0,0.0,46.0]); + > buf = [0.0,0.0,1.0,1.0,2.0,2.0,3.0,3.0,4.0,4.0,5.0,5.0]; + > A = new {{alias:@stdlib/array/complex64}}( buf ); + > ord = 'row-major'; + > uplo = 'lower'; + > trans = 'no-transpose'; + > diag = 'non-unit'; + > {{alias}}.ndarray( uplo, trans, diag, 3, 1, A, 2, 1, 0, x, 1, 0 ) + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] + + See Also + -------- From 72663afe3fcaeb5330d96e8f54f1ee7eea1fa5bc Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 27 Apr 2026 07:13:50 +0000 Subject: [PATCH 22/29] chore: remove file --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: 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/ctbsv/docs/types/tests.ts | 407 ------------------ 1 file changed, 407 deletions(-) delete mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/tests.ts diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/tests.ts b/lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/tests.ts deleted file mode 100644 index e8bde4bae4dc..000000000000 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/docs/types/tests.ts +++ /dev/null @@ -1,407 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2026 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64Array = require( '@stdlib/array/complex64' ); -import ctbsv = require( './index' ); - - -// TESTS // - -// The function returns a Complex64Array... -{ - const x = new Complex64Array( 10 ); - const A = new Complex64Array( 20 ); - - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 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 ); - - ctbsv( 10, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( true, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( false, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( null, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( undefined, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( [], 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( {}, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( ( x: number ): number => x, 'upper', 'no-transpose', 'unit', 10, 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 ); - - ctbsv( 'row-major', 10, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', true, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', false, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', null, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', undefined, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', [], 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', {}, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', ( x: number ): number => x, 'no-transpose', 'unit', 10, 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 ); - - ctbsv( 'row-major', 'upper', 10, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', true, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', false, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', null, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', undefined, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', [], 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', {}, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', ( x: number ): number => x, 'unit', 10, 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 ); - - ctbsv( 'row-major', 'upper', 'no-transpose', 10, 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', true, 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', false, 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', null, 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', undefined, 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', [], 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', {}, 10, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', ( x: number ): number => x, 10, 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 ); - - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', '10', 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', true, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', false, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', null, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', undefined, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', [], 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', {}, 10, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', ( x: number ): number => x, 10, A, 10, x, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a sixth argument which is not a number... -{ - const x = new Complex64Array( 10 ); - const A = new Complex64Array( 20 ); - - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, '10', A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, true, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, false, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, null, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, undefined, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, [], A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, {}, A, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, ( x: number ): number => x, A, 10, x, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a seventh argument which is not a Complex64Array... -{ - const x = new Complex64Array( 10 ); - - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, 10, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, '10', 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, true, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, false, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, null, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, undefined, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, [ '1' ], 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, {}, 10, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, ( x: number ): number => x, 10, x, 1 ); // $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 ); - - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, '10', x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, true, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, false, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, null, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, undefined, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, [], x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, {}, x, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, ( x: number ): number => x, x, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a ninth argument which is not a Complex64Array... -{ - const A = new Complex64Array( 20 ); - - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 10, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, '10', 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, true, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, false, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, null, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, undefined, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, [ '1' ], 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, {}, 1 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, ( x: number ): number => x, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a tenth argument which is not a number... -{ - const x = new Complex64Array( 10 ); - const A = new Complex64Array( 20 ); - - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, '10' ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, true ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, false ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, null ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, undefined ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, [] ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, {} ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 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 ); - - ctbsv(); // $ExpectError - ctbsv( 'row-major' ); // $ExpectError - ctbsv( 'row-major', 'upper' ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose' ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit' ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10 ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x ); // $ExpectError - ctbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 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 ); - - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 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 ); - - ctbsv.ndarray( 10, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( true, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( false, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( null, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( undefined, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( [], 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( {}, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( ( x: number ): number => x, 'no-transpose', 'unit', 10, 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 ); - - ctbsv.ndarray( 'upper', 10, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', true, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', false, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', null, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', undefined, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', [], 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', {}, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', ( x: number ): number => x, 'unit', 10, 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 ); - - ctbsv.ndarray( 'upper', 'no-transpose', 10, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', true, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', false, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', null, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', undefined, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', [], 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', {}, 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', ( x: number ): number => x, 10, 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 ); - - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', '10', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', true, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', false, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', null, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', undefined, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', [], 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', {}, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', ( x: number ): number => x, 10, 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 number... -{ - const x = new Complex64Array( 10 ); - const A = new Complex64Array( 20 ); - - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, '10', A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, true, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, false, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, null, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, undefined, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, [], A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, {}, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, ( x: number ): number => x, A, 10, 1, 0, x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a sixth argument which is not a Complex64Array... -{ - const x = new Complex64Array( 10 ); - - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, 10, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, '10', 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, true, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, false, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, null, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, undefined, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, [ '1' ], 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, {}, 10, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, ( x: number ): number => x, 10, 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 ); - - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, '10', 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, true, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, false, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, null, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, undefined, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, [], 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, {}, 1, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, ( x: number ): number => x, 1, 0, x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a eighth argument which is not a number... -{ - const x = new Complex64Array( 10 ); - const A = new Complex64Array( 20 ); - - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, '10', 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, true, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, false, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, null, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, undefined, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, [], 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, {}, 0, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, ( x: number ): number => x, 0, x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided an ninth argument which is not a number... -{ - const x = new Complex64Array( 10 ); - const A = new Complex64Array( 20 ); - - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, '10', x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, true, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, false, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, null, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, undefined, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, [], x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, {}, x, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, ( x: number ): number => x, x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a tenth argument which is not a Complex64Array... -{ - const A = new Complex64Array( 20 ); - - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, 10, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, '10', 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, true, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, false, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, null, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, undefined, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, [ '1' ], 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, {}, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a eleventh argument which is not a number... -{ - const x = new Complex64Array( 10 ); - const A = new Complex64Array( 20 ); - - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, '10', 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, true, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, false, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, null, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, undefined, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, [], 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, {}, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided an twelfth argument which is not a number... -{ - const x = new Complex64Array( 10 ); - const A = new Complex64Array( 20 ); - - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, '10' ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, true ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, false ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, null ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, undefined ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, [] ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, {} ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 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 ); - - ctbsv.ndarray(); // $ExpectError - ctbsv.ndarray( 'upper' ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose' ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit' ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1 ); // $ExpectError - ctbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0, 10 ); // $ExpectError -} From c43a650d82f8764f3e927cf60933676f95639918 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 27 Apr 2026 07:23:17 +0000 Subject: [PATCH 23/29] docs: add js 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/ctbsv/examples/index.js | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/examples/index.js diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/examples/index.js b/lib/node_modules/@stdlib/blas/base/ctbsv/examples/index.js new file mode 100644 index 000000000000..012346aeaa57 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/examples/index.js @@ -0,0 +1,45 @@ +/** +* @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 ctbsv = require( './../lib' ); + +function rand() { + return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); +} + +var N = 3; +var K = 1; + +var x = filledarrayBy( N, 'complex64', rand ); +var A = filledarrayBy( (K+1)*N, 'complex64', rand ); + +ctbsv( 'row-major', 'lower', 'no-transpose', 'non-unit', N, 1, A, (K+1), x, 1 ); + +// Print the results: +logEach( '%s', x ); + +ctbsv.ndarray( 'upper', 'no-transpose', 'unit', N, 1, A, (K+1), 1, 0, x, 1, 0 ); + +// Print the results: +logEach( '%s', x ); From 3c2d3faa3dd0922a4745311d32607322292c66a3 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 27 Apr 2026 08:53:02 +0000 Subject: [PATCH 24/29] 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/ctbsv/benchmark/benchmark.js | 117 ++++++++++++++++++ .../base/ctbsv/benchmark/benchmark.ndarray.js | 116 +++++++++++++++++ 2 files changed, 233 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/benchmark/benchmark.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/ctbsv/benchmark/benchmark.js new file mode 100644 index 000000000000..285f8c1265f9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/benchmark/benchmark.js @@ -0,0 +1,117 @@ +/** +* @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 ctbsv = require( './../lib/ctbsv.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 K; + var x; + + xbuf = uniform( N*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + + K = N - 1; + Abuf = uniform( (K+1)*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 = ctbsv( 'row-major', 'upper', 'transpose', 'non-unit', N, 1, A, (K+1), 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/ctbsv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/ctbsv/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..c70c4bd76a8d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/benchmark/benchmark.ndarray.js @@ -0,0 +1,116 @@ +/** +* @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 ctbsv = 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 K; + var x; + + xbuf = uniform( N*2, -100.0, 100.0, options ); + x = new Complex64Array( xbuf.buffer ); + K = N - 1; + Abuf = uniform( (K+1)*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 = ctbsv( 'upper', 'transpose', 'non-unit', N, 1, A, (K+1), 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 fd1d9160fdc1605c39db3e59b87a2941c849090b Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 27 Apr 2026 09:04:08 +0000 Subject: [PATCH 25/29] docs: add readme --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: 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/ctbsv/README.md | 282 ++++++++++++++++++ 1 file changed, 282 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/ctbsv/README.md diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/README.md b/lib/node_modules/@stdlib/blas/base/ctbsv/README.md new file mode 100644 index 000000000000..295acf2d5702 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/README.md @@ -0,0 +1,282 @@ + + +# ctbsv + +> Solve one of the systems of equations `x = A*x` or `x = A^T*x` or `x = A^H*x`. + + +
+ +## Usage + +```javascript +var ctbsv = require( '@stdlib/blas/base/ctbsv' ); +``` + +#### ctbsv( order, uplo, trans, diag, N, K, A, LDA, x, sx ) + +Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `x = A^H*x` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular band matrix, with ( `K` + 1 ) diagonals. + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] ); +var x = new Complex64Array( [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] ); + +ctbsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x, 1 ); +// x => [ 1.0, 1.0, 2.0, 2.0, 3.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`. +- **K**: number of super-diagonals or sub-diagonals of the matrix `A`. +- **A**: input band matrix stored in linear memory as a [`Complex64Array`][@stdlib/array/complex64]. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **x**: input [`Complex64Array`][@stdlib/array/complex64]. +- **sx**: stride length for `x`. + +The stride parameters determine how elements are accessed. For example, to iterate over every other element in `x`, + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] ); +var x = new Complex64Array( [ 0.0, 2.0, 0.0, 0.0, 0.0, 16.0, 0.0, 0.0, 0.0, 46.0 ] ); + +ctbsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x, 2 ); +// x => [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.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, 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] ); +var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] ); + +// Create offset views... +var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd complex element + +ctbsv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, x1, 1 ); +// x1 => [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] +``` + + + +#### ctbsv.ndarray( uplo, trans, diag, N, K, A, sa1, sa2, oa, x, sx, ox ) + +Solves one of the systems of equations `x = A*x` or `x = A^T*x` or `x = A^H*x`, using alternative indexing semantics and where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular band matrix, with (`K` + 1) diagonals. + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var A = new Complex64Array( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] ); +var x = new Complex64Array( [ 0.0, 2.0, 0.0, 16.0, 0.0, 46.0 ] ); + +ctbsv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, 1, 0, x, 1, 0 ); +// x => [ 1.0, 1.0, 2.0, 2.0, 3.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( [ 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0 ] ); +var x = new Complex64Array( [ 0.0, 46.0, 0.0, 16.0, 0.0, 2.0 ] ); + +ctbsv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, 1, A, 2, 1, 0, x, -1, 2 ); +// x => [ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ] +``` + +
+ + + +
+ +## Notes + +- `ctbsv()` corresponds to the [BLAS][blas] level 2 function [`ctbsv`][ctbsv]. + +
+ + + +
+ +## 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 ctbsv = require( '@stdlib/blas/base/ctbsv' ); + +function rand() { + return new Complex64( discreteUniform( 0, 255 ), discreteUniform( -128, 127 ) ); +} + +var N = 3; +var K = 1; + +var A = filledarrayBy( (K+1)*N, 'complex64', rand ); +var x = filledarrayBy( N, 'complex64', rand ); + +ctbsv( 'row-major', 'lower', 'no-transpose', 'non-unit', N, 1, A, (K+1), x, 1 ); + +// Print the results: +logEach( '%s', x ); + +ctbsv.ndarray( 'lower', 'no-transpose', 'non-unit', N, 1, A, (K+1), 1, 0, x, 2, 1 ); + +// Print the results: +logEach( '%s', x ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + From 5dcb3c83ee71af8a2615520e350df29c61dcf4a6 Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 27 Apr 2026 09:13:47 +0000 Subject: [PATCH 26/29] refactor: improve float 32 precision --- 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/ctbsv/lib/base.js | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js index 92f609adedad..b318f5c1565f 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js @@ -127,15 +127,15 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0 + 1 ]; - retmp -= f32( ( rea * rex ) - ( ima * imx ) ); - imtmp -= f32( ( rea * imx ) + ( ima * rex ) ); + retmp -= f32( f32( rea * rex ) - f32( ima * imx ) ); + imtmp -= f32( f32( rea * imx ) + f32( ima * rex ) ); } if ( nonunit ) { rea = viewA[ oa2 ]; ima = sign * viewA[ oa2 + 1 ]; - magsq = f32( ( rea * rea ) + ( ima * ima ) ); - remul = f32( ( retmp * rea ) + ( imtmp * ima ) ); - immul = f32( ( imtmp * rea ) - ( retmp * ima ) ); + 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 ); } @@ -157,20 +157,20 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri oa2 = oa + ( i1 * sa1 ); for ( i0 = max( 0, i1 - K ); i0 < i1; i0++ ) { ix0 = ox + ( i0 * sx ); - ia = oa2 + ( ( i0 - i1 ) * ( sa1 - sa0 ) ); + ia = oa2 + ( f32( i0 - i1 ) * f32( sa1 - sa0 ) ); rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0 + 1 ]; - retmp -= f32( ( rea * rex ) - ( ima * imx ) ); - imtmp -= f32( ( rea * imx ) + ( ima * rex ) ); + retmp -= f32( f32( rea * rex ) - f32( ima * imx ) ); + imtmp -= f32( f32( rea * imx ) + f32( ima * rex ) ); } if ( nonunit ) { rea = viewA[ oa2 ]; ima = sign * viewA[ oa2 + 1 ]; - magsq = f32( ( rea * rea ) + ( ima * ima ) ); - remul = f32( ( retmp * rea ) + ( imtmp * ima ) ); - immul = f32( ( imtmp * rea ) - ( retmp * ima ) ); + 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 ); } @@ -197,15 +197,15 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0 + 1 ]; - retmp -= f32( ( rea * rex ) - ( ima * imx ) ); - imtmp -= f32( ( rea * imx ) + ( ima * rex ) ); + retmp -= f32( f32( rea * rex ) - f32( ima * imx ) ); + imtmp -= f32( f32( rea * imx ) + f32( ima * rex ) ); } if ( nonunit ) { rea = viewA[ oa2 ]; ima = sign * viewA[ oa2 + 1 ]; - magsq = f32( ( rea * rea ) + ( ima * ima ) ); - remul = f32( ( retmp * rea ) + ( imtmp * ima ) ); - immul = f32( ( imtmp * rea ) - ( retmp * ima ) ); + 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 ); } @@ -229,15 +229,15 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0 + 1 ]; - retmp -= f32( ( rea * rex ) - ( ima * imx ) ); - imtmp -= f32( ( rea * imx ) + ( ima * rex ) ); + retmp -= f32( f32( rea * rex ) - f32( ima * imx ) ); + imtmp -= f32( f32( rea * imx ) + f32( ima * rex ) ); } if ( nonunit ) { rea = viewA[ oa2 ]; ima = sign * viewA[ oa2 + 1 ]; - magsq = f32( ( rea * rea ) + ( ima * ima ) ); - remul = f32( ( retmp * rea ) + ( imtmp * ima ) ); - immul = f32( ( imtmp * rea ) - ( retmp * ima ) ); + 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 ); } From 8e34d55557f303221409a35aa7d2e1eeb01af41f Mon Sep 17 00:00:00 2001 From: Divit Date: Mon, 27 Apr 2026 10:22:58 +0000 Subject: [PATCH 27/29] refactor: update 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/ctbsv/lib/base.js | 62 +++++++++++++------ 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js index b318f5c1565f..46eebd7b0bde 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js @@ -58,6 +58,8 @@ var min = require( '@stdlib/math/base/special/min' ); */ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len var nonunit; + var i0start; + var i0end; var viewA; var viewX; var retmp; @@ -76,6 +78,7 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri var sa0; var sa1; var oa2; + var doa; var ox; var sx; var oa; @@ -108,27 +111,31 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri oa = offsetA * 2; ox = offsetX * 2; sx = strideX * 2; + doa = sa1 - sa0; if ( ( !isrm && uplo === 'upper' && trans === 'no-transpose' ) || ( isrm && uplo === 'lower' && trans !== 'no-transpose' ) ) { + ix1 = ox + ( ( N - 1 ) * sx ); + oa2 = oa + ( ( N - 1 ) * sa1 ) + ( K * sa0 ); for ( i1 = N - 1; i1 >= 0; i1-- ) { - ix1 = ox + ( i1 * sx ); rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; retmp = rex; imtmp = imx; - oa2 = oa + ( i1 * sa1 ) + ( K * sa0 ); - for ( i0 = i1 + 1; i0 <= min( N - 1, i1 + K ); i0++ ) { - ix0 = ox + ( i0 * sa0); - ia = oa2 + ( ( i0 - i1 ) * ( sa1 - sa0 ) ); + i0end = min( N - 1, i1 + K ); + ix0 = ix1 + sx; + ia = oa2 + doa; + for ( i0 = i1 + 1; i0 <= i0end; i0++ ) { rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0 + 1 ]; retmp -= f32( f32( rea * rex ) - f32( ima * imx ) ); imtmp -= f32( f32( rea * imx ) + f32( ima * rex ) ); + ix0 += sx; + ia += doa; } if ( nonunit ) { rea = viewA[ oa2 ]; @@ -141,6 +148,8 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri } viewX[ ix1 ] = retmp; viewX[ ix1 + 1 ] = imtmp; + ix1 -= sx; + oa2 -= sa1; } return x; } @@ -148,22 +157,26 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri ( !isrm && uplo === 'lower' && trans === 'no-transpose' ) || ( isrm && uplo === 'upper' && trans !== 'no-transpose' ) ) { + ix1 = ox; + oa2 = oa; for ( i1 = 0; i1 < N; i1++ ) { ix1 = ox + ( i1 * sx ); rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; retmp = rex; imtmp = imx; - oa2 = oa + ( i1 * sa1 ); - for ( i0 = max( 0, i1 - K ); i0 < i1; i0++ ) { - ix0 = ox + ( i0 * sx ); - ia = oa2 + ( f32( i0 - i1 ) * f32( sa1 - sa0 ) ); + i0start = max( 0, i1 - K ); + ix0 = ox + ( i0start * sx ); + ia = oa2 + ( ( i0start - i1 ) * doa ); + for ( i0 = i0start; i0 < i1; i0++ ) { rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0 + 1 ]; retmp -= f32( f32( rea * rex ) - f32( ima * imx ) ); imtmp -= f32( f32( rea * imx ) + f32( ima * rex ) ); + ix0 += sx; + ia += doa; } if ( nonunit ) { rea = viewA[ oa2 ]; @@ -176,6 +189,8 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri } viewX[ ix1 ] = retmp; viewX[ ix1 + 1 ] = imtmp; + ix1 += sx; + oa2 += sa1; } return x; } @@ -183,22 +198,26 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri ( !isrm && uplo === 'upper' && trans !== 'no-transpose' ) || ( isrm && uplo === 'lower' && trans === 'no-transpose' ) ) { + ix1 = ox; + oa2 = oa + ( K * sa0 ); for ( i1 = 0; i1 < N; i1++ ) { ix1 = ox + ( i1 * sx ); rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; retmp = rex; imtmp = imx; - oa2 = oa + ( i1 * sa1 ) + ( K * sa0 ); - for ( i0 = max( 0, i1 - K ); i0 < i1; i0++ ) { - ix0 = ox + ( i0 * sx ); - ia = oa2 + ( ( i0 - i1 ) * sa0 ); + i0start = max( 0, i1 - K ); + ix0 = ox + ( i0start * sx ); + ia = oa2 + ( ( i0start - i1 ) * sa0 ); + for ( i0 = i0start = max( 0, i1 - K ); i0 < i1; i0++ ) { rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0 + 1 ]; retmp -= f32( f32( rea * rex ) - f32( ima * imx ) ); imtmp -= f32( f32( rea * imx ) + f32( ima * rex ) ); + ix0 += sx; + ia += sa0; } if ( nonunit ) { rea = viewA[ oa2 ]; @@ -211,26 +230,31 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri } 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 + ( (N - 1) * sa1 ); for ( i1 = N - 1; i1 >= 0; i1-- ) { - ix1 = ox + ( i1 * sx ); rex = viewX[ ix1 ]; imx = viewX[ ix1 + 1 ]; retmp = rex; imtmp = imx; - oa2 = oa + ( i1 * sa1 ); - for ( i0 = min( N - 1, i1 + K ); i0 > i1; i0-- ) { - ix0 = ox + ( i0 * sx ); - ia = oa2 + ( ( i0 - i1 ) * sa0 ); + i0start = min( N - 1, i1 + K ); + ix0 = ox + ( i0start * sx ); + ia = oa2 + ( ( i0start - i1 ) * sa0 ); + for ( i0 = i0start; i0 > i1; i0-- ) { rea = viewA[ ia ]; ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0 + 1 ]; retmp -= f32( f32( rea * rex ) - f32( ima * imx ) ); imtmp -= f32( f32( rea * imx ) + f32( ima * rex ) ); + ix0 -= sx; + ia -= sa0; } if ( nonunit ) { rea = viewA[ oa2 ]; @@ -243,6 +267,8 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri } viewX[ ix1 ] = retmp; viewX[ ix1 + 1 ] = imtmp; + ix1 -= sx; + oa2 -= sa1; } return x; } From 91fbeedc9d1f5fed55e92f542757d13fbd7469b9 Mon Sep 17 00:00:00 2001 From: Divit Date: Tue, 28 Apr 2026 09:42:45 +0000 Subject: [PATCH 28/29] refactor: update temp subtrction --- 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/ctbsv/lib/base.js | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js index 46eebd7b0bde..1b499b689aa9 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js @@ -117,23 +117,23 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri ( !isrm && uplo === 'upper' && trans === 'no-transpose' ) || ( isrm && uplo === 'lower' && trans !== 'no-transpose' ) ) { - ix1 = ox + ( ( N - 1 ) * sx ); - oa2 = oa + ( ( N - 1 ) * sa1 ) + ( K * sa0 ); + ix1 = ox + ((N-1)*sx); + oa2 = oa + ((N-1)*sa1) + (K*sa0); for ( i1 = N - 1; i1 >= 0; i1-- ) { rex = viewX[ ix1 ]; - imx = viewX[ ix1 + 1 ]; + imx = viewX[ ix1+1 ]; retmp = rex; imtmp = imx; - i0end = min( N - 1, i1 + K ); + i0end = min(N-1, i1+K); ix0 = ix1 + sx; ia = oa2 + doa; for ( i0 = i1 + 1; i0 <= i0end; i0++ ) { rea = viewA[ ia ]; - ima = sign * viewA[ ia + 1 ]; + ima = sign * viewA[ ia+1 ]; rex = viewX[ ix0 ]; - imx = viewX[ ix0 + 1 ]; - retmp -= f32( f32( rea * rex ) - f32( ima * imx ) ); - imtmp -= f32( f32( rea * imx ) + f32( ima * rex ) ); + imx = viewX[ ix0+1 ]; + retmp = f32( retmp - ( f32( rea * rex ) - f32( ima * imx ) ) ); + imtmp = f32( imtmp - ( f32( rea * imx ) + f32( ima * rex ) ) ); ix0 += sx; ia += doa; } @@ -173,8 +173,8 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0 + 1 ]; - retmp -= f32( f32( rea * rex ) - f32( ima * imx ) ); - imtmp -= f32( f32( rea * imx ) + f32( ima * rex ) ); + retmp = f32( retmp - ( f32( rea * rex ) - f32( ima * imx ) ) ); + imtmp = f32( imtmp - ( f32( rea * imx ) + f32( ima * rex ) ) ); ix0 += sx; ia += doa; } @@ -214,8 +214,8 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0 + 1 ]; - retmp -= f32( f32( rea * rex ) - f32( ima * imx ) ); - imtmp -= f32( f32( rea * imx ) + f32( ima * rex ) ); + retmp = f32( retmp - ( f32( rea * rex ) - f32( ima * imx ) ) ); + imtmp = f32( imtmp - ( f32( rea * imx ) + f32( ima * rex ) ) ); ix0 += sx; ia += sa0; } @@ -251,8 +251,8 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri ima = sign * viewA[ ia + 1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0 + 1 ]; - retmp -= f32( f32( rea * rex ) - f32( ima * imx ) ); - imtmp -= f32( f32( rea * imx ) + f32( ima * rex ) ); + retmp = f32( retmp - ( f32( rea * rex ) - f32( ima * imx ) ) ); + imtmp = f32( imtmp - ( f32( rea * imx ) + f32( ima * rex ) ) ); ix0 -= sx; ia -= sa0; } From 6bbaff7738fa856f870f1aacb7b2b663b3a01676 Mon Sep 17 00:00:00 2001 From: Divit Date: Tue, 28 Apr 2026 17:26:38 +0000 Subject: [PATCH 29/29] chore: update spaces to highlight salent operations --- 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/ctbsv/lib/base.js | 118 +++++++++--------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js index 1b499b689aa9..25645d5ca96e 100644 --- a/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ctbsv/lib/base.js @@ -132,22 +132,22 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri ima = sign * viewA[ ia+1 ]; rex = viewX[ ix0 ]; imx = viewX[ ix0+1 ]; - retmp = f32( retmp - ( f32( rea * rex ) - f32( ima * imx ) ) ); - imtmp = f32( imtmp - ( f32( rea * imx ) + f32( ima * rex ) ) ); + retmp = f32(retmp - f32(f32(rea*rex) - f32(ima*imx))); + imtmp = f32(imtmp - f32(f32(rea*imx) + f32(ima*rex))); ix0 += sx; ia += doa; } if ( nonunit ) { rea = viewA[ oa2 ]; - ima = sign * viewA[ oa2 + 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 ); + ima = sign * viewA[ oa2+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; } @@ -160,35 +160,35 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri ix1 = ox; oa2 = oa; for ( i1 = 0; i1 < N; i1++ ) { - ix1 = ox + ( i1 * sx ); + ix1 = ox + (i1*sx); rex = viewX[ ix1 ]; - imx = viewX[ ix1 + 1 ]; + imx = viewX[ ix1+1 ]; retmp = rex; imtmp = imx; - i0start = max( 0, i1 - K ); - ix0 = ox + ( i0start * sx ); - ia = oa2 + ( ( i0start - i1 ) * doa ); + i0start = max(0, i1-K); + ix0 = ox + (i0start*sx); + ia = oa2 + ((i0start-i1)*doa); for ( i0 = i0start; 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( rea * rex ) - f32( ima * imx ) ) ); - imtmp = f32( imtmp - ( f32( rea * imx ) + f32( ima * rex ) ) ); + imx = viewX[ ix0+1 ]; + retmp = f32(retmp - f32(f32(rea*rex) - f32(ima*imx))); + imtmp = f32(imtmp - f32(f32(rea*imx) + f32(ima*rex))); ix0 += sx; ia += doa; } if ( nonunit ) { rea = viewA[ oa2 ]; - ima = sign * viewA[ oa2 + 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 ); + ima = sign * viewA[ oa2+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; } @@ -199,74 +199,74 @@ function ctbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri ( isrm && uplo === 'lower' && trans === 'no-transpose' ) ) { ix1 = ox; - oa2 = oa + ( K * sa0 ); + oa2 = oa + (K*sa0); for ( i1 = 0; i1 < N; i1++ ) { - ix1 = ox + ( i1 * sx ); + ix1 = ox + (i1*sx); rex = viewX[ ix1 ]; - imx = viewX[ ix1 + 1 ]; + imx = viewX[ ix1+1 ]; retmp = rex; imtmp = imx; - i0start = max( 0, i1 - K ); - ix0 = ox + ( i0start * sx ); + i0start = max(0, i1-K); + ix0 = ox + (i0start*sx); ia = oa2 + ( ( i0start - i1 ) * sa0 ); - for ( i0 = i0start = max( 0, i1 - K ); i0 < i1; i0++ ) { + for ( i0 = i0start; 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( rea * rex ) - f32( ima * imx ) ) ); - imtmp = f32( imtmp - ( f32( rea * imx ) + f32( ima * rex ) ) ); + imx = viewX[ ix0+1 ]; + retmp = f32(retmp - f32(f32(rea*rex) - f32(ima*imx))); + imtmp = f32(imtmp - f32(f32(rea*imx) + f32(ima*rex))); ix0 += sx; ia += sa0; } if ( nonunit ) { rea = viewA[ oa2 ]; - ima = sign * viewA[ oa2 + 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 ); + ima = sign * viewA[ oa2+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 ); - oa2 = oa + ( (N - 1) * sa1 ); + ix1 = ox + ((N-1)*sx); + oa2 = oa + ((N-1)*sa1); for ( i1 = N - 1; i1 >= 0; i1-- ) { rex = viewX[ ix1 ]; - imx = viewX[ ix1 + 1 ]; + imx = viewX[ ix1+1 ]; retmp = rex; imtmp = imx; - i0start = min( N - 1, i1 + K ); - ix0 = ox + ( i0start * sx ); - ia = oa2 + ( ( i0start - i1 ) * sa0 ); + i0start = min(N-1, i1+K); + ix0 = ox + (i0start*sx); + ia = oa2 + ((i0start-i1)*sa0); for ( i0 = i0start; 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( rea * rex ) - f32( ima * imx ) ) ); - imtmp = f32( imtmp - ( f32( rea * imx ) + f32( ima * rex ) ) ); + imx = viewX[ ix0+1 ]; + retmp = f32(retmp - f32(f32(rea*rex) - f32(ima*imx))); + imtmp = f32(imtmp - f32(f32(rea*imx) + f32(ima*rex))); ix0 -= sx; ia -= sa0; } if ( nonunit ) { rea = viewA[ oa2 ]; - ima = sign * viewA[ oa2 + 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 ); + ima = sign * viewA[ oa2+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; }