From 2a707f4f52b79c6f8d3148033036f14ca1cae820 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 18 Apr 2025 16:41:29 +0530 Subject: [PATCH 1/7] feat: add blas/base/dtbsv --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/dtbsv/README.md | 261 +++++ .../blas/base/dtbsv/benchmark/benchmark.js | 105 ++ .../base/dtbsv/benchmark/benchmark.ndarray.js | 105 ++ .../@stdlib/blas/base/dtbsv/docs/repl.txt | 127 +++ .../blas/base/dtbsv/docs/types/index.d.ts | 122 +++ .../blas/base/dtbsv/docs/types/test.ts | 406 ++++++++ .../@stdlib/blas/base/dtbsv/examples/index.js | 38 + .../@stdlib/blas/base/dtbsv/lib/base.js | 174 ++++ .../@stdlib/blas/base/dtbsv/lib/dtbsv.js | 113 +++ .../@stdlib/blas/base/dtbsv/lib/index.js | 70 ++ .../@stdlib/blas/base/dtbsv/lib/main.js | 35 + .../@stdlib/blas/base/dtbsv/lib/ndarray.js | 93 ++ .../@stdlib/blas/base/dtbsv/package.json | 68 ++ .../column_major_complex_access_pattern.json | 22 + .../test/fixtures/column_major_l_nt_nu.json | 22 + .../test/fixtures/column_major_l_nt_u.json | 22 + .../test/fixtures/column_major_l_t_nu.json | 22 + .../test/fixtures/column_major_l_t_u.json | 22 + .../dtbsv/test/fixtures/column_major_oa.json | 22 + .../test/fixtures/column_major_sa1_sa2.json | 22 + .../test/fixtures/column_major_sa1_sa2n.json | 22 + .../test/fixtures/column_major_sa1n_sa2.json | 22 + .../test/fixtures/column_major_sa1n_sa2n.json | 22 + .../test/fixtures/column_major_u_nt_nu.json | 22 + .../test/fixtures/column_major_u_nt_u.json | 22 + .../test/fixtures/column_major_u_t_nu.json | 22 + .../test/fixtures/column_major_u_t_u.json | 22 + .../dtbsv/test/fixtures/column_major_xn.json | 22 + .../dtbsv/test/fixtures/column_major_xt.json | 22 + .../row_major_complex_access_pattern.json | 22 + .../test/fixtures/row_major_l_nt_nu.json | 22 + .../dtbsv/test/fixtures/row_major_l_nt_u.json | 22 + .../dtbsv/test/fixtures/row_major_l_t_nu.json | 22 + .../dtbsv/test/fixtures/row_major_l_t_u.json | 22 + .../dtbsv/test/fixtures/row_major_oa.json | 22 + .../test/fixtures/row_major_sa1_sa2.json | 22 + .../test/fixtures/row_major_sa1_sa2n.json | 22 + .../test/fixtures/row_major_sa1n_sa2.json | 22 + .../test/fixtures/row_major_sa1n_sa2n.json | 22 + .../test/fixtures/row_major_u_nt_nu.json | 22 + .../dtbsv/test/fixtures/row_major_u_nt_u.json | 22 + .../dtbsv/test/fixtures/row_major_u_t_nu.json | 22 + .../dtbsv/test/fixtures/row_major_u_t_u.json | 22 + .../dtbsv/test/fixtures/row_major_xn.json | 22 + .../dtbsv/test/fixtures/row_major_xt.json | 22 + .../blas/base/dtbsv/test/test.dtbsv.js | 749 ++++++++++++++ .../@stdlib/blas/base/dtbsv/test/test.js | 82 ++ .../blas/base/dtbsv/test/test.ndarray.js | 959 ++++++++++++++++++ 48 files changed, 4211 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/README.md create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/examples/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/lib/base.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/lib/dtbsv.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/package.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_xn.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_xt.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_xn.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_xt.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/test.dtbsv.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/test.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/README.md b/lib/node_modules/@stdlib/blas/base/dtbsv/README.md new file mode 100644 index 000000000000..7b74cf6191dd --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/README.md @@ -0,0 +1,261 @@ + + +# dtbsv + +> Solve one of the systems of equations `A*x = b` or `A^T*x = b`. + +
+ +## Usage + +```javascript +var dtbsv = require( '@stdlib/blas/base/dtbsv' ); +``` + +#### dtbsv( 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` 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 Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + +dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 3, 1, A, 2, x, 1 ); +// x => [ 8.0, -7.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 matrix stored in linear memory as a [`Float64Array`][mdn-float64array]. +- **lda**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **x**: input vector [`Float64Array`][mdn-float64array]. +- **sx**: `x` stride length. + +The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +var x = new Float64Array( [ 3.0, 2.0, 1.0 ] ); + +dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 3, 1, A, 2, x, -1 ); +// x => [ 3.0, -7.0, 8.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial arrays... +var x0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + +// Create offset views... +var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 3, 1, A, 2, x1, 1 ); +// x1 => [ 8.0, -7.0, 3.0 ] +``` + +#### dtbsv.ndarray( uplo, trans, diag, N, K, A, sa1, sa2, oa, x, sx, ox ) + +Solves one of the systems of equations `A*x = b` or `A^T*x = b`, using alternative indexing semantics and where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular band matrix, with ( `K` + 1 ) diagonals. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + +dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 3, 1, A, 2, 1, 0, x, 1, 0 ); +// x => [ 8.0, -7.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 Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +var x = new Float64Array( [ 3.0, 2.0, 1.0 ] ); + +dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 3, 1, A, 2, 1, 0, x, -1, 2 ); +// x => [ 3.0, -7.0, 8.0 ] +``` + +
+ + + +
+ +## Notes + +- `dtbsv()` corresponds to the [BLAS][blas] level 2 function [`dtbsv`][blas-dtbsv]. +- Neither routine tests for singularity or near-singularity. Such tests must be performed before calling the routines. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var dtbsv = require( '@stdlib/blas/base/dtbsv' ); + +var opts = { + 'dtype': 'float64' +}; + +var N = 3; + +var A = [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0 ]; + +var x = discreteUniform( N, -10, 10, opts ); + +dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', N, 1, A, N, x, 1 ); +console.log( x ); + +dtbsv.ndarray( 'upper', 'no-transpose', 'unit', N, 1, A, N, 1, 0, x, 1, 0 ); +console.log( x ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.js new file mode 100644 index 000000000000..00451f69e02c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.js @@ -0,0 +1,105 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var zeros = require( '@stdlib/array/zeros' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var pkg = require( './../package.json' ).name; +var dtbsv = require( './../lib/dtbsv.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = discreteUniform( N*N, -10.0, 10.0, options ); + var x = zeros( N, options.dtype ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dtbsv( 'row-major', 'upper', 'transpose', 'non-unit', N, 1, A, N, x, 1 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( 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( pkg+':size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..8e2d29ba7768 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.ndarray.js @@ -0,0 +1,105 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var zeros = require( '@stdlib/array/zeros' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var pkg = require( './../package.json' ).name; +var dtbsv = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = discreteUniform( N*N, -10.0, 10.0, options ); + var x = zeros( N, options.dtype ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dtbsv( 'upper', 'transpose', 'non-unit', N, 1, A, N, 1, 0, x, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( 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( pkg+':ndarray:size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtbsv/docs/repl.txt new file mode 100644 index 000000000000..d24bc35e47ae --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/docs/repl.txt @@ -0,0 +1,127 @@ + +{{alias}}( ord, uplo, trans, diag, N, K, A, lda, x, sx ) + Solves one of the systems of equations `A*x = b` or `A^T*x = b` where `b` + and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, + upper or lower triangular 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 + ---------- + ord: 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 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: Float64Array + Input matrix. + + lda: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + x: Float64Array + Input vector. + + sx: integer + Index increment for `x`. + + Returns + ------- + x: Float64Array + Input vector. + + Examples + -------- + > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 3.0 ] ); + > var A = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + > var order = 'row-major'; + > var uplo = 'upper'; + > var trans = 'no-transpose'; + > {{alias}}( order, uplo, trans, 'unit', 3, 1, A, 2, x, 1 ) + [ 8.0, -7.0, 3.0 ] + + +{{alias}}.ndarray( uplo, trans, diag, N, K, A, sa1, sa2, oa, x, sx, ox ) + Solves one of the systems of equations `A*x = b` or `A^T*x = b`, using + alternative indexing semantics and where `b` and `x` are `N` element + vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower + triangular 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 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: Float64Array + Input matrix. + + sa1: integer + Stride of the first dimension of `A`. + + sa2: integer + Stride of the second dimension of `A`. + + oa: integer + Starting index for `A`. + + x: Float64Array + Input vector. + + sx: integer + Index increment for `x`. + + ox: integer + Starting index for `x`. + + Returns + ------- + x: Float64Array + Input vector. + + Examples + -------- + > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 3.0 ] ); + > var A = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + > var uplo = 'upper'; + > var trans = 'no-transpose'; + > {{alias}}.ndarray( uplo, trans, 'unit', 3, 1, A, 2, 1, 0, x, 1, 0 ) + [ 8.0, -7.0, 3.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/index.d.ts new file mode 100644 index 000000000000..c98bd38c93c0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/index.d.ts @@ -0,0 +1,122 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Layout, MatrixTriangle, TransposeOperation, DiagonalType } from '@stdlib/types/blas'; + +/** +* Interface describing `dtbsv`. +*/ +interface Routine { + /** + * Solves one of the systems of equations `A*x = b` or `A^T*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular 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 - `x` stride length + * @returns `x` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); // => [ [ 1.0, 4.0, 0.0 ], [ 0.0, 2.0, 5.0 ], [ 0.0, 0.0, 3.0 ] ] + * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + * + * dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 2, x, 1 ); + * // x => [ 8.0, -7.0, 3.0 ] + */ + ( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, K: number, A: Float64Array, LDA: number, x: Float64Array, strideX: number ): Float64Array; + + /** + * Solves one of the systems of equations `A*x = b` or `A^T*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular 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 first dimension of `A` + * @param offsetA - starting index for `A` + * @param x - input vector + * @param strideX - `x` stride length + * @param offsetX - starting index for `x` + * @returns `x` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + * + * dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 3, 1, A, 2, 1, 0, x, 1, 0 ); // => [ [ 1.0, 4.0, 0.0 ], [ 0.0, 2.0, 5.0 ], [ 0.0, 0.0, 3.0 ] ] + * // x => [ 8.0, -7.0, 3.0 ] + */ + ndarray( uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, K: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number, x: Float64Array, strideX: number, offsetX: number ): Float64Array; +} + +/** +* Solves one of the systems of equations `A*x = b` or `A^T*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular 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 - `x` stride length +* @returns `x` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* var x = new Float64Array( [ 1.0, 4.0, 10.0 ] ); +* +* dtbsv( 'row-major', 'lower', 'no-transpose', 'unit', 3, A, 1, x, 1 ); +* // x => [ 8.0, -7.0, 3.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* var x = new Float64Array( [ 1.0, 4.0, 10.0 ] ); +* +* dtbsv.ndarray( 'lower', 'no-transpose', 'unit', 3, A, 2, 1, 0, x, 1, 0 ); +* // x => [ 8.0, -7.0, 3.0 ] +*/ +declare var dtbsv: Routine; + + +// EXPORTS // + +export = dtbsv; diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/test.ts new file mode 100644 index 000000000000..50b4cdcc1c66 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/test.ts @@ -0,0 +1,406 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import dtbsv = require( './index' ); + + +// TESTS // + +// The function returns a Float64Array... +{ + const x = new Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv( 10, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( true, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( false, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( null, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( undefined, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( [], 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( {}, 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( ( 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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv( 'row-major', 10, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', true, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', false, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', null, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', undefined, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', [], 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', {}, 'no-transpose', 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( '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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv( 'row-major', 'upper', 10, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', true, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', false, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', null, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', undefined, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', [], 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', {}, 'unit', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( '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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv( 'row-major', 'upper', 'no-transpose', 10, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', true, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', false, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', null, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', undefined, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', [], 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', {}, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', ( x: number ): number => x, 10, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const x = new Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', '10', 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', true, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', false, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', null, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', undefined, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', [], 10, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', {}, 10, A, 10, x, 1 ); // $ExpectError + dtbsv( '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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, '10', A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, true, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, false, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, null, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, undefined, A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, [], A, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, {}, A, 10, x, 1 ); // $ExpectError + dtbsv( '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 Float64Array... +{ + const x = new Float64Array( 10 ); + + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, 10, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, '10', 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, true, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, false, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, null, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, undefined, 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, [ '1' ], 10, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, {}, 10, x, 1 ); // $ExpectError + dtbsv( '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 a eighth argument which is not a number... +{ + const x = new Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, '10', x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, true, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, false, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, null, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, undefined, x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, [], x, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, {}, x, 1 ); // $ExpectError + dtbsv( '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 an ninth argument which is not a Float64Array... +{ + const A = new Float64Array( 20 ); + + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 10, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, '10', 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, true, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, false, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, null, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, undefined, 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, [ '1' ], 1 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, {}, 1 ); // $ExpectError + dtbsv( '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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, '10' ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, true ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, false ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, null ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, undefined ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, [] ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x, {} ); // $ExpectError + dtbsv( '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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv(); // $ExpectError + dtbsv( 'row-major' ); // $ExpectError + dtbsv( 'row-major', 'upper' ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose' ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit' ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10 ); // $ExpectError + dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, A, 10, x ); // $ExpectError + dtbsv( '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 Float64Array... +{ + const x = new Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv.ndarray( 10, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( true, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( false, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( null, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( undefined, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( [], 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( {}, 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv.ndarray( 'upper', 10, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', true, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', false, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', null, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', undefined, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', [], 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', {}, 'unit', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv.ndarray( 'upper', 'no-transpose', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', true, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', false, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', null, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', undefined, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', [], 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', {}, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', ( x: number ): number => x, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const x = new Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', '10', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', true, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', false, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', null, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', undefined, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', [], 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', {}, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, '10', A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, true, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, false, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, null, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, undefined, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, [], A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, {}, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.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 Float64Array... +{ + const x = new Float64Array( 10 ); + + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, 10, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, '10', 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, true, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, false, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, null, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, undefined, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, [ '1' ], 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, {}, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, '10', 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, true, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, false, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, null, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, undefined, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, [], 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, {}, 1, 0, x, 1, 0 ); // $ExpectError + dtbsv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, '10', 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, true, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, false, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, null, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, undefined, 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, [], 0, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, {}, 0, x, 1, 0 ); // $ExpectError + dtbsv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, '10', x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, true, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, false, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, null, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, undefined, x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, [], x, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, {}, x, 1, 0 ); // $ExpectError + dtbsv.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 Float64Array... +{ + const A = new Float64Array( 20 ); + + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, 10, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, '10', 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, true, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, false, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, null, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, undefined, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, [ '1' ], 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, {}, 1, 0 ); // $ExpectError + dtbsv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, '10', 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, true, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, false, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, null, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, undefined, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, [], 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, {}, 0 ); // $ExpectError + dtbsv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, '10' ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, true ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, false ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, null ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, undefined ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, [] ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, {} ); // $ExpectError + dtbsv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtbsv.ndarray(); // $ExpectError + dtbsv.ndarray( 'upper' ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose' ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit' ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1 ); // $ExpectError + dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, A, 10, 1, 0, x, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/examples/index.js b/lib/node_modules/@stdlib/blas/base/dtbsv/examples/index.js new file mode 100644 index 000000000000..a0c34495b52c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/examples/index.js @@ -0,0 +1,38 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var dtbsv = require( './../lib' ); + +var opts = { + 'dtype': 'float64' +}; + +var N = 3; + +var A = [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0 ]; + +var x = discreteUniform( N, -10, 10, opts ); + +dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', N, 1, A, N, x, 1 ); +console.log( x ); + +dtbsv.ndarray( 'upper', 'no-transpose', 'unit', N, 1, A, N, 1, 0, x, 1, 0 ); +console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/base.js new file mode 100644 index 000000000000..7165926068bc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/base.js @@ -0,0 +1,174 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +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` 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 {Float64Array} 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 {Float64Array} x - input vector +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @returns {Float64Array} `x` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* +* dtbsv( 'upper', 'no-transpose', 'unit', 3, 1, A, 2, 1, 0, x, 1, 0 ); +* // x => [ 8.0, -7.0, 3.0 ] +*/ +function dtbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len + var nonunit; + var isrm; + var idx; + var tmp; + var sa0; + var sa1; + var ix0; + var ix1; + var i0; + var i1; + var oa; + var ox; + + // 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' ); + + if ( isrm ) { + // For row-major matrices, the last dimension has the fastest changing index... + sa0 = strideA2; // stride for innermost loop + sa1 = strideA1; // stride for outermost loop + } else { // isColMajor + // For column-major matrices, the first dimension has the fastest changing index... + sa0 = strideA1; // stride for innermost loop + sa1 = strideA2; // stride for outermost loop + } + ox = offsetX; + if ( + ( !isrm && trans === 'no-transpose' && uplo === 'upper' ) || + ( isrm && trans !== 'no-transpose' && uplo === 'lower' ) + ) { + ix1 = ox + ( ( N - 1 ) * strideX ); + for ( i1 = N - 1; i1 >= 0; i1-- ) { + if ( x[ ix1 ] !== 0.0 ) { + tmp = x[ ix1 ]; + oa = offsetA + ( sa1 * i1 ); + for ( i0 = i1 + 1; i0 <= min( N - 1, i1 + K ); i0++ ) { + ix0 = ox + ( i0 * strideX ); + idx = oa + ( sa0 * ( K + i0 - i1 ) ); + tmp -= x[ ix0 ] * A[ idx ]; + } + if ( nonunit ) { + tmp /= A[ oa + ( sa0 * K ) ]; + } + x[ ix1 ] = tmp; + } + ix1 -= strideX; + } + return x; + } + if ( + ( !isrm && trans === 'no-transpose' && uplo === 'lower' ) || + ( isrm && trans !== 'no-transpose' && uplo === 'upper' ) + ) { + ix1 = ox; + for ( i1 = 0; i1 < N; i1++ ) { + if ( x[ ix1 ] !== 0.0 ) { + tmp = x[ ix1 ]; + oa = offsetA + ( sa1 * i1 ); + for ( i0 = max( 0, i1-K ); i0 < i1; i0++ ) { + ix0 = ox + ( i0 * strideX ); + idx = offsetA + ( ( i0 * sa1 ) + ( (i1 - i0) * sa0 ) ); + tmp -= A[ idx ] * x[ ix0 ]; + } + if ( nonunit ) { + tmp /= A[ oa ]; + } + x[ ix1 ] = tmp; + } + ix1 += strideX; + } + return x; + } + if ( + ( !isrm && trans !== 'no-transpose' && uplo === 'upper' ) || + ( isrm && trans === 'no-transpose' && uplo === 'lower' ) + ) { + ix1 = ox; + for ( i1 = 0; i1 < N; i1++ ) { + tmp = x[ ix1 ]; + oa = offsetA + ( sa1*i1 ); + for ( i0 = max( 0, i1 - K ); i0 < i1; i0++ ) { + ix0 = offsetX + ( i0 * strideX ); + tmp -= x[ ix0 ] * A[ oa + ( sa0 * (K + i0 - i1 ) ) ]; + } + if ( nonunit ) { + tmp /= A[ oa + ( sa0 * K ) ]; + } + x[ ix1 ] = tmp; + ix1 += strideX; + } + return x; + } + // ( !isrm && trans !== 'no-transpose' && uplo === 'lower' ) || ( isrm && trans === 'no-transpose' && uplo === 'upper' ) + ox += ( N - 1 ) * strideX; + ix1 = ox; + for ( i1 = N-1; i1 >= 0; i1-- ) { + tmp = x[ ix1 ]; + oa = offsetA + (sa1 * i1); + for ( i0 = min( N - 1, i1 + K ); i0 > i1; i0-- ) { + ix0 = ox - ( ( N - 1 - i0 ) * strideX ); + tmp -= x[ ix0 ] * A[ oa + ( sa0 * (i0 - i1) ) ]; + } + if ( nonunit ) { + tmp /= A[ oa ]; + } + x[ ix1 ] = tmp; + ix1 -= strideX; + } + return x; +} + + +// EXPORTS // + +module.exports = dtbsv; diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/dtbsv.js b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/dtbsv.js new file mode 100644 index 000000000000..50ed210f2802 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/dtbsv.js @@ -0,0 +1,113 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'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` 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 {Float64Array} A - input matrix +* @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Float64Array} 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 {Float64Array} `x` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); // => [ [ 1.0, 4.0, 0.0 ], [ 0.0, 2.0, 5.0 ], [ 0.0, 0.0, 3.0 ] ] +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* +* dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 3, 1, A, 2, x, 1 ); +* // x => [ 8.0, -7.0, 3.0 ] +*/ +function dtbsv( 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. Seventh 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 = dtbsv; diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/index.js b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/index.js new file mode 100644 index 000000000000..1a9960e602c4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/index.js @@ -0,0 +1,70 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* BLAS level 2 routine to solve one of the systems of equations `A*x = b` or `A^T*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular band matrix, with ( `K` + 1 ) diagonals. +* +* @module @stdlib/blas/base/dtbsv +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dtbsv = require( '@stdlib/blas/base/dtbsv' ); +* +* var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* +* dtbsv( 'row-major', 'upper', 'no-transpose', 'unit', 3, 1, A, 2, x, 1 ); +* // x => [ 8.0, -7.0, 3.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dtbsv = require( '@stdlib/blas/base/dtbsv' ); +* +* var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* +* dtbsv.ndarray( 'upper', 'no-transpose', 'unit', 3, 1, A, 2, 1, 0, x, 1, 0 ); +* // x => [ 8.0, -7.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 dtbsv; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dtbsv = main; +} else { + dtbsv = tmp; +} + + +// EXPORTS // + +module.exports = dtbsv; + +// exports: { "ndarray": "dtbsv.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/main.js b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/main.js new file mode 100644 index 000000000000..c7a325759cc8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dtbsv = require( './dtbsv.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dtbsv, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dtbsv; diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js new file mode 100644 index 000000000000..cb8be8488219 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js @@ -0,0 +1,93 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'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` 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 {Float64Array} 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 {Float64Array} 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 {Float64Array} `x` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] ); // => [ [ 1.0, 4.0, 0.0 ], [ 0.0, 2.0, 5.0 ], [ 0.0, 0.0, 3.0 ] ] +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* +* dtbsv( 'upper', 'no-transpose', 'unit', 3, 1, A, 2, 1, 0, x, 1, 0 ); +* // x => [ 8.0, -7.0, 3.0 ] +*/ +function dtbsv( 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`.', strideX ) ); + } + 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 = dtbsv; diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/package.json b/lib/node_modules/@stdlib/blas/base/dtbsv/package.json new file mode 100644 index 000000000000..9cdca7bb26ff --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/blas/base/dtbsv", + "version": "0.0.0", + "description": "Solve one of the systems of equations `A*x = b` or `A^T*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", + "dtbsv", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "float32", + "float", + "float32array" + ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 000000000000..20153effc5c6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_complex_access_pattern.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": -2, + "offsetA": 8, + "offsetX": 4, + "LDA": 2, + "strideA1": -3, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 0.0, 999.0, 1.0, 999.0, 999.0, 4.0, 999.0, 2.0, 999.0, 999.0, 5.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 3.0, 0.0, 2.0, 0.0, 1.0 ], + "x_out": [ 3.0, 0.0, -4.0, 0.0, 21.0 ] + } diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_nt_nu.json new file mode 100644 index 000000000000..13a15d77046a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_nt_nu.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "diag": "non-unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 2.0, 3.0, 0.0 ], + [ 0.0, 4.0, 5.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 0.0, 0.6 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_nt_u.json new file mode 100644 index 000000000000..8737a5fc51fd --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_nt_u.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 1.0, 4.0, 2.0, 5.0, 3.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 4.0, 2.0, 0.0 ], + [ 0.0, 5.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, -2.0, 13.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_t_nu.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_t_nu.json new file mode 100644 index 000000000000..f354cb6ad2cb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_t_nu.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "transpose", + "diag": "non-unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 1.0, 4.0, 2.0, 5.0, 3.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 4.0, 2.0, 0.0 ], + [ 0.0, 5.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 7.0, -1.5, 1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_t_u.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_t_u.json new file mode 100644 index 000000000000..856faa8bdeb9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_l_t_u.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "transpose", + "diag": "unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 1.0, 4.0, 2.0, 5.0, 3.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 4.0, 2.0, 0.0 ], + [ 0.0, 5.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 53.0, -13.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_oa.json new file mode 100644 index 000000000000..3e2525d4767e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_oa.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 2, + "offsetX": 0, + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 999.0, 999.0, 0.0, 1.0, 4.0, 2.0, 5.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 53.0, -13.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1_sa2.json new file mode 100644 index 000000000000..ac35880ef889 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1_sa2.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 3, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 0.0, 999.0, 1.0, 999.0, 999.0, 4.0, 999.0, 999.0, 2.0, 999.0, 5.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 11.0, -10.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1_sa2n.json new file mode 100644 index 000000000000..1ee17364a8de --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1_sa2n.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 4, + "offsetX": 0, + "LDA": 2, + "strideA1": 3, + "strideA2": -2, + "N": 3, + "K": 1, + "A": [ 0.0, 999.0, 1.0, 999.0, 999.0, 4.0, 999.0, 999.0, 2.0, 999.0, 5.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 11.0, -10.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1n_sa2.json new file mode 100644 index 000000000000..b43bafd096ff --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1n_sa2.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 8, + "offsetX": 0, + "LDA": 2, + "strideA1": -3, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 0.0, 999.0, 1.0, 999.0, 999.0, 4.0, 999.0, 2.0, 999.0, 999.0, 5.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 21.0, -4.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1n_sa2n.json new file mode 100644 index 000000000000..eaeca7b01888 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_sa1n_sa2n.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 4, + "offsetX": 0, + "LDA": 2, + "strideA1": -3, + "strideA2": -2, + "N": 3, + "K": 1, + "A": [ 0.0, 999.0, 1.0, 999.0, 999.0, 4.0, 999.0, 999.0, 2.0, 999.0, 5.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 11.0, -10.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_nt_nu.json new file mode 100644 index 000000000000..5d77a0daf8a1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_nt_nu.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "diag": "non-unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 0.0, 1.0, 4.0, 2.0, 5.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 7.0, -1.5, 1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_nt_u.json new file mode 100644 index 000000000000..a0cca44c5e09 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_nt_u.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 0.0, 1.0, 4.0, 2.0, 5.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 53.0, -13.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_t_nu.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_t_nu.json new file mode 100644 index 000000000000..846ffeab7a8a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_t_nu.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "transpose", + "diag": "non-unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 0.0, 1.0, 4.0, 2.0, 5.0, 5.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, -1.0, 1.6 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_t_u.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_t_u.json new file mode 100644 index 000000000000..2ffb6d3a27c6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_u_t_u.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 0.0, 1.0, 4.0, 2.0, 5.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, -2.0, 13.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_xn.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_xn.json new file mode 100644 index 000000000000..5dcb48caad51 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_xn.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": -1, + "offsetA": 0, + "offsetX": 2, + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 0.0, 1.0, 4.0, 2.0, 5.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, -3.0, 15.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_xt.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_xt.json new file mode 100644 index 000000000000..6f2980a3d3e1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_xt.json @@ -0,0 +1,22 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 2, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 0.0, 1.0, 4.0, 2.0, 5.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 0.0, 2.0, 0.0, 3.0 ], + "x_out": [ 53.0, 0.0, -13.0, 0.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 000000000000..93722b462380 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_complex_access_pattern.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": -2, + "offsetA": 9, + "offsetX": 4, + "LDA": 2, + "strideA1": -2, + "strideA2": -3, + "N": 3, + "K": 1, + "A": [ 4.0, 5.0, 0.0, 999.0, 999.0, 1.0, 999.0, 2.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 3.0, 0.0, 2.0, 0.0, 1.0 ], + "x_out": [ 3.0, 0.0, 2.0, 0.0, -1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_nt_nu.json new file mode 100644 index 000000000000..2341d727656b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_nt_nu.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "diag": "non-unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "N": 3, + "K": 1, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 2.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 4.0, 2.0, 0.0 ], + [ 0.0, 5.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 0.5, 0.125, 1.1875 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_nt_u.json new file mode 100644 index 000000000000..22ac099287f7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_nt_u.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "N": 3, + "K": 1, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 4.0, 2.0, 0.0 ], + [ 0.0, 5.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, -1.0, 8.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_t_nu.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_t_nu.json new file mode 100644 index 000000000000..bb30bc515286 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_t_nu.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "transpose", + "diag": "non-unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "N": 3, + "K": 1, + "A": [ 0.0, 2.0, 3.0, 5.0, 5.0, 4.0 ], + "A_mat": [ + [ 2.0, 3.0, 0.0 ], + [ 0.0, 5.0, 5.0 ], + [ 0.0, 0.0, 4.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.025, -0.35, 0.75] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_t_u.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_t_u.json new file mode 100644 index 000000000000..73f6ad8827ac --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_l_t_u.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "transpose", + "diag": "unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "N": 3, + "K": 1, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 0.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 4.0, 2.0, 0.0 ], + [ 0.0, 5.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 40.0, -13.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_oa.json new file mode 100644 index 000000000000..e19b1334385b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_oa.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 2, + "offsetX": 0, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "N": 3, + "K": 1, + "A": [ 999.0, 999.0, 0.0, 4.0, 5.0, 1.0, 2.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 5.0, -1.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1_sa2.json new file mode 100644 index 000000000000..61ff8eff1fc7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1_sa2.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 2, + "strideA2": 3, + "N": 3, + "K": 1, + "A": [ 4.0, 999.0, 0.0, 5.0, 1.0, 999.0, 999.0, 2.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 5.0, -4.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1_sa2n.json new file mode 100644 index 000000000000..812d619fa0c0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1_sa2n.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 2, + "strideA2": -3, + "N": 3, + "K": 1, + "A": [ 4.0, 5.0, 0.0, 999.0, 1.0, 999.0, 999.0, 2.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 14.0, -13.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1n_sa2.json new file mode 100644 index 000000000000..132377140531 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1n_sa2.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 5, + "offsetX": 0, + "LDA": 2, + "strideA1": -2, + "strideA2": 3, + "N": 3, + "K": 1, + "A": [ 4.0, 5.0, 0.0, 999.0, 1.0, 999.0, 999.0, 2.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 6, -1, 3 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1n_sa2n.json new file mode 100644 index 000000000000..3d7e6dedc501 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_sa1n_sa2n.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 9, + "offsetX": 0, + "LDA": 2, + "strideA1": -2, + "strideA2": -3, + "N": 3, + "K": 1, + "A": [ 4.0, 5.0, 0.0, 999.0, 999.0, 1.0, 999.0, 2.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ -1.0, 2.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_nt_nu.json new file mode 100644 index 000000000000..14e85941a22d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_nt_nu.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "diag": "non-unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "N": 3, + "K": 1, + "A": [ 2.0, 4.0, 5.0, 1.0, 2.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 0.3, 0.1, 1.5 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_nt_u.json new file mode 100644 index 000000000000..4551b296a653 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_nt_u.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "N": 3, + "K": 1, + "A": [ 0.0, 4.0, 5.0, 1.0, 2.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 5.0, -1.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_t_nu.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_t_nu.json new file mode 100644 index 000000000000..fd5101aa7e3b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_t_nu.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "transpose", + "diag": "non-unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "N": 3, + "K": 1, + "A": [ 2.0, 4.0, 5.0, 1.0, 2.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 0.5, 0.0, 1.5 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_t_u.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_t_u.json new file mode 100644 index 000000000000..32d14c9ad8f6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_u_t_u.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "N": 3, + "K": 1, + "A": [ 0.0, 4.0, 5.0, 1.0, 2.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, -2.0, 5.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_xn.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_xn.json new file mode 100644 index 000000000000..8eaec1da697b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_xn.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": -1, + "offsetA": 0, + "offsetX": 2, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "N": 3, + "K": 1, + "A": [ 0.0, 4.0, 5.0, 1.0, 2.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 1.0, -1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_xt.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_xt.json new file mode 100644 index 000000000000..4c2aa1ece8d5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/row_major_xt.json @@ -0,0 +1,22 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 2, + "offsetA": 0, + "offsetX": 0, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "N": 3, + "K": 1, + "A": [ 0.0, 4.0, 5.0, 1.0, 2.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 1.0, 0.0, 2.0, 0.0, 3.0 ], + "x_out": [ 5.0, 0.0, -1.0, 0.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.dtbsv.js b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.dtbsv.js new file mode 100644 index 000000000000..b34194b994f9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.dtbsv.js @@ -0,0 +1,749 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var dtbsv = require( './../lib/dtbsv.js' ); + + +// FIXTURES // + +var rlntnu = require( './fixtures/row_major_l_nt_nu.json' ); +var rltnu = require( './fixtures/row_major_l_t_nu.json' ); +var rlntu = require( './fixtures/row_major_l_nt_u.json' ); +var rltu = require( './fixtures/row_major_l_t_u.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 rxt = require( './fixtures/row_major_xt.json' ); +var rxn = require( './fixtures/row_major_xn.json' ); + +var clntnu = require( './fixtures/column_major_l_nt_nu.json' ); +var cltnu = require( './fixtures/column_major_l_t_nu.json' ); +var clntu = require( './fixtures/column_major_l_nt_u.json' ); +var cltu = require( './fixtures/column_major_l_t_u.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 cxt = require( './fixtures/column_major_xt.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 dtbsv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 10', function test( t ) { + t.strictEqual( dtbsv.length, 10, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', function test( t ) { + var values; + var data; + var i; + + data = rutu; + + 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() { + dtbsv( value, data.uplo, data.trans, data.diag, data.N, data.K, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var data; + var i; + + data = rutu; + + 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() { + dtbsv( data.order, value, data.trans, data.diag, data.N, data.K, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', function test( t ) { + var values; + var data; + var i; + + data = rutu; + + 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() { + dtbsv( data.order, data.uplo, value, data.diag, data.N, data.K, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourth argument', function test( t ) { + var values; + var data; + var i; + + data = rutu; + + 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() { + dtbsv( data.order, data.uplo, data.trans, value, data.N, data.K, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { + var values; + var data; + var i; + + data = rutu; + + 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() { + dtbsv( data.order, data.uplo, data.trans, data.diag, value, data.K, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid sixth argument', function test( t ) { + var values; + var data; + var i; + + data = rutu; + + 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() { + dtbsv( data.order, data.uplo, data.trans, data.diag, data.N, value, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid eighth argument', function test( t ) { + var values; + var data; + var i; + + data = rutu; + + values = [ + 1, + 0, + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dtbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, new Float64Array( data.A ), value, new Float64Array( data.x ), data.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid tenth argument', function test( t ) { + var values; + var data; + var i; + + data = rutu; + + 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() { + dtbsv( data.order, data.uplo, data.trans, data.diag, data.N, data.K, new Float64Array( data.A ), data.LDA, new Float64Array( data.x ), value ); + }; + } +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rlntnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = clntnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rltnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cltnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rlntu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = clntu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rltu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cltu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = runtnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cuntnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = runtu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cuntu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rutnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cutnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rutu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cutu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rxt; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, '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 = cxt; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + out = dtbsv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x ); + + out = dtbsv( 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.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero, the function returns the input vector unchanged (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cutu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x ); + + out = dtbsv( 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.deepEqual( x, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.js b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.js new file mode 100644 index 000000000000..8fc4fe4366cb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var dtbsv = 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 dtbsv, '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 dtbsv.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 dtbsv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dtbsv, 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 dtbsv; + var main; + + main = require( './../lib/dtbsv.js' ); + + dtbsv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dtbsv, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js new file mode 100644 index 000000000000..7e70e753c749 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js @@ -0,0 +1,959 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var dtrsv = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var rlntnu = require( './fixtures/row_major_l_nt_nu.json' ); +var rltnu = require( './fixtures/row_major_l_t_nu.json' ); +var rlntu = require( './fixtures/row_major_l_nt_u.json' ); +var rltu = require( './fixtures/row_major_l_t_u.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 rxt = require( './fixtures/row_major_xt.json' ); +var rxn = require( './fixtures/row_major_xn.json' ); +var roa = require( './fixtures/row_major_oa.json' ); +var rsa1sa2 = require( './fixtures/row_major_sa1_sa2.json' ); +var rsa1nsa2 = require( './fixtures/row_major_sa1n_sa2.json' ); +var rsa1sa2n = require( './fixtures/row_major_sa1_sa2n.json' ); +var rsa1nsa2n = require( './fixtures/row_major_sa1n_sa2n.json' ); +var rcap = require( './fixtures/row_major_complex_access_pattern.json' ); + +var clntnu = require( './fixtures/column_major_l_nt_nu.json' ); +var cltnu = require( './fixtures/column_major_l_t_nu.json' ); +var clntu = require( './fixtures/column_major_l_nt_u.json' ); +var cltu = require( './fixtures/column_major_l_t_u.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 cxt = require( './fixtures/column_major_xt.json' ); +var cxn = require( './fixtures/column_major_xn.json' ); +var coa = require( './fixtures/column_major_oa.json' ); +var csa1sa2 = require( './fixtures/column_major_sa1_sa2.json' ); +var csa1nsa2 = require( './fixtures/column_major_sa1n_sa2.json' ); +var csa1sa2n = require( './fixtures/column_major_sa1_sa2n.json' ); +var csa1nsa2n = require( './fixtures/column_major_sa1_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 dtrsv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 12', function test( t ) { + t.strictEqual( dtrsv.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; + + data = rutu; + + 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() { + dtrsv( value, data.trans, data.diag, data.N, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.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; + + data = rutu; + + 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() { + dtrsv( data.uplo, value, data.diag, data.N, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.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; + + data = rutu; + + 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() { + dtrsv( data.uplo, data.trans, value, data.N, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.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; + + data = rutu; + + 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() { + dtrsv( data.uplo, data.trans, data.diag, value, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.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; + + data = rutu; + + 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() { + dtrsv( data.uplo, data.trans, data.diag, data.N, value, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.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; + + data = rutu; + + 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() { + dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), value, data.offsetX ); + }; + } +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rlntnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = clntnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rltnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cltnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rlntu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = clntu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, lower, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rltu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, lower, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cltu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = runtnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, no transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cuntnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = runtu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, no transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cuntu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rutnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, transpose, non-unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cutnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (row-major, upper, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rutu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = b` (column-major, upper, transpose, unit)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cutu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rxt; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 = cxt; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + out = dtrsv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x ); + + out = dtrsv( 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.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero, the function returns the input vector unchanged (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cutu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x ); + + out = dtrsv( 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.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1sa2; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrsv( 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.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); From e979705614d671add17ebaadb128f05bcc46abe6 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Fri, 18 Apr 2025 11:19:06 +0000 Subject: [PATCH 2/7] chore: update copyright years --- lib/node_modules/@stdlib/blas/base/dtbsv/README.md | 2 +- lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.js | 2 +- .../@stdlib/blas/base/dtbsv/benchmark/benchmark.ndarray.js | 2 +- lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/index.d.ts | 2 +- lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/test.ts | 2 +- lib/node_modules/@stdlib/blas/base/dtbsv/examples/index.js | 2 +- lib/node_modules/@stdlib/blas/base/dtbsv/lib/base.js | 2 +- lib/node_modules/@stdlib/blas/base/dtbsv/lib/dtbsv.js | 2 +- lib/node_modules/@stdlib/blas/base/dtbsv/lib/index.js | 2 +- lib/node_modules/@stdlib/blas/base/dtbsv/lib/main.js | 2 +- lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js | 2 +- lib/node_modules/@stdlib/blas/base/dtbsv/test/test.dtbsv.js | 2 +- lib/node_modules/@stdlib/blas/base/dtbsv/test/test.js | 2 +- lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/README.md b/lib/node_modules/@stdlib/blas/base/dtbsv/README.md index 7b74cf6191dd..5adea475ef91 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/README.md +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2024 The Stdlib Authors. +Copyright (c) 2025 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.js index 00451f69e02c..fda9c50f32b2 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.ndarray.js index 8e2d29ba7768..acd5ace32c0a 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/benchmark/benchmark.ndarray.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/index.d.ts index c98bd38c93c0..589a16b72aa7 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/index.d.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/test.ts index 50b4cdcc1c66..587222e024be 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/docs/types/test.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/examples/index.js b/lib/node_modules/@stdlib/blas/base/dtbsv/examples/index.js index a0c34495b52c..5cf105323d58 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/examples/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/base.js index 7165926068bc..13573019079b 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/base.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/dtbsv.js b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/dtbsv.js index 50ed210f2802..06565ab0d0ec 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/dtbsv.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/dtbsv.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/index.js b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/index.js index 1a9960e602c4..5fb052496a63 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/main.js b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/main.js index c7a325759cc8..b3db106409c0 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/main.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/main.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js index cb8be8488219..4ea10d8a9920 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.dtbsv.js b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.dtbsv.js index b34194b994f9..614bed396808 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.dtbsv.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.dtbsv.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.js b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.js index 8fc4fe4366cb..f5214319402b 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js index 7e70e753c749..cbfa381f6a6f 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 1944523198bddd4753e1d5730ad3bb5c85c0ab23 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 18 Apr 2025 17:08:29 +0530 Subject: [PATCH 3/7] chore: add test cases --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/dtbsv/lib/ndarray.js | 6 + .../blas/base/dtbsv/test/test.ndarray.js | 134 ++++++++++++------ 2 files changed, 96 insertions(+), 44 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js index 4ea10d8a9920..0364c8ba3c69 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js @@ -78,6 +78,12 @@ function dtbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri if ( K < 0 ) { throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', K ) ); } + if ( strideA1 === 0 ) { + throw new RangeError( format( 'invalid argument. Seventh argument must be non-zero. Value: `%d`.', strideX ) ); + } + if ( strideA2 === 0 ) { + throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideX ) ); + } if ( strideX === 0 ) { throw new RangeError( format( 'invalid argument. Eleventh argument must be non-zero. Value: `%d`.', strideX ) ); } diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js index cbfa381f6a6f..e7883673bb28 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js @@ -24,7 +24,7 @@ var tape = require( 'tape' ); var Float64Array = require( '@stdlib/array/float64' ); -var dtrsv = require( './../lib/ndarray.js' ); +var dtbsv = require( './../lib/ndarray.js' ); // FIXTURES // @@ -68,12 +68,12 @@ var ccap = require( './fixtures/column_major_complex_access_pattern.json' ); tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); - t.strictEqual( typeof dtrsv, 'function', 'main export is a function' ); + t.strictEqual( typeof dtbsv, 'function', 'main export is a function' ); t.end(); }); tape( 'the function has an arity of 12', function test( t ) { - t.strictEqual( dtrsv.length, 12, 'returns expected value' ); + t.strictEqual( dtbsv.length, 12, 'returns expected value' ); t.end(); }); @@ -98,7 +98,7 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - dtrsv( value, data.trans, data.diag, data.N, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); + dtbsv( value, data.trans, data.diag, data.N, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); }; } }); @@ -124,7 +124,7 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - dtrsv( data.uplo, value, data.diag, data.N, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); + dtbsv( data.uplo, value, data.diag, data.N, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); }; } }); @@ -150,7 +150,7 @@ tape( 'the function throws an error if provided an invalid third argument', func function badValue( value ) { return function badValue() { - dtrsv( data.uplo, data.trans, value, data.N, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); + dtbsv( data.uplo, data.trans, value, data.N, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); }; } }); @@ -175,7 +175,7 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun function badValue( value ) { return function badValue() { - dtrsv( data.uplo, data.trans, data.diag, value, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); + dtbsv( data.uplo, data.trans, data.diag, value, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); }; } }); @@ -200,7 +200,53 @@ tape( 'the function throws an error if provided an invalid fifth argument', func function badValue( value ) { return function badValue() { - dtrsv( data.uplo, data.trans, data.diag, data.N, value, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); + dtbsv( data.uplo, data.trans, data.diag, data.N, value, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid seventh argument', function test( t ) { + var values; + var data; + var i; + + data = rutu; + + 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() { + dtbsv( data.uplo, data.trans, data.diag, data.N, data.K, new Float64Array( data.A ), value, data.strideA2, data.offsetA, new Float64Array( data.x ), value, data.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid eighth argument', function test( t ) { + var values; + var data; + var i; + + data = rutu; + + 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() { + dtbsv( data.uplo, data.trans, data.diag, data.N, data.K, new Float64Array( data.A ), data.strideA1, value, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); }; } }); @@ -223,7 +269,7 @@ tape( 'the function throws an error if provided an invalid eleventh argument', f function badValue( value ) { return function badValue() { - dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), value, data.offsetX ); + dtbsv( data.uplo, data.trans, data.diag, data.N, data.K, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), value, data.offsetX ); }; } }); @@ -242,7 +288,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -263,7 +309,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -284,7 +330,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -305,7 +351,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -326,7 +372,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -347,7 +393,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -368,7 +414,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -389,7 +435,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -410,7 +456,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -431,7 +477,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -452,7 +498,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -473,7 +519,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -494,7 +540,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -515,7 +561,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -536,7 +582,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -557,7 +603,7 @@ tape( 'the function solves one of the systems of equations `A*x = b` or `A^T*x = expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -578,7 +624,7 @@ tape( 'the function supports specifying an `x` stride (row-major)', function tes expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -599,7 +645,7 @@ tape( 'the function supports specifying an `x` stride (column-major)', function expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -617,7 +663,7 @@ tape( 'the function returns a reference to the input vector', function test( t ) a = new Float64Array( data.A ); x = new Float64Array( data.x ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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(); @@ -637,7 +683,7 @@ tape( 'if `N` is zero, the function returns the input vector unchanged (row-majo expected = new Float64Array( data.x ); - out = dtrsv( data.uplo, data.trans, data.diag, 0, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( x, expected, 'returns expected value' ); @@ -658,7 +704,7 @@ tape( 'if `N` is zero, the function returns the input vector unchanged (column-m expected = new Float64Array( data.x ); - out = dtrsv( data.uplo, data.trans, data.diag, 0, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( x, expected, 'returns expected value' ); @@ -679,7 +725,7 @@ tape( 'the function supports specifying the strides of the first and second dime expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -700,7 +746,7 @@ tape( 'the function supports specifying the strides of the first and second dime expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -721,7 +767,7 @@ tape( 'the function supports a negative stride for the first dimension of `A` (r expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -742,7 +788,7 @@ tape( 'the function supports a negative stride for the first dimension of `A` (c expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -763,7 +809,7 @@ tape( 'the function supports a negative stride for the second dimension of `A` ( expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -784,7 +830,7 @@ tape( 'the function supports a negative stride for the second dimension of `A` ( expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -805,7 +851,7 @@ tape( 'the function supports negative strides for `A` (row-major)', function tes expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -826,7 +872,7 @@ tape( 'the function supports negative strides for `A` (column-major)', function expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -847,7 +893,7 @@ tape( 'the function supports an `A` offset (row-major)', function test( t ) { expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -868,7 +914,7 @@ tape( 'the function supports an `A` offset (column-major)', function test( t ) { expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -888,7 +934,7 @@ tape( 'the function supports a negative `x` stride (row-major)', function test( expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -909,7 +955,7 @@ tape( 'the function supports a negative `x` stride (column-major)', function tes expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -930,7 +976,7 @@ tape( 'the function supports complex access patterns (row-major)', function test expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); @@ -951,7 +997,7 @@ tape( 'the function supports complex access patterns (column-major)', function t expected = new Float64Array( data.x_out ); - out = dtrsv( data.uplo, data.trans, data.diag, data.N, data.K, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtbsv( 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.deepEqual( out, expected, 'returns expected value' ); From 3c6049632e71555f736944349023c073ce228653 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 18 Apr 2025 17:22:04 +0530 Subject: [PATCH 4/7] chore: update test cases --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js | 4 ++-- lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js index 0364c8ba3c69..4fa72cead74b 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js @@ -82,10 +82,10 @@ function dtbsv( uplo, trans, diag, N, K, A, strideA1, strideA2, offsetA, x, stri throw new RangeError( format( 'invalid argument. Seventh argument must be non-zero. Value: `%d`.', strideX ) ); } if ( strideA2 === 0 ) { - throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideX ) ); + throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideA1 ) ); } if ( strideX === 0 ) { - throw new RangeError( format( 'invalid argument. Eleventh argument must be non-zero. Value: `%d`.', strideX ) ); + throw new RangeError( format( 'invalid argument. Eleventh argument must be non-zero. Value: `%d`.', strideA2 ) ); } if ( N === 0 ) { return x; diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js index e7883673bb28..c49af540962b 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/test.ndarray.js @@ -223,7 +223,7 @@ tape( 'the function throws an error if provided an invalid seventh argument', fu function badValue( value ) { return function badValue() { - dtbsv( data.uplo, data.trans, data.diag, data.N, data.K, new Float64Array( data.A ), value, data.strideA2, data.offsetA, new Float64Array( data.x ), value, data.offsetX ); + dtbsv( data.uplo, data.trans, data.diag, data.N, data.K, new Float64Array( data.A ), value, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); }; } }); From 179fa9a1eb02c7e6565e9539b0ba49541b23af6a Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Fri, 18 Apr 2025 22:46:31 +0530 Subject: [PATCH 5/7] chore: update package.json Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dtbsv/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/package.json b/lib/node_modules/@stdlib/blas/base/dtbsv/package.json index 9cdca7bb26ff..94f7533d297c 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/package.json +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/package.json @@ -61,8 +61,8 @@ "subroutines", "array", "ndarray", - "float32", + "float64", "float", - "float32array" + "float64array" ] } From 372ea658a35c362c452211fa784258fc4a152f18 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Fri, 18 Apr 2025 23:41:11 +0530 Subject: [PATCH 6/7] chore: fix indentation Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../column_major_complex_access_pattern.json | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_complex_access_pattern.json index 20153effc5c6..1738138e965f 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_complex_access_pattern.json +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/test/fixtures/column_major_complex_access_pattern.json @@ -1,22 +1,22 @@ { - "order": "column-major", - "trans": "no-transpose", - "diag": "unit", - "uplo": "upper", - "strideX": -2, - "offsetA": 8, - "offsetX": 4, - "LDA": 2, - "strideA1": -3, - "strideA2": 2, - "N": 3, - "K": 1, - "A": [ 0.0, 999.0, 1.0, 999.0, 999.0, 4.0, 999.0, 2.0, 999.0, 999.0, 5.0, 3.0 ], - "A_mat": [ - [ 1.0, 4.0, 0.0 ], - [ 0.0, 2.0, 5.0 ], - [ 0.0, 0.0, 3.0 ] - ], - "x": [ 3.0, 0.0, 2.0, 0.0, 1.0 ], - "x_out": [ 3.0, 0.0, -4.0, 0.0, 21.0 ] - } + "order": "column-major", + "trans": "no-transpose", + "diag": "unit", + "uplo": "upper", + "strideX": -2, + "offsetA": 8, + "offsetX": 4, + "LDA": 2, + "strideA1": -3, + "strideA2": 2, + "N": 3, + "K": 1, + "A": [ 0.0, 999.0, 1.0, 999.0, 999.0, 4.0, 999.0, 2.0, 999.0, 999.0, 5.0, 3.0 ], + "A_mat": [ + [ 1.0, 4.0, 0.0 ], + [ 0.0, 2.0, 5.0 ], + [ 0.0, 0.0, 3.0 ] + ], + "x": [ 3.0, 0.0, 2.0, 0.0, 1.0 ], + "x_out": [ 3.0, 0.0, -4.0, 0.0, 21.0 ] +} From 51e2703e58fb36e137c63320ba3ca6e60c31e0b2 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 20 Apr 2025 12:30:46 +0530 Subject: [PATCH 7/7] chore: add jsdoc --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js index 4fa72cead74b..1f412179abad 100644 --- a/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtbsv/lib/ndarray.js @@ -50,6 +50,8 @@ var base = require( './base.js' ); * @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} seventh argument must be non-zero +* @throws {RangeError} eighth argument must be non-zero * @throws {RangeError} eleventh argument must be non-zero * @returns {Float64Array} `x` *