From 508be12367e30e86332a59f7d6417182a5833f83 Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Thu, 27 Feb 2025 14:37:46 +0000 Subject: [PATCH 01/22] feat: add initial implementation for lapack/zlaswp --- 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/lapack/base/zlaswp/lib/base.js | 158 ++++++++++++++++++ .../@stdlib/lapack/base/zlaswp/lib/index.js | 59 +++++++ .../@stdlib/lapack/base/zlaswp/lib/main.js | 35 ++++ .../@stdlib/lapack/base/zlaswp/lib/ndarray.js | 73 ++++++++ .../@stdlib/lapack/base/zlaswp/lib/zlaswp.js | 93 +++++++++++ 5 files changed, 418 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/lib/base.js create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/lib/index.js create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/lib/main.js create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/lib/ndarray.js create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/lib/zlaswp.js diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/base.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/base.js new file mode 100644 index 000000000000..d3ae1ddc963c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/base.js @@ -0,0 +1,158 @@ +/** +* @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 reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var zswap = require( '@stdlib/blas/base/zswap' ).ndarray; + + +// VARIABLES // + +var BLOCK_SIZE = 32; + + +// MAIN // + +/** +* Performs a series of row interchanges on a matrix `A` using pivot indices stored in `IPIV`. +* +* @private +* @param {PositiveInteger} N - number of columns in `A` +* @param {Complex128Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - index offset for `A` +* @param {NonNegativeInteger} k1 - index of first row to interchange +* @param {NonNegativeInteger} k2 - index of last row to interchange +* @param {integer} inck - direction in which to apply pivots (-1 to apply pivots in reverse order; otherwise, apply in provided order) +* @param {Int32Array} IPIV - vector of pivot indices +* @param {integer} strideIPIV - `IPIV` stride length +* @param {NonNegativeInteger} offsetIPIV - index offset for `IPIV` +* @returns {Complex128Array} permuted matrix `A` +* +* @example +* var Int32Array = require( '@stdlib/array/int32' ); +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var IPIV = new Int32Array( [ 1, 0 ] ); +* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ) +* +* zlaswp( 2, A, 2, 1, 0, 0, 0, 1, IPIV, 1, 0 ); +* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] +*/ +function zlaswp( N, A, strideA1, strideA2, offsetA, k1, k2, inck, IPIV, strideIPIV, offsetIPIV ) { // eslint-disable-line max-len, max-params + var nrows; + var viewA; + var n32; + var tmp; + var row; + var ia1; + var ia2; + var ip; + var i; + var j; + var k; + var n; + var o; + + // Compute the number of rows to be interchanged: + if ( inck > 0 ) { + nrows = k2 - k1; + } else { + nrows = k1 - k2; + } + nrows += 1; + + // If the order is row-major, we can delegate to the Level 1 routine `zswap` for interchanging rows... + if ( isRowMajor( [ strideA1, strideA2 ] ) ) { + ip = offsetIPIV; + for ( i = 0, k = k1; i < nrows; i++, k += inck ) { + row = IPIV[ ip ]; + if ( row !== k ) { + zswap( N, A, strideA2, offsetA+(k*strideA1), A, strideA2, offsetA+(row*strideA1) ); // eslint-disable-line max-len + } + ip += strideIPIV; + } + return A; + } + viewA = reinterpret( A, 0 ); + + strideA1 *= 2; + strideA2 *= 2; + offsetA *= 2; + + // If the order is column-major, we need to use loop tiling to ensure efficient cache access when accessing matrix elements... + n32 = floor( N/BLOCK_SIZE ) * BLOCK_SIZE; + if ( n32 !== 0 ) { + for ( j = 0; j < n32; j += BLOCK_SIZE ) { + ip = offsetIPIV; + for ( i = 0, k = k1; i < nrows; i++, k += inck ) { + row = IPIV[ ip ]; + if ( row !== k ) { + ia1 = offsetA + ( k*strideA1 ); + ia2 = offsetA + ( row*strideA1 ); + for ( n = j; n < j+BLOCK_SIZE; n++ ) { + o = n * strideA2; + + tmp = viewA[ ia1+o ]; + viewA[ ia1+o ] = viewA[ ia2+o ]; + viewA[ ia2+o ] = tmp; + + tmp = viewA[ ia1+o+1 ]; + viewA[ ia1+o+1 ] = viewA[ ia2+o+1 ]; + viewA[ ia2+o+1 ] = tmp; + } + } + ip += strideIPIV; + } + } + } + if ( n32 !== N ) { + ip = offsetIPIV; + for ( i = 0, k = k1; i < nrows; i++, k += inck ) { + row = IPIV[ ip ]; + if ( row !== k ) { + ia1 = offsetA + ( k*strideA1 ); + ia2 = offsetA + ( row*strideA1 ); + for ( n = n32; n < N; n++ ) { + o = n * strideA2; + + tmp = viewA[ ia1+o ]; + viewA[ ia1+o ] = viewA[ ia2+o ]; + viewA[ ia2+o ] = tmp; + + tmp = viewA[ ia1+o+1 ]; + viewA[ ia1+o+1 ] = viewA[ ia2+o+1 ]; + viewA[ ia2+o+1 ] = tmp; + } + } + ip += strideIPIV; + } + } + return A; +} + + +// EXPORTS // + +module.exports = zlaswp; diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/index.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/index.js new file mode 100644 index 000000000000..f276bcba0b8a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/index.js @@ -0,0 +1,59 @@ +/** +* @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'; + +/** +* LAPACK routine to perform a series of row interchanges on an input matrix. +* +* @module @stdlib/lapack/base/zlaswp +* +* @example +* var Int32Array = require( '@stdlib/array/int32' ); +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var zlaswp = require( '@stdlib/lapack/base/zlaswp' ); +* +* var IPIV = new Int32Array( [ 1, 0 ] ); +* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ) +* +* zlaswp( 2, A, 2, 1, 0, 0, 0, 1, IPIV, 1, 0 ); +* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.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 zlaswp; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + zlaswp = main; +} else { + zlaswp = tmp; +} + + +// EXPORTS // + +module.exports = zlaswp; diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/main.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/main.js new file mode 100644 index 000000000000..4cda9a429ce0 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/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 zlaswp = require( './zlaswp.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( zlaswp, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = zlaswp; diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/ndarray.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/ndarray.js new file mode 100644 index 000000000000..30d6c3d7466f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/ndarray.js @@ -0,0 +1,73 @@ +/** +* @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 base = require( './base.js' ); + + +// MAIN // + +/** +* Performs a series of row interchanges on a matrix `A` using pivot indices stored in `IPIV`. +* +* @param {PositiveInteger} N - number of columns in `A` +* @param {Complex128Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - index offset for `A` +* @param {NonNegativeInteger} k1 - index of first row to interchange +* @param {NonNegativeInteger} k2 - index of last row to interchange +* @param {integer} inck - direction in which to apply pivots (-1 to apply pivots in reverse order; otherwise, apply in provided order) +* @param {Int32Array} IPIV - vector of pivot indices +* @param {integer} strideIPIV - `IPIV` stride length +* @param {NonNegativeInteger} offsetIPIV - index offset for `IPIV` +* @returns {Complex128Array} permuted matrix `A` +* +* @example +* var Int32Array = require( '@stdlib/array/int32' ); +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var IPIV = new Int32Array( [ 1, 0 ] ); +* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ) +* +* zlaswp( 2, A, 2, 1, 0, 0, 0, 1, IPIV, 1, 0 ); +* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] +*/ +function zlaswp( N, A, strideA1, strideA2, offsetA, k1, k2, inck, IPIV, strideIPIV, offsetIPIV ) { // eslint-disable-line max-len, max-params + var tmp; + if ( inck < 0 ) { + offsetIPIV += k2 * strideIPIV; + strideIPIV *= -1; + tmp = k1; + k1 = k2; + k2 = tmp; + inck = -1; + } else { + offsetIPIV += k1 * strideIPIV; + inck = 1; + } + return base( N, A, strideA1, strideA2, offsetA, k1, k2, inck, IPIV, strideIPIV, offsetIPIV ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = zlaswp; diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/zlaswp.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/zlaswp.js new file mode 100644 index 000000000000..02f18f9f286a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/zlaswp.js @@ -0,0 +1,93 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var max = require( '@stdlib/math/base/special/max' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Performs a series of row interchanges on a matrix `A` using pivot indices stored in `IPIV`. +* +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of columns in `A` +* @param {Complex128Array} A - input matrix +* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {NonNegativeInteger} k1 - index of first row to interchange +* @param {NonNegativeInteger} k2 - index of last row to interchange +* @param {Int32Array} IPIV - vector of pivot indices +* @param {integer} incx - increment between successive values of `IPIV` +* @throws {TypeError} first argument must be a valid order +* @throws {RangeError} fourth argument must be greater than or equal to max(1,N) +* @returns {Complex128Array} permuted matrix `A` +* +* @example +* var Int32Array = require( '@stdlib/array/int32' ); +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var IPIV = new Int32Array( [ 1, 0 ] ); +* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +* +* zlaswp( 'row-major', 2, A, 2, 0, 0, IPIV, 1 ); +* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] +*/ +function zlaswp( order, N, A, LDA, k1, k2, IPIV, incx ) { + var tmp; + var inc; + var sa1; + var sa2; + var io; + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( order === 'row-major' && LDA < max( 1, N ) ) { + throw new RangeError( format( 'invalid argument. Fourth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); + } + if ( incx > 0 ) { + inc = 1; + io = k1; + } else if ( incx < 0 ) { + inc = -1; + io = k1 + ( (k1-k2) * incx ); + tmp = k1; + k1 = k2; + k2 = tmp; + } else { + return A; + } + if ( order === 'column-major' ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + } + return base( N, A, sa1, sa2, 0, k1, k2, inc, IPIV, incx, io ); +} + + +// EXPORTS // + +module.exports = zlaswp; From d5692827ed5e41446f932d0969f73c856009c28e Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Thu, 27 Feb 2025 14:40:53 +0000 Subject: [PATCH 02/22] chore: update copyright years --- lib/node_modules/@stdlib/lapack/base/zlaswp/lib/base.js | 2 +- lib/node_modules/@stdlib/lapack/base/zlaswp/lib/index.js | 2 +- lib/node_modules/@stdlib/lapack/base/zlaswp/lib/main.js | 2 +- lib/node_modules/@stdlib/lapack/base/zlaswp/lib/ndarray.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/base.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/base.js index d3ae1ddc963c..5010442b9862 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/base.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/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/lapack/base/zlaswp/lib/index.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/index.js index f276bcba0b8a..1451e6596ade 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/index.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/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/lapack/base/zlaswp/lib/main.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/main.js index 4cda9a429ce0..39222d8e5445 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/main.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/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/lapack/base/zlaswp/lib/ndarray.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/ndarray.js index 30d6c3d7466f..fb7c15aaab13 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/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. From d654fa2a176ea7c6240fdee931ac38db3bd372cf Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Fri, 28 Feb 2025 06:03:46 +0000 Subject: [PATCH 03/22] test: add tests for zlaswp --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed --- --- .../test/fixtures/column_major_a_offset.json | 26 + .../test/fixtures/column_major_a_strides.json | 124 ++++ .../column_major_complex_access_patterns.json | 128 ++++ .../fixtures/column_major_ipiv_offset.json | 26 + .../column_major_ipiv_stride_negative.json | 26 + .../column_major_ipiv_stride_positive.json | 26 + .../zlaswp/test/fixtures/column_major_k1.json | 26 + .../test/fixtures/column_major_lda.json | 116 ++++ .../fixtures/column_major_no_offsets.json | 26 + .../fixtures/column_major_reverse_pivots.json | 26 + ...lumn_major_reverse_pivots_ipiv_offset.json | 26 + ...lumn_major_reverse_pivots_ipiv_stride.json | 26 + .../test/fixtures/row_major_a_offset.json | 26 + .../test/fixtures/row_major_a_strides.json | 100 +++ .../row_major_complex_access_patterns.json | 96 +++ .../test/fixtures/row_major_ipiv_offset.json | 26 + .../row_major_ipiv_stride_negative.json | 26 + .../row_major_ipiv_stride_positive.json | 26 + .../zlaswp/test/fixtures/row_major_k1.json | 26 + .../zlaswp/test/fixtures/row_major_lda.json | 76 +++ .../test/fixtures/row_major_no_offsets.json | 26 + .../fixtures/row_major_reverse_pivots.json | 26 + .../row_major_reverse_pivots_ipiv_offset.json | 26 + .../row_major_reverse_pivots_ipiv_stride.json | 26 + .../@stdlib/lapack/base/zlaswp/test/test.js | 82 +++ .../lapack/base/zlaswp/test/test.ndarray.js | 577 ++++++++++++++++++ .../lapack/base/zlaswp/test/test.zlaswp.js | 502 +++++++++++++++ 27 files changed, 2269 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_offset.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_strides.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_complex_access_patterns.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_offset.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_negative.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_positive.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_k1.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_lda.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_no_offsets.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_offset.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_stride.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_offset.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_strides.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_complex_access_patterns.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_offset.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_negative.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_positive.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_k1.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_lda.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_no_offsets.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_offset.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_stride.json create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.js create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_offset.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_offset.json new file mode 100644 index 000000000000..0e41852c0261 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_offset.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + + "N": 2, + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 1, + "A": [ 9999.0, 9999.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 9999.0, 9999.0 ], + + "k1": 0, + "k2": 2, + "incK": 1, + + "IPIV": [ 2, 0, 1 ], + "strideIPIV": 1, + "offsetIPIV": 0, + + "interchanges": [ + [ 0, 2 ], + [ 1, 0 ], + [ 2, 1 ] + ], + + "A_out": [ 9999.0, 9999.0, 2.0, 1.0, 3.0, 5.0, 4.0, 6.0, 9999.0, 9999.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_strides.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_strides.json new file mode 100644 index 000000000000..382733009c10 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_strides.json @@ -0,0 +1,124 @@ +{ + "order": "column-major", + + "N": 2, + "LDA": null, + "strideA1": 2, + "strideA2": 12, + "offsetA": 0, + "A": [ + 1.0, + 2.0, + 9999.0, + 9999.0, + 3.0, + 4.0, + 9999.0, + 9999.0, + 5.0, + 6.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 7.0, + 8.0, + 9999.0, + 9999.0, + 9.0, + 10.0, + 9999.0, + 9999.0, + 11.0, + 12.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0 +], + + "k1": 0, + "k2": 2, + "incK": 1, + + "IPIV": [ 2, 0, 1 ], + "strideIPIV": 1, + "offsetIPIV": 0, + + "interchanges": [ + [ 0, 2 ], + [ 1, 0 ], + [ 2, 1 ] + ], + + "A_out": [ + 3.0, + 4.0, + 9999.0, + 9999.0, + 1.0, + 2.0, + 9999.0, + 9999.0, + 5.0, + 6.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9.0, + 10.0, + 9999.0, + 9999.0, + 7.0, + 8.0, + 9999.0, + 9999.0, + 11.0, + 12.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_complex_access_patterns.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_complex_access_patterns.json new file mode 100644 index 000000000000..4d968e4f6018 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_complex_access_patterns.json @@ -0,0 +1,128 @@ +{ + "order": "column-major", + + "N": 2, + "LDA": null, + "strideA1": -2, + "strideA2": 12, + "offsetA": 6, + "A": [ + 9999.0, + 9999.0, + 5.0, + 6.0, + 9999.0, + 9999.0, + 3.0, + 4.0, + 9999.0, + 9999.0, + 1.0, + 2.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 11.0, + 12.0, + 9999.0, + 9999.0, + 9.0, + 10.0, + 9999.0, + 9999.0, + 7.0, + 8.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0 +], + + "k1": 0, + "k2": 2, + "incK": 1, + + "IPIV": [ 9999, 9999, 1, 9999, 0, 9999, 2, 9999, 9999 ], + "strideIPIV": -2, + "offsetIPIV": 6, + + "interchanges": [ + [ 0, 2 ], + [ 1, 0 ], + [ 2, 1 ] + ], + + "A_out": [ + 9999.0, + 9999.0, + 5.0, + 6.0, + 9999.0, + 9999.0, + 1.0, + 2.0, + 9999.0, + 9999.0, + 3.0, + 4.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 11.0, + 12.0, + 9999.0, + 9999.0, + 7.0, + 8.0, + 9999.0, + 9999.0, + 9.0, + 10.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_offset.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_offset.json new file mode 100644 index 000000000000..b367db7f1c98 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_offset.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + + "N": 2, + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + + "k1": 0, + "k2": 2, + "incK": 1, + + "IPIV": [ 3, 4, 2, 0, 1 ], + "strideIPIV": 1, + "offsetIPIV": 2, + + "interchanges": [ + [ 0, 2 ], + [ 1, 0 ], + [ 2, 1 ] + ], + + "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_negative.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_negative.json new file mode 100644 index 000000000000..365b51aa05ae --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_negative.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + + "N": 2, + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + + "k1": 0, + "k2": 2, + "incK": -1, + + "IPIV": [ 2, 999, 0, 999, 1, 999 ], + "strideIPIV": -2, + "offsetIPIV": 0, + + "interchanges": [ + [ 2, 1 ], + [ 1, 0 ], + [ 0, 2 ] + ], + + "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_positive.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_positive.json new file mode 100644 index 000000000000..30d38ee5469a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_positive.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + + "N": 2, + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + + "k1": 0, + "k2": 2, + "incK": 1, + + "IPIV": [ 2, 999, 0, 999, 1, 999 ], + "strideIPIV": 2, + "offsetIPIV": 0, + + "interchanges": [ + [ 0, 2 ], + [ 1, 0 ], + [ 2, 1 ] + ], + + "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_k1.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_k1.json new file mode 100644 index 000000000000..c9d47579d327 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_k1.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + + "N": 2, + "LDA": 6, + "strideA1": 1, + "strideA2": 6, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0 ], + + "k1": 3, + "k2": 5, + "incK": 1, + + "IPIV": [ 999, 999, 999, 2, 1, 0 ], + "strideIPIV": 1, + "offsetIPIV": 0, + + "interchanges": [ + [ 3, 2 ], + [ 4, 1 ], + [ 5, 0 ] + ], + + "A_out": [ 11.0, 12.0, 9.0, 10.0, 7.0, 8.0, 5.0, 6.0, 3.0, 4.0, 1.0, 2.0, 23.0, 24.0, 21.0, 22.0, 19.0, 20.0, 17.0, 18.0, 15.0, 16.0, 13.0, 14.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_lda.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_lda.json new file mode 100644 index 000000000000..8ec9b6961394 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_lda.json @@ -0,0 +1,116 @@ +{ + "order": "column-major", + + "N": 2, + "LDA": 12, + "strideA1": 1, + "strideA2": 12, + "offsetA": 0, + "A": [ + 1.0, + 2.0, + 3.0, + 4.0, + 5.0, + 6.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 7.0, + 8.0, + 9.0, + 10.0, + 11.0, + 12.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0 +], + + "k1": 0, + "k2": 2, + "incK": 1, + + "IPIV": [ 2, 0, 1 ], + "strideIPIV": 1, + "offsetIPIV": 0, + + "interchanges": [ + [ 0, 2 ], + [ 1, 0 ], + [ 2, 1 ] + ], + + "A_out": [ + 3.0, + 4.0, + 1.0, + 2.0, + 5.0, + 6.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9.0, + 10.0, + 7.0, + 8.0, + 11.0, + 12.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_no_offsets.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_no_offsets.json new file mode 100644 index 000000000000..011369accb03 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_no_offsets.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + + "N": 2, + "LDA": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + + "k1": 0, + "k2": 2, + "incK": 1, + + "IPIV": [ 2, 0, 1 ], + "strideIPIV": 1, + "offsetIPIV": 0, + + "interchanges": [ + [ 0, 2 ], + [ 1, 0 ], + [ 2, 1 ] + ], + + "A_out": [ 5.0, 6.0, 1.0, 2.0, 9.0, 10.0, 7.0, 8.0, 3.0, 4.0, 11.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots.json new file mode 100644 index 000000000000..4e7e5bb276cc --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + + "N": 2, + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + + "k1": 0, + "k2": 2, + "incK": -1, + + "IPIV": [ 2, 0, 1 ], + "strideIPIV": 1, + "offsetIPIV": 0, + + "interchanges": [ + [ 2, 1 ], + [ 1, 0 ], + [ 0, 2 ] + ], + + "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_offset.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_offset.json new file mode 100644 index 000000000000..cb45b0e27794 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_offset.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + + "N": 2, + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + + "k1": 0, + "k2": 2, + "incK": -1, + + "IPIV": [ 3, 4, 2, 0, 1 ], + "strideIPIV": 1, + "offsetIPIV": 2, + + "interchanges": [ + [ 2, 1 ], + [ 1, 0 ], + [ 0, 2 ] + ], + + "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_stride.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_stride.json new file mode 100644 index 000000000000..11c322f478cb --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_stride.json @@ -0,0 +1,26 @@ +{ + "order": "column-major", + + "N": 2, + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + + "k1": 0, + "k2": 2, + "incK": -1, + + "IPIV": [ 1, 0, 2 ], + "strideIPIV": -1, + "offsetIPIV": 2, + + "interchanges": [ + [ 2, 1 ], + [ 1, 0 ], + [ 0, 2 ] + ], + + "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_offset.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_offset.json new file mode 100644 index 000000000000..282494e322d7 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_offset.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + + "N": 2, + "LDA": 3, + "strideA1": 2, + "strideA2": 1, + "offsetA": 2, + "A": [ 9999.0, 9999.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 9999.0, 9999.0 ], + + "k1": 0, + "k2": 2, + "incK": 1, + + "IPIV": [ 2, 0, 1 ], + "strideIPIV": 1, + "offsetIPIV": 0, + + "interchanges": [ + [ 0, 2 ], + [ 1, 0 ], + [ 2, 1 ] + ], + + "A_out": [ 9999.0, 9999.0, 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0, 9999.0, 9999.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_strides.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_strides.json new file mode 100644 index 000000000000..58275870e8b4 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_strides.json @@ -0,0 +1,100 @@ +{ + "order": "row-major", + + "N": 2, + "LDA": null, + "strideA1": 6, + "strideA2": 2, + "offsetA": 0, + "A": [ + 1.0, + 2.0, + 9999.0, + 9999.0, + 3.0, + 4.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 5.0, + 6.0, + 9999.0, + 9999.0, + 7.0, + 8.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9.0, + 10.0, + 9999.0, + 9999.0, + 11.0, + 12.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0 +], + + "k1": 0, + "k2": 2, + "incK": 1, + + "IPIV": [ 2, 0, 1 ], + "strideIPIV": 1, + "offsetIPIV": 0, + + "interchanges": [ + [ 0, 2 ], + [ 1, 0 ], + [ 2, 1 ] + ], + + "A_out": [ + 5.0, + 6.0, + 9999.0, + 9999.0, + 7.0, + 8.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 1.0, + 2.0, + 9999.0, + 9999.0, + 3.0, + 4.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9.0, + 10.0, + 9999.0, + 9999.0, + 11.0, + 12.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_complex_access_patterns.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_complex_access_patterns.json new file mode 100644 index 000000000000..6e1e1f638044 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_complex_access_patterns.json @@ -0,0 +1,96 @@ +{ + "order": "row-major", + + "N": 2, + "LDA": null, + "strideA1": 6, + "strideA2": -2, + "offsetA": 3, + "A": [ + 9999.0, + 9999.0, + 3.0, + 4.0, + 9999.0, + 9999.0, + 1.0, + 2.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 7.0, + 8.0, + 9999.0, + 9999.0, + 5.0, + 6.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 11.0, + 12.0, + 9999.0, + 9999.0, + 9.0, + 10.0, + 9999.0, + 9999.0 +], + + "k1": 0, + "k2": 2, + "incK": 1, + + "IPIV": [ 9999, 1, 9999, 0, 9999, 2, 9999 ], + "strideIPIV": -2, + "offsetIPIV": 5, + + "interchanges": [ + [ 0, 2 ], + [ 1, 0 ], + [ 2, 1 ] + ], + + "A_out": [ + 9999.0, + 9999.0, + 7.0, + 8.0, + 9999.0, + 9999.0, + 5.0, + 6.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 4.0, + 3.0, + 9999.0, + 9999.0, + 1.0, + 2.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 11.0, + 12.0, + 9999.0, + 9999.0, + 9.0, + 10.0, + 9999.0, + 9999.0 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_offset.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_offset.json new file mode 100644 index 000000000000..16e97ecf78e4 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_offset.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + + "N": 2, + "LDA": 3, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + + "k1": 0, + "k2": 2, + "incK": 1, + + "IPIV": [ 3, 4, 2, 0, 1 ], + "strideIPIV": 1, + "offsetIPIV": 2, + + "interchanges": [ + [ 0, 2 ], + [ 1, 0 ], + [ 2, 1 ] + ], + + "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_negative.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_negative.json new file mode 100644 index 000000000000..c531a5795541 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_negative.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + + "N": 3, + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ], + + "k1": 0, + "k2": 2, + "incK": -1, + + "IPIV": [ 2, 9999, 0, 9999, 1, 9999 ], + "strideIPIV": -2, + "offsetIPIV": 0, + + "interchanges": [ + [ 2, 1 ], + [ 1, 0 ], + [ 0, 2 ] + ], + + "A_out": [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_positive.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_positive.json new file mode 100644 index 000000000000..974cec079fbc --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_positive.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + + "N": 3, + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ], + + "k1": 0, + "k2": 2, + "incK": 1, + + "IPIV": [ 2, 9999, 0, 9999, 1, 9999 ], + "strideIPIV": 2, + "offsetIPIV": 0, + + "interchanges": [ + [ 2, 1 ], + [ 1, 0 ], + [ 0, 2 ] + ], + + "A_out": [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_k1.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_k1.json new file mode 100644 index 000000000000..a6d5a1f5968f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_k1.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + + "N": 2, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0 ], + + "k1": 3, + "k2": 5, + "incK": 1, + + "IPIV": [ 999, 999, 999, 2, 1, 0 ], + "strideIPIV": 1, + "offsetIPIV": 0, + + "interchanges": [ + [ 3, 2 ], + [ 4, 1 ], + [ 5, 0 ] + ], + + "A_out": [ 21.0, 22.0, 23.0, 24.0, 17.0, 18.0, 19.0, 20.0, 13.0, 14.0, 15.0, 16.0, 9.0, 10.0, 11.0, 12.0, 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_lda.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_lda.json new file mode 100644 index 000000000000..34978c5541b1 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_lda.json @@ -0,0 +1,76 @@ +{ + "order": "row-major", + + "N": 2, + "LDA": 4, + "strideA1": 4, + "strideA2": 1, + "offsetA": 0, + "A": [ + 1.0, + 2.0, + 3.0, + 4.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 5.0, + 6.0, + 7.0, + 8.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9.0, + 10.0, + 11.0, + 12.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0 +], + + "k1": 0, + "k2": 2, + "incK": 1, + + "IPIV": [ 2, 0, 1 ], + "strideIPIV": 1, + "offsetIPIV": 0, + + "interchanges": [ + [ 0, 2 ], + [ 1, 0 ], + [ 2, 1 ] + ], + + "A_out": [ + 5.0, + 6.0, + 7.0, + 8.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 1.0, + 2.0, + 3.0, + 4.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0, + 9.0, + 10.0, + 11.0, + 12.0, + 9999.0, + 9999.0, + 9999.0, + 9999.0 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_no_offsets.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_no_offsets.json new file mode 100644 index 000000000000..72c6cf2d9795 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_no_offsets.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + + "N": 2, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + + "k1": 0, + "k2": 2, + "incK": 1, + + "IPIV": [ 2, 0, 1 ], + "strideIPIV": 1, + "offsetIPIV": 0, + + "interchanges": [ + [ 0, 2 ], + [ 1, 0 ], + [ 2, 1 ] + ], + + "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots.json new file mode 100644 index 000000000000..bb928bc65ff7 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + + "N": 2, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + + "k1": 0, + "k2": 2, + "incK": -1, + + "IPIV": [ 2, 0, 1 ], + "strideIPIV": 1, + "offsetIPIV": 0, + + "interchanges": [ + [ 2, 1 ], + [ 1, 0 ], + [ 0, 2 ] + ], + + "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_offset.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_offset.json new file mode 100644 index 000000000000..7cb31e2ade4a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_offset.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + + "N": 2, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + + "k1": 0, + "k2": 2, + "incK": -1, + + "IPIV": [ 3, 4, 2, 0, 1 ], + "strideIPIV": 1, + "offsetIPIV": 2, + + "interchanges": [ + [ 2, 1 ], + [ 1, 0 ], + [ 0, 2 ] + ], + + "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_stride.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_stride.json new file mode 100644 index 000000000000..ccfdd705ed50 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_stride.json @@ -0,0 +1,26 @@ +{ + "order": "row-major", + + "N": 2, + "LDA": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + + "k1": 0, + "k2": 2, + "incK": -1, + + "IPIV": [ 1, 0, 2 ], + "strideIPIV": -1, + "offsetIPIV": 2, + + "interchanges": [ + [ 2, 1 ], + [ 1, 0 ], + [ 0, 2 ] + ], + + "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.js new file mode 100644 index 000000000000..4a298984c4f1 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var zlaswp = 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 zlaswp, '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 zlaswp.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 zlaswp = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( zlaswp, 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 zlaswp; + var main; + + main = require( './../lib/zlaswp.js' ); + + zlaswp = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( zlaswp, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js new file mode 100644 index 000000000000..f2c6bfd8e423 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js @@ -0,0 +1,577 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Int32Array = require( '@stdlib/array/int32' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var oneTo = require( '@stdlib/array/one-to' ); +var flatten = require( '@stdlib/array/base/flatten' ); +var reverse = require( '@stdlib/array/base/reverse' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var numel = require( '@stdlib/ndarray/base/numel' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var dlaswp = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var COL_MAJOR = require( './fixtures/column_major_no_offsets.json' ); +var COL_MAJOR_IPIV_STRIDE_POS = require( './fixtures/column_major_ipiv_stride_positive.json' ); +var COL_MAJOR_IPIV_OFFSET = require( './fixtures/column_major_ipiv_offset.json' ); +var COL_MAJOR_A_STRIDES = require( './fixtures/column_major_a_strides.json' ); +var COL_MAJOR_A_OFFSET = require( './fixtures/column_major_a_offset.json' ); +var COL_MAJOR_CMPLX_ACCESS = require( './fixtures/column_major_complex_access_patterns.json' ); +var COL_MAJOR_REV_PIVOTS = require( './fixtures/column_major_reverse_pivots.json' ); +var COL_MAJOR_REV_PIVOTS_IPIV_STRIDE = require( './fixtures/column_major_reverse_pivots_ipiv_stride.json' ); // eslint-disable-line id-length +var COL_MAJOR_REV_PIVOTS_IPIV_OFFSET = require( './fixtures/column_major_reverse_pivots_ipiv_offset.json' ); // eslint-disable-line id-length +var COL_MAJOR_K1 = require( './fixtures/column_major_k1.json' ); + +var ROW_MAJOR = require( './fixtures/row_major_no_offsets.json' ); +var ROW_MAJOR_IPIV_STRIDE_POS = require( './fixtures/row_major_ipiv_stride_positive.json' ); +var ROW_MAJOR_IPIV_OFFSET = require( './fixtures/row_major_ipiv_offset.json' ); +var ROW_MAJOR_A_STRIDES = require( './fixtures/row_major_a_strides.json' ); +var ROW_MAJOR_A_OFFSET = require( './fixtures/row_major_a_offset.json' ); +var ROW_MAJOR_CMPLX_ACCESS = require( './fixtures/row_major_complex_access_patterns.json' ); +var ROW_MAJOR_REV_PIVOTS = require( './fixtures/row_major_reverse_pivots.json' ); +var ROW_MAJOR_REV_PIVOTS_IPIV_STRIDE = require( './fixtures/row_major_reverse_pivots_ipiv_stride.json' ); // eslint-disable-line id-length +var ROW_MAJOR_REV_PIVOTS_IPIV_OFFSET = require( './fixtures/row_major_reverse_pivots_ipiv_offset.json' ); // eslint-disable-line id-length +var ROW_MAJOR_K1 = require( './fixtures/row_major_k1.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlaswp, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 11', function test( t ) { + t.strictEqual( dlaswp.length, 11, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs a series of row interchanges (column-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a series of row interchanges (column-major, k1 > 0)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR_K1; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports applying pivots in reverse order (column-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR_REV_PIVOTS; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an `IPIV` stride (column-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR_IPIV_STRIDE_POS; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an `IPIV` stride (reverse pivots, column-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR_REV_PIVOTS_IPIV_STRIDE; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an `IPIV` offset (column-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR_IPIV_OFFSET; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an `IPIV` offset (reverse pivots, column-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR_REV_PIVOTS_IPIV_OFFSET; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports `A` strides (column-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR_A_STRIDES; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, '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 IPIV; + var data; + var out; + var A; + + data = COL_MAJOR_A_OFFSET; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, '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 IPIV; + var data; + var out; + var A; + + data = COL_MAJOR_CMPLX_ACCESS; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function efficiently handles large datasets (column-major)', function test( t ) { + var expected; + var IPIV; + var buf; + var mat; + var out; + var ord; + var sh; + var st; + var A; + var o; + + ord = 'column-major'; + sh = [ 5, 100 ]; + st = shape2strides( sh, ord ); + o = 0; + + // Define a linear buffer: + buf = oneTo( numel( sh ), 'generic' ); + + // Convert to a nested array: + mat = ndarray2array( buf, sh, st, o, ord ); + + // Define an input matrix in linear storage: + A = new Complex128Array( buf ); + + // Create an array of pivot indices: + IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] ); + + // Define the expected output array: + expected = reverse( mat.slice() ); + expected = new Complex128Array( flatten( expected, sh, true ) ); + + // Interchange rows: + out = dlaswp( sh[1], A, st[0], st[1], o, 3, 4, 1, IPIV, 1, 0 ); + + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a series of row interchanges (row-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a series of row interchanges (row-major, k1 > 0)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR_K1; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports applying pivots in reverse order (row-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR_REV_PIVOTS; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an `IPIV` stride (row-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR_IPIV_STRIDE_POS; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an `IPIV` stride (reverse pivots, row-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR_REV_PIVOTS_IPIV_STRIDE; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an `IPIV` offset (row-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR_IPIV_OFFSET; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports an `IPIV` offset (reverse pivots, row-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR_REV_PIVOTS_IPIV_OFFSET; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports `A` strides (row-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR_A_STRIDES; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, '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 IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR_A_OFFSET; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, '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 IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR_CMPLX_ACCESS; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function efficiently handles large datasets (row-major)', function test( t ) { + var expected; + var IPIV; + var buf; + var mat; + var out; + var ord; + var sh; + var st; + var A; + var o; + + ord = 'row-major'; + sh = [ 5, 100 ]; + st = shape2strides( sh, ord ); + o = 0; + + // Define a linear buffer: + buf = oneTo( numel( sh ), 'generic' ); + + // Convert to a nested array: + mat = ndarray2array( buf, sh, st, o, ord ); + + // Define an input matrix in linear storage: + A = new Complex128Array( buf ); + + // Create an array of pivot indices: + IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] ); + + // Define the expected output array: + expected = reverse( mat.slice() ); + expected = new Complex128Array( flatten( expected, sh, false ) ); + + // Interchange rows: + out = dlaswp( sh[1], A, st[0], st[1], o, 3, 4, 1, IPIV, 1, 0 ); + + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js new file mode 100644 index 000000000000..f76509016ae9 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js @@ -0,0 +1,502 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Int32Array = require( '@stdlib/array/int32' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var oneTo = require( '@stdlib/array/one-to' ); +var flatten = require( '@stdlib/array/base/flatten' ); +var reverse = require( '@stdlib/array/base/reverse' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var numel = require( '@stdlib/ndarray/base/numel' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var zlaswp = require( './../lib/zlaswp.js' ); + + +// FIXTURES // + +var COL_MAJOR = require( './fixtures/column_major_no_offsets.json' ); +var COL_MAJOR_IPIV_STRIDE_POS = require( './fixtures/column_major_ipiv_stride_positive.json' ); +var COL_MAJOR_IPIV_STRIDE_NEG = require( './fixtures/column_major_ipiv_stride_negative.json' ); +var COL_MAJOR_LDA = require( './fixtures/column_major_lda.json' ); +var COL_MAJOR_REV_PIVOTS = require( './fixtures/column_major_reverse_pivots.json' ); +var COL_MAJOR_K1 = require( './fixtures/column_major_k1.json' ); + +var ROW_MAJOR = require( './fixtures/row_major_no_offsets.json' ); +var ROW_MAJOR_IPIV_STRIDE_POS = require( './fixtures/row_major_ipiv_stride_positive.json' ); +var ROW_MAJOR_IPIV_STRIDE_NEG = require( './fixtures/row_major_ipiv_stride_negative.json' ); +var ROW_MAJOR_LDA = require( './fixtures/row_major_lda.json' ); +var ROW_MAJOR_REV_PIVOTS = require( './fixtures/row_major_reverse_pivots.json' ); +var ROW_MAJOR_K1 = require( './fixtures/row_major_k1.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof zlaswp, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 8', function test( t ) { + t.strictEqual( zlaswp.length, 8, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not a valid order', function test( t ) { + var values; + var data; + var i; + + data = COL_MAJOR; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + 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() { + zlaswp( value, data.N, data.A, data.LDA, data.k1, data.k2, data.IPIV, data.strideIPIV ); + }; + } +}); + +tape( 'the function throws an error if provided a fourth argument which is not a valid `LDA` value (row-major)', function test( t ) { + var values; + var data; + var i; + + data = ROW_MAJOR; + + values = [ + 0, + 1 + ]; + + 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() { + zlaswp( data.order, data.N, data.A, value, data.k1, data.k2, data.IPIV, data.strideIPIV ); + }; + } +}); + +tape( 'the function performs a series of row interchanges (column-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a series of row interchanges (column-major, k1 > 0)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR_K1; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports applying pivots in reverse order (column-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR_REV_PIVOTS; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `LDA` parameter for operating on sub-matrices (column-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR_LDA; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a positive increment between successive values of `IPIV` (column-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR_IPIV_STRIDE_POS; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative increment between successive values of `IPIV` (column-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR_IPIV_STRIDE_NEG; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an increment between successive values of `IPIV` equal to `0`, the function returns the input matrix unchanged (column-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = COL_MAJOR; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A ); + + out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, 0 ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function efficiently handles large datasets (column-major)', function test( t ) { + var expected; + var IPIV; + var buf; + var mat; + var out; + var ord; + var sh; + var st; + var A; + var o; + + ord = 'column-major'; + sh = [ 5, 100 ]; + st = shape2strides( sh, ord ); + o = 0; + + // Define a linear buffer: + buf = oneTo( numel( sh ), 'generic' ); + + // Convert to a nested array: + mat = ndarray2array( buf, sh, st, o, ord ); + + // Define an input matrix in linear storage: + A = new Complex128Array( buf ); + + // Create an array of pivot indices: + IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] ); + + // Define the expected output array: + expected = reverse( mat.slice() ); + expected = new Complex128Array( flatten( expected, sh, true ) ); + + // Interchange rows: + out = zlaswp( ord, sh[1], A, sh[0], 3, 4, IPIV, 1 ); + + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a series of row interchanges (row-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs a series of row interchanges (row-major, k1 > 0)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR_K1; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports applying pivots in reverse order (row-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR_REV_PIVOTS; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `LDA` parameter for operating on sub-matrices (row-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR_LDA; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a positive increment between successive values of `IPIV` (row-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR_IPIV_STRIDE_POS; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative increment between successive values of `IPIV` (row-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR_IPIV_STRIDE_NEG; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A_out ); + + out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an increment between successive values of `IPIV` equal to `0`, the function returns the input matrix unchanged (row-major)', function test( t ) { + var expected; + var IPIV; + var data; + var out; + var A; + + data = ROW_MAJOR; + + A = new Complex128Array( data.A ); + IPIV = new Int32Array( data.IPIV ); + + expected = new Complex128Array( data.A ); + + out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, 0 ); + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function efficiently handles large datasets (row-major)', function test( t ) { + var expected; + var IPIV; + var buf; + var mat; + var out; + var ord; + var sh; + var st; + var A; + var o; + + ord = 'row-major'; + sh = [ 5, 100 ]; + st = shape2strides( sh, ord ); + o = 0; + + // Define a linear buffer: + buf = oneTo( numel( sh ), 'generic' ); + + // Convert to a nested array: + mat = ndarray2array( buf, sh, st, o, ord ); + + // Define an input matrix in linear storage: + A = new Complex128Array( buf ); + + // Create an array of pivot indices: + IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] ); + + // Define the expected output array: + expected = reverse( mat.slice() ); + expected = new Complex128Array( flatten( expected, sh, false ) ); + + // Interchange rows: + out = zlaswp( ord, sh[1], A, sh[1], 3, 4, IPIV, 1 ); + + t.strictEqual( out, A, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); From 97058f917aa6906ca31c4ec01cc052ae3b984857 Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Fri, 28 Feb 2025 14:39:32 +0000 Subject: [PATCH 04/22] docs: add examples --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../lapack/base/zlaswp/examples/index.js | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/examples/index.js diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/examples/index.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/examples/index.js new file mode 100644 index 000000000000..97c6a1347640 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/examples/index.js @@ -0,0 +1,41 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var Complex128Array = require( '@stdlib/array/complex128' ); +var Int32Array = require( '@stdlib/array/int32' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var zlaswp = require( './../lib' ); + +// Specify matrix meta data: +var shape = [ 4, 2 ]; +var strides = [ 1, 4 ]; +var offset = 0; +var order = 'column-major'; + +// Create a matrix stored in linear memory: +var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] ); // eslint-disable-line max-len +console.log( ndarray2array( A, shape, strides, offset, order ) ); + +// Define a vector of pivot indices: +var IPIV = new Int32Array( [ 2, 0, 3, 1 ] ); + +// Interchange rows: +zlaswp( order, shape[ 1 ], A, strides[ 1 ], 0, shape[ 0 ]-1, IPIV, 1 ); +console.log( ndarray2array( A, shape, strides, offset, order ) ); From 8e261b4fa5fc72ca94c94f63b902572956bec542 Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Fri, 28 Feb 2025 15:57:58 +0000 Subject: [PATCH 05/22] bench: add benchmarks for zlaswp --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../lapack/base/zlaswp/benchmark/benchmark.js | 128 ++++++++++++++++ .../zlaswp/benchmark/benchmark.ndarray.js | 137 ++++++++++++++++++ .../@stdlib/lapack/base/zlaswp/package.json | 72 +++++++++ 3 files changed, 337 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.ndarray.js create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/package.json diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.js new file mode 100644 index 000000000000..79d65febe3e7 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.js @@ -0,0 +1,128 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var pkg = require( './../package.json' ).name; +var zlaswp = require( './../lib/zlaswp.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; +var opts = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @param {PositiveInteger} nrows - number of rows to interchange +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N, nrows ) { + var IPIV; + var A; + + IPIV = discreteUniform( nrows, 0, N-1, { + 'dtype': 'int32' + }); + A = new Complex128Array( uniform( 2*N*N, -10.0, 10.0, opts ) ); + + 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 = zlaswp( order, N, A, N, 0, nrows-1, IPIV, 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 ord; + var N; + var f; + var i; + var j; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + j = 1; + while ( j <= N ) { + f = createBenchmark( ord, N, j ); + bench( pkg+'::square_matrix:order='+ord+',nrows='+j+',size='+(N*N), f ); + j *= 2; + } + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..d27e9ce0a19b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.ndarray.js @@ -0,0 +1,137 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var pkg = require( './../package.json' ).name; +var dlaswp = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; +var opts = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @param {PositiveInteger} nrows - number of rows to interchange +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N, nrows ) { + var IPIV; + var sa1; + var sa2; + var A; + + if ( order === 'column-major' ) { + sa1 = 1; + sa2 = N; + } else { // order === 'row-major' + sa1 = N; + sa2 = 1; + } + IPIV = discreteUniform( nrows, 0, N-1, { + 'dtype': 'int32' + }); + A = new Complex128Array( uniform( 2*N*N, -10.0, 10.0, opts ) ); + + 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 = dlaswp( N, A, sa1, sa2, 0, 0, nrows-1, 1, IPIV, 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 ord; + var N; + var f; + var i; + var j; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + j = 1; + while ( j <= N ) { + f = createBenchmark( ord, N, j ); + bench( pkg+'::square_matrix:ndarray:order='+ord+',nrows='+j+',size='+(N*N), f ); + j *= 2; + } + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/package.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/package.json new file mode 100644 index 000000000000..e3e2609ca24c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/package.json @@ -0,0 +1,72 @@ +{ + "name": "@stdlib/lapack/base/zlaswp", + "version": "0.0.0", + "description": "Perform a series of row interchanges on an input matrix.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "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", + "lapack", + "dlaswp", + "interchange", + "swap", + "exchange", + "permute", + "permutedims", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "float64", + "double", + "float64array" + ] +} From fabb2462ef1cfd70c44f263e12384bb7065da48c Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Fri, 28 Feb 2025 16:18:12 +0000 Subject: [PATCH 06/22] docs: add docs for zlaswp --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../lapack/base/zlaswp/docs/types/index.d.ts | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/index.d.ts diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/index.d.ts new file mode 100644 index 000000000000..8656ab9a127d --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/index.d.ts @@ -0,0 +1,124 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Layout } from '@stdlib/types/blas'; +import { Complex128Array } from '@stdlib/types/array'; + + +/** +* Interface describing `zlaswp`. +*/ +interface Routine { + /** + * Performs a series of row interchanges on a matrix `A` using pivot indices stored in `IPIV`. + * + * @param order - storage layout + * @param N - number of columns in `A` + * @param A - input matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param k1 - index of first row to interchange + * @param k2 - index of last row to interchange + * @param IPIV - vector of pivot indices + * @param incx - increment between successive values of `IPIV` + * @returns permuted matrix `A` + * + * @example + * var Int32Array = require( '@stdlib/array/int32' ); + * var Complex128Array = require( '@stdlib/array/complex128' ); + * + * var IPIV = new Int32Array( [ 2, 0, 1 ] ); + * var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); + * + * zlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, 1 ); + * // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] + */ + ( order: Layout, N: number, A: Complex128Array, LDA: number, k1: number, k2: number, IPIV: Int32Array, incx: number ): Complex128Array; + + /** + * Performs a series of row interchanges on a matrix `A` using pivot indices stored in `IPIV` and alternative indexing semantics. + * + * @param N - number of columns in `A` + * @param A - input matrix + * @param strideA1 - stride of the first dimension of `A` + * @param strideA2 - stride of the second dimension of `A` + * @param offsetA - index offset for `A` + * @param k1 - index of first row to interchange + * @param k2 - index of last row to interchange + * @param inck - direction in which to apply pivots (-1 to apply pivots in reverse order; otherwise, apply in provided order) + * @param IPIV - vector of pivot indices + * @param strideIPIV - `IPIV` stride length + * @param offsetIPIV - index offset for `IPIV` + * @returns permuted matrix `A` + * + * @example + * var Int32Array = require( '@stdlib/array/int32' ); + * var Complex128Array = require( '@stdlib/array/complex128' ); + * + * var IPIV = new Int32Array( [ 2, 0, 1 ] ); + * var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); + * + * zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); + * // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] + */ + ndarray( N: number, A: Complex128Array, strideA1: number, strideA2: number, offsetA: number, k1: number, k2: number, inck: number, IPIV: Int32Array, strideIPIV: number, offsetIPIV: number ): Complex128Array; +} + +/** +* Performs a series of row interchanges on a matrix `A` using pivot indices stored in `IPIV`. +* +* @param order - storage layout +* @param N - number of columns in `A` +* @param A - input matrix +* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param k1 - index of first row to interchange +* @param k2 - index of last row to interchange +* @param IPIV - vector of pivot indices +* @param incx - increment between successive values of `IPIV` +* @returns permuted matrix `A` +* +* @example +* var Int32Array = require( '@stdlib/array/int32' ); +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var IPIV = new Int32Array( [ 2, 0, 1 ] ); +* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +* +* zlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, 1 ); +* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] +* +* @example +* var Int32Array = require( '@stdlib/array/int32' ); +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var IPIV = new Int32Array( [ 2, 0, 1 ] ); +* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +* +* zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); +* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] +* // A => [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0 ] +*/ +declare var zlaswp: Routine; + + +// EXPORTS // + +export = zlaswp; From c65944e5133aea92d7582a5beaecfdc9cfa17f19 Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Fri, 28 Feb 2025 16:19:16 +0000 Subject: [PATCH 07/22] docs: add repl.txt --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/lapack/base/zlaswp/docs/repl.txt | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt new file mode 100644 index 000000000000..6cfbee4a5eab --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt @@ -0,0 +1,119 @@ + +{{alias}}( order, N, A, LDA, k1, k2, IPIV, incx ) + Performs a series of row interchanges on the matrix `A` using pivot indices + stored in `IPIV`. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `incx` is equal to `0`, the function returns `A` unchanged. + + Parameters + ---------- + order: string + Row-major (C-style) or column-major (Fortran-style) order. Must be + either 'row-major' or 'column-major'. + + N: integer + Number of columns in `A`. + + A: Complex128Array + Input matrix. + + LDA: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + k1: integer + Index of first row to interchange. + + k2: integer + Index of last row to interchange. + + IPIV: Int32Array + Array of pivot indices. + + incx: integer + Increment between successive values of `IPIV`. + + Returns + ------- + A: Complex128Array + Mutated input matrix. + + Examples + -------- + > var IPIV = new {{alias:@stdlib/array/int32}}( [ 1, 0 ] ); + > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + > var ord = 'row-major'; + > {{alias}}( ord, 2, A, 2, 0, 1, IPIV, 1 ) + [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] + + // Using typed array views: + > var IPIV0 = new {{alias:@stdlib/array/int32}}( [ 0, 1, 0 ] ); + > var A0 = new {{alias:@stdlib/array/complex128}}( [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + > IPIV = new Int32Array( IPIV0.buffer, IPIV0.BYTES_PER_ELEMENT*1 ); + > A = new Complex128Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); + > {{alias}}( ord, 2, A, 2, 0, 1, IPIV, 1 ); + > A0 + [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] + + +{{alias}}.ndarray( N, A, sa1, sa2, oa, k1, k2, inck, IPIV, si, oi ) + Performs a series of row interchanges on the matrix `A` using pivot indices + stored in `IPIV` and alternative indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameters support indexing semantics based on starting + indices. + + Parameters + ---------- + N: integer + Number of columns in `A`. + + A: Complex128Array + Input matrix. + + sa1: integer + Stride of the first dimension of `A`. + + sa2: integer + Stride of the second dimension of `A`. + + oa: integer + Index offset for `A`. + + k1: integer + Index of first row to interchange. + + k2: integer + Index of last row to interchange. + + inck: integer + Direction in which to apply pivots (-1 to apply pivots in reverse order; + otherwise, apply in provided order). + + IPIV: Int32Array + Array of pivot indices. + + si: integer + Index increment for `IPIV`. + + oi: integer + Index offset for `IPIV`. + + Returns + ------- + A: Complex128Array + Mutated input matrix. + + Examples + -------- + > var IPIV = new {{alias:@stdlib/array/int32}}( [ 2, 0, 1 ] ); + > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); + > {{alias}}.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ) + [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] + + See Also + -------- From a1a6e5ca8ae5c9f8d807c4c00415ddf98e0e17c3 Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Fri, 28 Feb 2025 16:33:54 +0000 Subject: [PATCH 08/22] docs: add README --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/lapack/base/zlaswp/README.md | 295 ++++++++++++++++++ 1 file changed, 295 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/README.md diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/README.md b/lib/node_modules/@stdlib/lapack/base/zlaswp/README.md new file mode 100644 index 000000000000..fa06c147c95d --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/README.md @@ -0,0 +1,295 @@ + + + + +# zlaswp + +> Perform a series of row interchanges on an input matrix. + +
+ +## Usage + +```javascript +var zlaswp = require( '@stdlib/lapack/base/zlaswp' ); +``` + +#### zlaswp( N, A, LDA, k1, k2, IPIV, incx ) + +Performs a series of row interchanges on an input matrix `A` using pivot indices stored in `IPIV`. + +```javascript +var Int32Array = require( '@stdlib/array/int32' ); +var Complex128Array = require( '@stdlib/array/complex128' ); + +var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +var IPIV = new Int32Array( [ 2, 0, 1 ] ); + +zlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, 1 ); +// A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] +``` + +The function has the following parameters: + +- **order**: storage layout. +- **N**: number of columns in `A`. +- **A**: input matrix stored in linear memory as a [`Complex128Array`][complex128array]. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **k1**: index of first row to interchange when `incx` is positive and the index of the last row to interchange when `incx` is negative. +- **k2**: index of last row to interchange when `incx` is positive and the index of the first row to interchange when `incx` is negative. +- **IPIV**: vector of pivot indices as an [`Int32Array`][mdn-int32array]. Must contain at least `k1+(k2-k1)*abs(incx)` elements. Only the elements in positions `k1` through `k1+(k2-k1)*abs(incx)` are accessed. +- **incx**: increment between successive values of `IPIV`. Elements from `IPIV` are accessed according to `IPIV[k1+(k-k1)*abs(incx)] = j`, thus implying that rows `k` and `j` should be interchanged. If `incx` is negative, the pivots are applied in reverse order. + +The sign of the increment parameter `incx` determines the order in which pivots are applied. For example, to apply pivots in reverse order, + +```javascript +var Int32Array = require( '@stdlib/array/int32' ); +var Complex128Array = require( '@stdlib/array/complex128' ); + +var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +var IPIV = new Int32Array( [ 2, 0, 1 ] ); + +zlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, -1 ); +// A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] +``` + +To perform strided access over `IPIV`, provide an `abs(incx)` value greater than one. For example, to access every other element in `IPIV`, + +```javascript +var Int32Array = require( '@stdlib/array/int32' ); +var Complex128Array = require( '@stdlib/array/complex128' ); + +var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +var IPIV = new Int32Array( [ 2, 999, 0, 999, 1 ] ); + +zlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, 2 ); +// A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Int32Array = require( '@stdlib/array/int32' ); +var Complex128Array = require( '@stdlib/array/complex128' ); + +// Initial arrays... +var A0 = new Complex128Array( [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +var IPIV0 = new Int32Array( [ 0, 2, 0, 1 ] ); + +// Create offset views... +var A1 = new Complex128Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var IPIV1 = new Int32Array( IPIV0.buffer, IPIV0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +zlaswp( 'row-major', 2, A1, 2, 0, 2, IPIV1, 1 ); +// A0 => [ 0.0, 0.0, 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] +``` + +#### zlaswp.ndarray( N, A, sa1, sa2, oa, k1, k2, inck, IPIV, si, oi ) + +Performs a series of row interchanges on the matrix `A` using pivot indices stored in `IPIV` and alternative indexing semantics. + +```javascript +var Int32Array = require( '@stdlib/array/int32' ); +var Complex128Array = require( '@stdlib/array/complex128' ); + +var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +var IPIV = new Int32Array( [ 2, 0, 1 ] ); + +zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); +// A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] +``` + +The function has the following additional parameters: + +- **N**: number of columns in `A`. +- **A**: input matrix stored in linear memory as a [`Complex128Array`][complex128array]. +- **sa1**: stride of the first dimension of `A`. +- **sa2**: stride of the second dimension of `A`. +- **oa**: starting index for `A`. +- **k1**: index of first row to interchange when `inck` is positive and the index of the last row to interchange when `inck` is negative. +- **k2**: index of last row to interchange when `inck` is positive and the index of the first row to interchange when `inck` is negative. +- **inck**: direction in which to apply pivots (-1 to apply pivots in reverse order; otherwise, apply in provided order). +- **IPIV**: vector of pivot indices as an [`Int32Array`][mdn-int32array]. +- **si**: index increment for `IPIV`. +- **oi**: starting index for `IPIV`. + +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 Int32Array = require( '@stdlib/array/int32' ); +var Complex128Array = require( '@stdlib/array/complex128' ); + +var A = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +var IPIV = new Int32Array( [ 0, 0, 2, 0, 1 ] ); + +zlaswp.ndarray( 2, A, 2, 1, 2, 0, 2, 1, IPIV, 1, 2 ); +// A => [ 0.0, 0.0, 0.0, 0.0, 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] +``` + +
+ + + +
+ +## Notes + +- Both functions access `k2-k1+1` elements from `IPIV`. +- While `zlaswp` conflates the order in which pivots are applied with the order in which elements in `IPIV` are accessed, the `ndarray` method delineates control of those behaviors with separate parameters `inck` and `si`. +- `zlaswp()` corresponds to the [LAPACK][LAPACK] level 1 function [`zlaswp`][lapack-zlaswp]. + +
+ + + +
+ +## Examples + + + +```javascript +var Complex128Array = require( '@stdlib/array/complex128' ); +var Int32Array = require( '@stdlib/array/int32' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var zlaswp = require( '@stdlib/lapack/base/zlaswp' ); + +// Specify matrix meta data: +var shape = [ 4, 2 ]; +var strides = [ 1, 4 ]; +var offset = 0; +var order = 'column-major'; + +// Create a matrix stored in linear memory: +var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] ); // eslint-disable-line max-len +console.log( ndarray2array( A, shape, strides, offset, order ) ); + +// Define a vector of pivot indices: +var IPIV = new Int32Array( [ 2, 0, 3, 1 ] ); + +// Interchange rows: +zlaswp( order, shape[ 1 ], A, strides[ 1 ], 0, shape[ 0 ]-1, IPIV, 1 ); +console.log( ndarray2array( A, shape, strides, offset, order ) ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + From ff9de5b8decaee9f184f1ee08808491a4e82698b Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Fri, 28 Feb 2025 16:41:19 +0000 Subject: [PATCH 09/22] chore: code review --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/lapack/base/zlaswp/docs/types/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/index.d.ts index 8656ab9a127d..373873e94425 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/index.d.ts @@ -114,7 +114,6 @@ interface Routine { * * zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); * // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] -* // A => [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0 ] */ declare var zlaswp: Routine; From baa1fbc2d695aa74eb6c7052d035351281448f4a Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Fri, 28 Feb 2025 16:51:18 +0000 Subject: [PATCH 10/22] chore: resolve max-len CI failure in repl.txt --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/lapack/base/zlaswp/docs/repl.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt index 6cfbee4a5eab..88e318e0c2fd 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt @@ -46,17 +46,17 @@ > var IPIV = new {{alias:@stdlib/array/int32}}( [ 1, 0 ] ); > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); > var ord = 'row-major'; - > {{alias}}( ord, 2, A, 2, 0, 1, IPIV, 1 ) - [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] + > {{alias}}( ord, 2, A, 2, 0, 0, IPIV, 1 ) + [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] // Using typed array views: > var IPIV0 = new {{alias:@stdlib/array/int32}}( [ 0, 1, 0 ] ); - > var A0 = new {{alias:@stdlib/array/complex128}}( [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + > var A0 = new {{alias:@stdlib/array/complex128}}( [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0 ] ); > IPIV = new Int32Array( IPIV0.buffer, IPIV0.BYTES_PER_ELEMENT*1 ); > A = new Complex128Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); - > {{alias}}( ord, 2, A, 2, 0, 1, IPIV, 1 ); + > {{alias}}( ord, 1, A, 1, 0, 0, IPIV, 1 ); > A0 - [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] + [ 0.0, 0.0, 3.0, 4.0, 1.0, 2.0 ] {{alias}}.ndarray( N, A, sa1, sa2, oa, k1, k2, inck, IPIV, si, oi ) @@ -110,10 +110,10 @@ Examples -------- - > var IPIV = new {{alias:@stdlib/array/int32}}( [ 2, 0, 1 ] ); - > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); - > {{alias}}.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ) - [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] + > var IPIV = new {{alias:@stdlib/array/int32}}( [ 1, 0 ] ); + > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + > {{alias}}.ndarray( 2, A, 2, 1, 0, 0, 0, 1, IPIV, 1, 0 ) + [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] See Also -------- From 0ccafd65b5fd31d82ca8935fea24565332282404 Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Fri, 28 Feb 2025 18:51:10 +0000 Subject: [PATCH 11/22] fix: copy and paste errors --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../zlaswp/benchmark/benchmark.ndarray.js | 4 +- .../@stdlib/lapack/base/zlaswp/package.json | 2 +- .../lapack/base/zlaswp/test/test.ndarray.js | 50 +++++++++---------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.ndarray.js index d27e9ce0a19b..5017b7957c50 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.ndarray.js @@ -28,7 +28,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var floor = require( '@stdlib/math/base/special/floor' ); var pkg = require( './../package.json' ).name; -var dlaswp = require( './../lib/ndarray.js' ); +var zlaswp = require( './../lib/ndarray.js' ); // VARIABLES // @@ -85,7 +85,7 @@ function createBenchmark( order, N, nrows ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - z = dlaswp( N, A, sa1, sa2, 0, 0, nrows-1, 1, IPIV, 1, 0 ); + z = zlaswp( N, A, sa1, sa2, 0, 0, nrows-1, 1, IPIV, 1, 0 ); if ( isnan( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/package.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/package.json index e3e2609ca24c..76ccbe69819b 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/package.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/package.json @@ -54,7 +54,7 @@ "mathematics", "math", "lapack", - "dlaswp", + "zlaswp", "interchange", "swap", "exchange", diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js index f2c6bfd8e423..af71420b3187 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js @@ -31,7 +31,7 @@ var reverse = require( '@stdlib/array/base/reverse' ); var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); var numel = require( '@stdlib/ndarray/base/numel' ); var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); -var dlaswp = require( './../lib/ndarray.js' ); +var zlaswp = require( './../lib/ndarray.js' ); // FIXTURES // @@ -63,12 +63,12 @@ var ROW_MAJOR_K1 = require( './fixtures/row_major_k1.json' ); tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); - t.strictEqual( typeof dlaswp, 'function', 'main export is a function' ); + t.strictEqual( typeof zlaswp, 'function', 'main export is a function' ); t.end(); }); tape( 'the function has an arity of 11', function test( t ) { - t.strictEqual( dlaswp.length, 11, 'returns expected value' ); + t.strictEqual( zlaswp.length, 11, 'returns expected value' ); t.end(); }); @@ -86,7 +86,7 @@ tape( 'the function performs a series of row interchanges (column-major)', funct expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -107,7 +107,7 @@ tape( 'the function performs a series of row interchanges (column-major, k1 > 0) expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -128,7 +128,7 @@ tape( 'the function supports applying pivots in reverse order (column-major)', f expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -149,7 +149,7 @@ tape( 'the function supports an `IPIV` stride (column-major)', function test( t expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -170,7 +170,7 @@ tape( 'the function supports an `IPIV` stride (reverse pivots, column-major)', f expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -191,7 +191,7 @@ tape( 'the function supports an `IPIV` offset (column-major)', function test( t expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -212,7 +212,7 @@ tape( 'the function supports an `IPIV` offset (reverse pivots, column-major)', f expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -233,7 +233,7 @@ tape( 'the function supports `A` strides (column-major)', function test( t ) { expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -254,7 +254,7 @@ tape( 'the function supports an `A` offset (column-major)', function test( t ) { expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -275,7 +275,7 @@ tape( 'the function supports complex access patterns (column-major)', function t expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -316,7 +316,7 @@ tape( 'the function efficiently handles large datasets (column-major)', function expected = new Complex128Array( flatten( expected, sh, true ) ); // Interchange rows: - out = dlaswp( sh[1], A, st[0], st[1], o, 3, 4, 1, IPIV, 1, 0 ); + out = zlaswp( sh[1], A, st[0], st[1], o, 3, 4, 1, IPIV, 1, 0 ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -338,7 +338,7 @@ tape( 'the function performs a series of row interchanges (row-major)', function expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -359,7 +359,7 @@ tape( 'the function performs a series of row interchanges (row-major, k1 > 0)', expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -380,7 +380,7 @@ tape( 'the function supports applying pivots in reverse order (row-major)', func expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -401,7 +401,7 @@ tape( 'the function supports an `IPIV` stride (row-major)', function test( t ) { expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -422,7 +422,7 @@ tape( 'the function supports an `IPIV` stride (reverse pivots, row-major)', func expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -443,7 +443,7 @@ tape( 'the function supports an `IPIV` offset (row-major)', function test( t ) { expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -464,7 +464,7 @@ tape( 'the function supports an `IPIV` offset (reverse pivots, row-major)', func expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -485,7 +485,7 @@ tape( 'the function supports `A` strides (row-major)', function test( t ) { expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -506,7 +506,7 @@ tape( 'the function supports an `A` offset (row-major)', function test( t ) { expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -527,7 +527,7 @@ tape( 'the function supports complex access patterns (row-major)', function test expected = new Complex128Array( data.A_out ); - out = dlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); + out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -568,7 +568,7 @@ tape( 'the function efficiently handles large datasets (row-major)', function te expected = new Complex128Array( flatten( expected, sh, false ) ); // Interchange rows: - out = dlaswp( sh[1], A, st[0], st[1], o, 3, 4, 1, IPIV, 1, 0 ); + out = zlaswp( sh[1], A, st[0], st[1], o, 3, 4, 1, IPIV, 1, 0 ); t.strictEqual( out, A, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); From df13f5f06caf27a0dc0c526978cb22382deb7515 Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Sat, 1 Mar 2025 20:52:01 +0000 Subject: [PATCH 12/22] test: add test.ts --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../lapack/base/zlaswp/docs/types/test.ts | 359 ++++++++++++++++++ 1 file changed, 359 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/test.ts diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/test.ts b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/test.ts new file mode 100644 index 000000000000..44ee410b288c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/test.ts @@ -0,0 +1,359 @@ +/* +* @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 Complex128Array = require( '@stdlib/array/complex128' ); +import zlaswp = require( './index' ); + + +// TESTS // + +// The function returns a Complex128Array... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectType Complex128Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp( 5, 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( true, 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( false, 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( null, 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( void 0, 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( [], 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( {}, 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( ( x: number ): number => x, 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp( 'column-major', '5', A, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', true, A, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', false, A, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', null, A, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', void 0, A, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', [], A, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', {}, A, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', ( x: number ): number => x, A, 2, 0, 2, IPIV, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a Complex128Array... +{ + const IPIV = new Int32Array( 3 ); + + zlaswp( 'column-major', 3, '5', 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, 5, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, true, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, false, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, null, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, void 0, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, [], 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, {}, 2, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, ( x: number ): number => x, 2, 0, 2, IPIV, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp( 'column-major', 3, A, '5', 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, true, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, false, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, null, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, void 0, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, [], 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, {}, 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, ( x: number ): number => x, 0, 2, IPIV, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp( 'column-major', 3, A, 2, '5', 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, true, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, false, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, null, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, void 0, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, [], 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, {}, 2, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, ( x: number ): number => x, 2, IPIV, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp( 'column-major', 3, A, 2, 0, '5', IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, true, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, false, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, null, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, void 0, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, [], IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, {}, IPIV, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, ( x: number ): number => x, IPIV, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not an Int32Array... +{ + const A = new Complex128Array( 6 ); + + zlaswp( 'column-major', 3, A, 2, 0, 2, '5', 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, 5, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, true, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, false, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, null, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, void 0, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, [], 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, {}, 1 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a number... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, '5' ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, true ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, false ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, null ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, void 0 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, [] ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, {} ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp(); // $ExpectError + zlaswp( 'column-major' ); // $ExpectError + zlaswp( 'column-major', 3 ); // $ExpectError + zlaswp( 'column-major', 3, A ); // $ExpectError + zlaswp( 'column-major', 3, A, 2 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2 ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, IPIV ); // $ExpectError + zlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, 1, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Complex128Array... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectType Complex128Array +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp.ndarray( '5', A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( true, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( false, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( null, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( void 0, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( [], A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( {}, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( ( x: number ): number => x, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a Complex128Array... +{ + const IPIV = new Int32Array( 3 ); + + zlaswp.ndarray( 2, '5', 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, 5, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, true, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, false, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, null, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, void 0, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, [], 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, {}, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, ( x: number ): number => x, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp.ndarray( 2, A, '5', 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, true, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, false, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, null, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, void 0, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, [], 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, {}, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, ( x: number ): number => x, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp.ndarray( 2, A, 2, '5', 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, true, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, false, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, null, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, void 0, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, [], 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, {}, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, ( x: number ): number => x, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp.ndarray( 2, A, 2, 1, '5', 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, true, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, false, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, null, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, void 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, [], 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, {}, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, ( x: number ): number => x, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp.ndarray( 2, A, 2, 1, 0, '5', 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, true, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, false, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, null, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, void 0, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, [], 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, {}, 2, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, ( x: number ): number => x, 2, 1, IPIV, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp.ndarray( 2, A, 2, 1, 0, 0, '5', 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, true, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, false, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, null, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, void 0, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, [], 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, {}, 1, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, ( x: number ): number => x, 1, IPIV, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a number... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, '5', IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, true, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, false, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, null, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, void 0, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, [], IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, {}, IPIV, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, ( x: number ): number => x, IPIV, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not an Int32Array... +{ + const A = new Complex128Array( 6 ); + + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, '5', 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, 5, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, true, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, false, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, null, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, void 0, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, [], 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, {}, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a number... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, '5', 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, true, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, false, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, null, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, void 0, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, [], 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, {}, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eleventh argument which is not a number... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, '5' ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, true ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, false ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, null ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, void 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, [] ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, {} ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const IPIV = new Int32Array( 3 ); + const A = new Complex128Array( 6 ); + + zlaswp.ndarray(); // $ExpectError + zlaswp.ndarray( 2 ); // $ExpectError + zlaswp.ndarray( 2, A ); // $ExpectError + zlaswp.ndarray( 2, A, 2 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1 ); // $ExpectError + zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0, 10 ); // $ExpectError +} From bc5f98ccb5f24bd936570bbe6a9f10ecda48822b Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Sat, 1 Mar 2025 20:55:35 +0000 Subject: [PATCH 13/22] chore: update copyright years --- lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/test.ts b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/test.ts index 44ee410b288c..9ac1546d2cab 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/test.ts +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/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. From a73298d13091997c73b6c6cacf26d55a6cabe44c Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Fri, 14 Mar 2025 16:33:55 -0700 Subject: [PATCH 14/22] chore: clean-up and use correct assertions --- 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: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/lapack/base/zlaswp/README.md | 12 ++--- .../lapack/base/zlaswp/benchmark/benchmark.js | 12 ++--- .../zlaswp/benchmark/benchmark.ndarray.js | 12 ++--- .../@stdlib/lapack/base/zlaswp/docs/repl.txt | 6 +-- .../@stdlib/lapack/base/zlaswp/lib/base.js | 8 ++-- .../@stdlib/lapack/base/zlaswp/lib/index.js | 19 ++++++-- .../@stdlib/lapack/base/zlaswp/lib/ndarray.js | 8 ++-- .../@stdlib/lapack/base/zlaswp/lib/zlaswp.js | 8 ++-- .../@stdlib/lapack/base/zlaswp/package.json | 5 ++- .../test/fixtures/column_major_a_offset.json | 12 ++++- .../lapack/base/zlaswp/test/test.ndarray.js | 45 ++++++++++--------- .../lapack/base/zlaswp/test/test.zlaswp.js | 33 +++++++------- 12 files changed, 105 insertions(+), 75 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/README.md b/lib/node_modules/@stdlib/lapack/base/zlaswp/README.md index fa06c147c95d..aabcd228b90f 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/README.md +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/README.md @@ -51,11 +51,11 @@ The function has the following parameters: - **order**: storage layout. - **N**: number of columns in `A`. -- **A**: input matrix stored in linear memory as a [`Complex128Array`][complex128array]. +- **A**: input matrix stored in linear memory as a [`Complex128Array`][@stdlib/array/complex128]. - **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). - **k1**: index of first row to interchange when `incx` is positive and the index of the last row to interchange when `incx` is negative. - **k2**: index of last row to interchange when `incx` is positive and the index of the first row to interchange when `incx` is negative. -- **IPIV**: vector of pivot indices as an [`Int32Array`][mdn-int32array]. Must contain at least `k1+(k2-k1)*abs(incx)` elements. Only the elements in positions `k1` through `k1+(k2-k1)*abs(incx)` are accessed. +- **IPIV**: vector of pivot indices as an [`Int32Array`][@stdlib/array/int32]. Must contain at least `k1+(k2-k1)*abs(incx)` elements. Only the elements in positions `k1` through `k1+(k2-k1)*abs(incx)` are accessed. - **incx**: increment between successive values of `IPIV`. Elements from `IPIV` are accessed according to `IPIV[k1+(k-k1)*abs(incx)] = j`, thus implying that rows `k` and `j` should be interchanged. If `incx` is negative, the pivots are applied in reverse order. The sign of the increment parameter `incx` determines the order in which pivots are applied. For example, to apply pivots in reverse order, @@ -122,14 +122,14 @@ zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); The function has the following additional parameters: - **N**: number of columns in `A`. -- **A**: input matrix stored in linear memory as a [`Complex128Array`][complex128array]. +- **A**: input matrix stored in linear memory as a [`Complex128Array`][@stdlib/array/complex128]. - **sa1**: stride of the first dimension of `A`. - **sa2**: stride of the second dimension of `A`. - **oa**: starting index for `A`. - **k1**: index of first row to interchange when `inck` is positive and the index of the last row to interchange when `inck` is negative. - **k2**: index of last row to interchange when `inck` is positive and the index of the first row to interchange when `inck` is negative. - **inck**: direction in which to apply pivots (-1 to apply pivots in reverse order; otherwise, apply in provided order). -- **IPIV**: vector of pivot indices as an [`Int32Array`][mdn-int32array]. +- **IPIV**: vector of pivot indices as an [`Int32Array`][@stdlib/array/int32]. - **si**: index increment for `IPIV`. - **oi**: starting index for `IPIV`. @@ -284,9 +284,9 @@ TODO [lapack-zlaswp]: https://www.netlib.org/lapack/explore-html/d1/d7e/group__laswp_ga6c7f83bff7887543bcb6c019e06e131d.html -[complex128array]: https://github.com/stdlib-js/stdlib/blob/develop/lib/node_modules/%40stdlib/array/complex128/README.md +[@stdlib/array/complex128]: https://github.com/stdlib-js/stdlib/blob/develop/lib/node_modules/%40stdlib/array/complex128 -[mdn-int32array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array +[@stdlib/array/int32]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/int32 [mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.js index 79d65febe3e7..79caa6f779d4 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.js @@ -55,12 +55,15 @@ var opts = { */ function createBenchmark( order, N, nrows ) { var IPIV; + var abuf; var A; IPIV = discreteUniform( nrows, 0, N-1, { 'dtype': 'int32' }); - A = new Complex128Array( uniform( 2*N*N, -10.0, 10.0, opts ) ); + + abuf = uniform( 2*N*N, -10.0, 10.0, opts ); + A = new Complex128Array( abuf ); return benchmark; @@ -71,18 +74,17 @@ function createBenchmark( order, N, nrows ) { * @param {Benchmark} b - benchmark instance */ function benchmark( b ) { - var z; var i; b.tic(); for ( i = 0; i < b.iterations; i++ ) { - z = zlaswp( order, N, A, N, 0, nrows-1, IPIV, 1 ); - if ( isnan( z[ i%z.length ] ) ) { + zlaswp( order, N, A, N, 0, nrows-1, IPIV, 1 ); + if ( isnan( abuf[ i%abuf.length ] ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnan( z[ i%z.length ] ) ) { + if ( isnan( abuf[ i%abuf.length ] ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.ndarray.js index 5017b7957c50..192e6c1af6ad 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/benchmark/benchmark.ndarray.js @@ -55,6 +55,7 @@ var opts = { */ function createBenchmark( order, N, nrows ) { var IPIV; + var abuf; var sa1; var sa2; var A; @@ -69,7 +70,9 @@ function createBenchmark( order, N, nrows ) { IPIV = discreteUniform( nrows, 0, N-1, { 'dtype': 'int32' }); - A = new Complex128Array( uniform( 2*N*N, -10.0, 10.0, opts ) ); + + abuf = uniform( 2*N*N, -10.0, 10.0, opts ); + A = new Complex128Array( abuf ); return benchmark; @@ -80,18 +83,17 @@ function createBenchmark( order, N, nrows ) { * @param {Benchmark} b - benchmark instance */ function benchmark( b ) { - var z; var i; b.tic(); for ( i = 0; i < b.iterations; i++ ) { - z = zlaswp( N, A, sa1, sa2, 0, 0, nrows-1, 1, IPIV, 1, 0 ); - if ( isnan( z[ i%z.length ] ) ) { + zlaswp( N, A, sa1, sa2, 0, 0, nrows-1, 1, IPIV, 1, 0 ); + if ( isnan( abuf[ i%abuf.length ] ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnan( z[ i%z.length ] ) ) { + if ( isnan( abuf[ i%abuf.length ] ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt index 88e318e0c2fd..290df329a6b8 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt @@ -43,14 +43,14 @@ Examples -------- - > var IPIV = new {{alias:@stdlib/array/int32}}( [ 1, 0 ] ); + > var IPIV = new {{alias:@stdlib/array/int32}}( [ 1 ] ); > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); > var ord = 'row-major'; > {{alias}}( ord, 2, A, 2, 0, 0, IPIV, 1 ) [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] // Using typed array views: - > var IPIV0 = new {{alias:@stdlib/array/int32}}( [ 0, 1, 0 ] ); + > var IPIV0 = new {{alias:@stdlib/array/int32}}( [ 0, 1 ] ); > var A0 = new {{alias:@stdlib/array/complex128}}( [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0 ] ); > IPIV = new Int32Array( IPIV0.buffer, IPIV0.BYTES_PER_ELEMENT*1 ); > A = new Complex128Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); @@ -110,7 +110,7 @@ Examples -------- - > var IPIV = new {{alias:@stdlib/array/int32}}( [ 1, 0 ] ); + > var IPIV = new {{alias:@stdlib/array/int32}}( [ 1 ] ); > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); > {{alias}}.ndarray( 2, A, 2, 1, 0, 0, 0, 1, IPIV, 1, 0 ) [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/base.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/base.js index 5010442b9862..f7950d28552a 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/base.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/base.js @@ -54,11 +54,11 @@ var BLOCK_SIZE = 32; * var Int32Array = require( '@stdlib/array/int32' ); * var Complex128Array = require( '@stdlib/array/complex128' ); * -* var IPIV = new Int32Array( [ 1, 0 ] ); -* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ) +* var IPIV = new Int32Array( [ 2, 0, 1 ] ); +* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); * -* zlaswp( 2, A, 2, 1, 0, 0, 0, 1, IPIV, 1, 0 ); -* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] +* zlaswp( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); +* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] */ function zlaswp( N, A, strideA1, strideA2, offsetA, k1, k2, inck, IPIV, strideIPIV, offsetIPIV ) { // eslint-disable-line max-len, max-params var nrows; diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/index.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/index.js index 1451e6596ade..fdedfc53e905 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/index.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/index.js @@ -28,11 +28,22 @@ * var Complex128Array = require( '@stdlib/array/complex128' ); * var zlaswp = require( '@stdlib/lapack/base/zlaswp' ); * -* var IPIV = new Int32Array( [ 1, 0 ] ); -* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ) +* var IPIV = new Int32Array( [ 2, 0, 1 ] ); +* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); * -* zlaswp( 2, A, 2, 1, 0, 0, 0, 1, IPIV, 1, 0 ); -* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] +* zlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, 1 ); +* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] +* +* @example +* var Int32Array = require( '@stdlib/array/int32' ); +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var zlaswp = require( '@stdlib/lapack/base/zlaswp' ); +* +* var IPIV = new Int32Array( [ 2, 0, 1 ] ); +* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +* +* zlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); +* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] */ // MODULES // diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/ndarray.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/ndarray.js index fb7c15aaab13..ba712704ae18 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/ndarray.js @@ -45,11 +45,11 @@ var base = require( './base.js' ); * var Int32Array = require( '@stdlib/array/int32' ); * var Complex128Array = require( '@stdlib/array/complex128' ); * -* var IPIV = new Int32Array( [ 1, 0 ] ); -* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ) +* var IPIV = new Int32Array( [ 2, 0, 1 ] ); +* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); * -* zlaswp( 2, A, 2, 1, 0, 0, 0, 1, IPIV, 1, 0 ); -* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] +* zlaswp( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); +* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] */ function zlaswp( N, A, strideA1, strideA2, offsetA, k1, k2, inck, IPIV, strideIPIV, offsetIPIV ) { // eslint-disable-line max-len, max-params var tmp; diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/zlaswp.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/zlaswp.js index 02f18f9f286a..8fca18214f29 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/zlaswp.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/lib/zlaswp.js @@ -47,11 +47,11 @@ var base = require( './base.js' ); * var Int32Array = require( '@stdlib/array/int32' ); * var Complex128Array = require( '@stdlib/array/complex128' ); * -* var IPIV = new Int32Array( [ 1, 0 ] ); -* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +* var IPIV = new Int32Array( [ 2, 0, 1 ] ); +* var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); * -* zlaswp( 'row-major', 2, A, 2, 0, 0, IPIV, 1 ); -* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] +* zlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, 1 ); +* // A => [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] */ function zlaswp( order, N, A, LDA, k1, k2, IPIV, incx ) { var tmp; diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/package.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/package.json index 76ccbe69819b..54f98903c33e 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/package.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/package.json @@ -67,6 +67,9 @@ "ndarray", "float64", "double", - "float64array" + "complex128array", + "complex128", + "complex", + "cmplx" ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_offset.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_offset.json index 0e41852c0261..305d8b7773a0 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_offset.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_offset.json @@ -1,6 +1,11 @@ { "order": "column-major", + "A_mat": [ + [ 1.0, 2.0, 7.0, 8.0 ], + [ 3.0, 4.0, 9.0, 10.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ], "N": 2, "LDA": 3, "strideA1": 1, @@ -22,5 +27,10 @@ [ 2, 1 ] ], - "A_out": [ 9999.0, 9999.0, 2.0, 1.0, 3.0, 5.0, 4.0, 6.0, 9999.0, 9999.0 ] + "A_out_mat": [ + [ 3.0, 4.0, 9.0, 10.0 ], + [ 1.0, 2.0, 7.0, 8.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ], + "A_out": [ 9999.0, 9999.0, 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0, 9999.0, 9999.0 ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js index af71420b3187..1ad7a7e9c66f 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js @@ -23,6 +23,7 @@ // MODULES // var tape = require( 'tape' ); +var isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' ); var Int32Array = require( '@stdlib/array/int32' ); var Complex128Array = require( '@stdlib/array/complex128' ); var oneTo = require( '@stdlib/array/one-to' ); @@ -88,7 +89,7 @@ tape( 'the function performs a series of row interchanges (column-major)', funct out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -109,7 +110,7 @@ tape( 'the function performs a series of row interchanges (column-major, k1 > 0) out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -130,7 +131,7 @@ tape( 'the function supports applying pivots in reverse order (column-major)', f out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -151,7 +152,7 @@ tape( 'the function supports an `IPIV` stride (column-major)', function test( t out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -172,7 +173,7 @@ tape( 'the function supports an `IPIV` stride (reverse pivots, column-major)', f out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -193,7 +194,7 @@ tape( 'the function supports an `IPIV` offset (column-major)', function test( t out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -214,7 +215,7 @@ tape( 'the function supports an `IPIV` offset (reverse pivots, column-major)', f out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -235,7 +236,7 @@ tape( 'the function supports `A` strides (column-major)', function test( t ) { out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -256,7 +257,7 @@ tape( 'the function supports an `A` offset (column-major)', function test( t ) { out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -277,7 +278,7 @@ tape( 'the function supports complex access patterns (column-major)', function t out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -319,7 +320,7 @@ tape( 'the function efficiently handles large datasets (column-major)', function out = zlaswp( sh[1], A, st[0], st[1], o, 3, 4, 1, IPIV, 1, 0 ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -340,7 +341,7 @@ tape( 'the function performs a series of row interchanges (row-major)', function out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -361,7 +362,7 @@ tape( 'the function performs a series of row interchanges (row-major, k1 > 0)', out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -382,7 +383,7 @@ tape( 'the function supports applying pivots in reverse order (row-major)', func out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -403,7 +404,7 @@ tape( 'the function supports an `IPIV` stride (row-major)', function test( t ) { out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -424,7 +425,7 @@ tape( 'the function supports an `IPIV` stride (reverse pivots, row-major)', func out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -445,7 +446,7 @@ tape( 'the function supports an `IPIV` offset (row-major)', function test( t ) { out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -466,7 +467,7 @@ tape( 'the function supports an `IPIV` offset (reverse pivots, row-major)', func out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -487,7 +488,7 @@ tape( 'the function supports `A` strides (row-major)', function test( t ) { out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -508,7 +509,7 @@ tape( 'the function supports an `A` offset (row-major)', function test( t ) { out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -529,7 +530,7 @@ tape( 'the function supports complex access patterns (row-major)', function test out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -571,7 +572,7 @@ tape( 'the function efficiently handles large datasets (row-major)', function te out = zlaswp( sh[1], A, st[0], st[1], o, 3, 4, 1, IPIV, 1, 0 ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js index f76509016ae9..0b432c18d46e 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js @@ -23,6 +23,7 @@ // MODULES // var tape = require( 'tape' ); +var isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' ); var Int32Array = require( '@stdlib/array/int32' ); var Complex128Array = require( '@stdlib/array/complex128' ); var oneTo = require( '@stdlib/array/one-to' ); @@ -139,7 +140,7 @@ tape( 'the function performs a series of row interchanges (column-major)', funct out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -160,7 +161,7 @@ tape( 'the function performs a series of row interchanges (column-major, k1 > 0) out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -181,7 +182,7 @@ tape( 'the function supports applying pivots in reverse order (column-major)', f out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -202,7 +203,7 @@ tape( 'the function supports specifying an `LDA` parameter for operating on sub- out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -223,7 +224,7 @@ tape( 'the function supports specifying a positive increment between successive out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -244,7 +245,7 @@ tape( 'the function supports specifying a negative increment between successive out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -265,7 +266,7 @@ tape( 'if provided an increment between successive values of `IPIV` equal to `0` out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, 0 ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -307,7 +308,7 @@ tape( 'the function efficiently handles large datasets (column-major)', function out = zlaswp( ord, sh[1], A, sh[0], 3, 4, IPIV, 1 ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -328,7 +329,7 @@ tape( 'the function performs a series of row interchanges (row-major)', function out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -349,7 +350,7 @@ tape( 'the function performs a series of row interchanges (row-major, k1 > 0)', out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -370,7 +371,7 @@ tape( 'the function supports applying pivots in reverse order (row-major)', func out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -391,7 +392,7 @@ tape( 'the function supports specifying an `LDA` parameter for operating on sub- out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -412,7 +413,7 @@ tape( 'the function supports specifying a positive increment between successive out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -433,7 +434,7 @@ tape( 'the function supports specifying a negative increment between successive out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -454,7 +455,7 @@ tape( 'if provided an increment between successive values of `IPIV` equal to `0` out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, 0 ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); @@ -496,7 +497,7 @@ tape( 'the function efficiently handles large datasets (row-major)', function te out = zlaswp( ord, sh[1], A, sh[1], 3, 4, IPIV, 1 ); t.strictEqual( out, A, 'returns expected value' ); - t.deepEqual( out, expected, 'returns expected value' ); + t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); t.end(); }); From 8dc40a3cf7379b4b6ef78f2f014f847ff9232a0e Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Sun, 16 Mar 2025 10:46:29 +0000 Subject: [PATCH 15/22] fix: resolve conflicts --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../test/fixtures/column_major_a_offset.json | 20 ++++---- .../test/fixtures/column_major_a_strides.json | 13 +++++ .../column_major_complex_access_patterns.json | 16 +++++- .../fixtures/column_major_ipiv_offset.json | 14 +++++- .../column_major_ipiv_stride_negative.json | 14 +++++- .../column_major_ipiv_stride_positive.json | 14 +++++- .../zlaswp/test/fixtures/column_major_k1.json | 20 +++++++- .../test/fixtures/column_major_lda.json | 16 +++++- .../fixtures/column_major_no_offsets.json | 18 +++++-- .../fixtures/column_major_reverse_pivots.json | 14 +++++- ...lumn_major_reverse_pivots_ipiv_offset.json | 14 +++++- ...lumn_major_reverse_pivots_ipiv_stride.json | 14 +++++- .../test/fixtures/row_major_a_offset.json | 18 +++++-- .../test/fixtures/row_major_a_strides.json | 12 +++++ .../row_major_complex_access_patterns.json | 46 +++++++---------- .../test/fixtures/row_major_ipiv_offset.json | 14 +++++- .../row_major_ipiv_stride_negative.json | 14 +++++- .../row_major_ipiv_stride_positive.json | 14 +++++- .../zlaswp/test/fixtures/row_major_k1.json | 20 +++++++- .../zlaswp/test/fixtures/row_major_lda.json | 11 ++++ .../test/fixtures/row_major_no_offsets.json | 13 ++++- .../fixtures/row_major_reverse_pivots.json | 14 +++++- .../row_major_reverse_pivots_ipiv_offset.json | 13 ++++- .../row_major_reverse_pivots_ipiv_stride.json | 14 +++++- .../lapack/base/zlaswp/test/test.ndarray.js | 50 +++++++++---------- .../lapack/base/zlaswp/test/test.zlaswp.js | 32 ++++++------ 26 files changed, 368 insertions(+), 104 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_offset.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_offset.json index 305d8b7773a0..9f419ce60ba0 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_offset.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_offset.json @@ -1,11 +1,6 @@ { "order": "column-major", - "A_mat": [ - [ 1.0, 2.0, 7.0, 8.0 ], - [ 3.0, 4.0, 9.0, 10.0 ], - [ 5.0, 6.0, 11.0, 12.0 ] - ], "N": 2, "LDA": 3, "strideA1": 1, @@ -13,6 +8,12 @@ "offsetA": 1, "A": [ 9999.0, 9999.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 9999.0, 9999.0 ], + "A_mat": [ + [ 1.0, 2.0, 7.0, 8.0 ], + [ 3.0, 4.0, 9.0, 10.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": 1, @@ -27,10 +28,11 @@ [ 2, 1 ] ], + "A_out": [ 9999.0, 9999.0, 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0, 9999.0, 9999.0 ], + "A_out_mat": [ - [ 3.0, 4.0, 9.0, 10.0 ], - [ 1.0, 2.0, 7.0, 8.0 ], + [ 3.0, 4.0, 9.0, 10.0 ], + [ 1.0, 2.0, 7.0, 8.0 ], [ 5.0, 6.0, 11.0, 12.0 ] - ], - "A_out": [ 9999.0, 9999.0, 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0, 9999.0, 9999.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_strides.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_strides.json index 382733009c10..c3dc982b643d 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_strides.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_a_strides.json @@ -57,6 +57,13 @@ 9999.0 ], + "A_mat": [ + [ 1.0, 2.0, 7.0, 8.0 ], + [ 3.0, 4.0, 9.0, 10.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ], + + "k1": 0, "k2": 2, "incK": 1, @@ -120,5 +127,11 @@ 9999.0, 9999.0, 9999.0 + ], + + "A_out_mat": [ + [ 3.0, 4.0, 9.0, 10.0 ], + [ 1.0, 2.0, 7.0, 8.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_complex_access_patterns.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_complex_access_patterns.json index 4d968e4f6018..df3049ca93ac 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_complex_access_patterns.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_complex_access_patterns.json @@ -5,7 +5,7 @@ "LDA": null, "strideA1": -2, "strideA2": 12, - "offsetA": 6, + "offsetA": 5, "A": [ 9999.0, 9999.0, @@ -57,7 +57,13 @@ 9999.0, 9999.0, 9999.0 -], + ], + +"A_mat": [ + [ 1.0, 2.0, 7.0, 8.0 ], + [ 3.0, 4.0, 9.0, 10.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ], "k1": 0, "k2": 2, @@ -124,5 +130,11 @@ 9999.0, 9999.0, 9999.0 + ], + + "A_out_mat": [ + [ 3.0, 4.0, 9.0, 10.0 ], + [ 1.0, 2.0, 7.0, 8.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_offset.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_offset.json index b367db7f1c98..d203d968f3b2 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_offset.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_offset.json @@ -8,6 +8,12 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "A_mat": [ + [ 1.0, 2.0, 7.0, 8.0 ], + [ 3.0, 4.0, 9.0, 10.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": 1, @@ -22,5 +28,11 @@ [ 2, 1 ] ], - "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ] + "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ], + + "A_out_mat": [ + [ 3.0, 4.0, 9.0, 10.0 ], + [ 1.0, 2.0, 7.0, 8.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_negative.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_negative.json index 365b51aa05ae..aa69302b324a 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_negative.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_negative.json @@ -8,6 +8,12 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "A_mat": [ + [ 1.0, 2.0, 7.0, 8.0 ], + [ 3.0, 4.0, 9.0, 10.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": -1, @@ -22,5 +28,11 @@ [ 0, 2 ] ], - "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ] + "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ], + + "A_out_mat": [ + [ 3.0, 4.0, 9.0, 10.0 ], + [ 1.0, 2.0, 7.0, 8.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_positive.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_positive.json index 30d38ee5469a..344004cbab32 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_positive.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_ipiv_stride_positive.json @@ -8,6 +8,12 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "A_mat": [ + [ 1.0, 2.0, 7.0, 8.0 ], + [ 3.0, 4.0, 9.0, 10.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": 1, @@ -22,5 +28,11 @@ [ 2, 1 ] ], - "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ] + "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ], + + "A_out_mat": [ + [ 3.0, 4.0, 9.0, 10.0 ], + [ 1.0, 2.0, 7.0, 8.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_k1.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_k1.json index c9d47579d327..1f75e178b868 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_k1.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_k1.json @@ -8,6 +8,15 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0 ], + "A_mat": [ + [ 1.0, 2.0, 13.0, 14.0 ], + [ 3.0, 4.0, 15.0, 16.0 ], + [ 5.0, 6.0, 17.0, 18.0 ], + [ 7.0, 8.0, 19.0, 20.0 ], + [ 9.0, 10.0, 21.0, 22.0 ], + [ 11.0, 12.0, 23.0, 24.0 ] + ], + "k1": 3, "k2": 5, "incK": 1, @@ -22,5 +31,14 @@ [ 5, 0 ] ], - "A_out": [ 11.0, 12.0, 9.0, 10.0, 7.0, 8.0, 5.0, 6.0, 3.0, 4.0, 1.0, 2.0, 23.0, 24.0, 21.0, 22.0, 19.0, 20.0, 17.0, 18.0, 15.0, 16.0, 13.0, 14.0 ] + "A_out": [ 11.0, 12.0, 9.0, 10.0, 7.0, 8.0, 5.0, 6.0, 3.0, 4.0, 1.0, 2.0, 23.0, 24.0, 21.0, 22.0, 19.0, 20.0, 17.0, 18.0, 15.0, 16.0, 13.0, 14.0 ], + + "A_out_mat": [ + [ 11.0, 12.0, 23.0, 24.0 ], + [ 9.0, 10.0, 21.0, 22.0 ], + [ 7.0, 8.0, 19.0, 20.0 ], + [ 5.0, 6.0, 17.0, 18.0 ], + [ 3.0, 4.0, 15.0, 16.0 ], + [ 1.0, 2.0, 13.0, 14.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_lda.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_lda.json index 8ec9b6961394..78d641c87a17 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_lda.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_lda.json @@ -2,9 +2,9 @@ "order": "column-major", "N": 2, - "LDA": 12, + "LDA": 11, "strideA1": 1, - "strideA2": 12, + "strideA2": 11, "offsetA": 0, "A": [ 1.0, @@ -53,6 +53,12 @@ 9999.0 ], +"A_mat": [ + [ 1.0, 2.0, 7.0, 8.0 ], + [ 3.0, 4.0, 9.0, 10.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] +], + "k1": 0, "k2": 2, "incK": 1, @@ -112,5 +118,11 @@ 9999.0, 9999.0, 9999.0 + ], + + "A_out_mat": [ + [ 3.0, 4.0, 9.0, 10.0 ], + [ 1.0, 2.0, 7.0, 8.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_no_offsets.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_no_offsets.json index 011369accb03..542d93d59f87 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_no_offsets.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_no_offsets.json @@ -2,12 +2,18 @@ "order": "column-major", "N": 2, - "LDA": 2, + "LDA": 3, "strideA1": 1, - "strideA2": 2, + "strideA2": 3, "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "A_mat": [ + [ 1.0, 2.0, 7.0, 8.0 ], + [ 3.0, 4.0, 9.0, 10.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": 1, @@ -22,5 +28,11 @@ [ 2, 1 ] ], - "A_out": [ 5.0, 6.0, 1.0, 2.0, 9.0, 10.0, 7.0, 8.0, 3.0, 4.0, 11.0, 12.0 ] + "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ], + + "A_out_mat": [ + [ 3.0, 4.0, 9.0, 10.0 ], + [ 1.0, 2.0, 7.0, 8.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots.json index 4e7e5bb276cc..cb77a20404d3 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots.json @@ -8,6 +8,12 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "A_mat": [ + [ 1.0, 2.0, 7.0, 8.0 ], + [ 3.0, 4.0, 9.0, 10.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": -1, @@ -22,5 +28,11 @@ [ 0, 2 ] ], - "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ] + "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ], + + "A_out_mat": [ + [ 3.0, 4.0, 9.0, 10.0 ], + [ 1.0, 2.0, 7.0, 8.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_offset.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_offset.json index cb45b0e27794..cf3f23d1fa15 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_offset.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_offset.json @@ -8,6 +8,12 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "A_mat": [ + [ 1.0, 2.0, 7.0, 8.0 ], + [ 3.0, 4.0, 9.0, 10.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": -1, @@ -22,5 +28,11 @@ [ 0, 2 ] ], - "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ] + "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ], + + "A_out_mat": [ + [ 3.0, 4.0, 9.0, 10.0 ], + [ 1.0, 2.0, 7.0, 8.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_stride.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_stride.json index 11c322f478cb..98f2c79c57c8 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_stride.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_stride.json @@ -8,6 +8,12 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "A_mat": [ + [1.0, 2.0, 7.0, 8.0], + [3.0, 4.0, 9.0, 10.0], + [5.0, 6.0, 11.0, 12.0] + ], + "k1": 0, "k2": 2, "incK": -1, @@ -22,5 +28,11 @@ [ 0, 2 ] ], - "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ] + "A_out": [ 3.0, 4.0, 1.0, 2.0, 5.0, 6.0, 9.0, 10.0, 7.0, 8.0, 11.0, 12.0 ], + + "A_out_mat": [ + [ 3.0, 4.0, 9.0, 10.0 ], + [ 1.0, 2.0, 7.0, 8.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_offset.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_offset.json index 282494e322d7..fd670557fcf8 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_offset.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_offset.json @@ -5,8 +5,14 @@ "LDA": 3, "strideA1": 2, "strideA2": 1, - "offsetA": 2, - "A": [ 9999.0, 9999.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 9999.0, 9999.0 ], + "offsetA": 1, + "A": [ 9999.0, 9999.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ], "k1": 0, "k2": 2, @@ -22,5 +28,11 @@ [ 2, 1 ] ], - "A_out": [ 9999.0, 9999.0, 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0, 9999.0, 9999.0 ] + "A_out": [ 9999.0, 9999.0, 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ], + + "A_mat_out": [ + [ 5.0, 6.0, 7.0, 8.0 ], + [ 1.0, 2.0, 3.0, 4.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_strides.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_strides.json index 58275870e8b4..79aed460b691 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_strides.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_a_strides.json @@ -45,6 +45,12 @@ 9999.0 ], +"A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": 1, @@ -96,5 +102,11 @@ 9999.0, 9999.0, 9999.0 + ], + + "A_mat_out": [ + [ 5.0, 6.0, 7.0, 8.0 ], + [ 1.0, 2.0, 3.0, 4.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_complex_access_patterns.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_complex_access_patterns.json index 6e1e1f638044..9e0b93c8e31e 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_complex_access_patterns.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_complex_access_patterns.json @@ -3,12 +3,10 @@ "N": 2, "LDA": null, - "strideA1": 6, + "strideA1": 4, "strideA2": -2, - "offsetA": 3, + "offsetA": 2, "A": [ - 9999.0, - 9999.0, 3.0, 4.0, 9999.0, @@ -17,10 +15,6 @@ 2.0, 9999.0, 9999.0, - 9999.0, - 9999.0, - 9999.0, - 9999.0, 7.0, 8.0, 9999.0, @@ -29,20 +23,20 @@ 6.0, 9999.0, 9999.0, - 9999.0, - 9999.0, - 9999.0, - 9999.0, 11.0, 12.0, 9999.0, 9999.0, 9.0, - 10.0, - 9999.0, - 9999.0 + 10.0 ], +"A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": 1, @@ -58,8 +52,6 @@ ], "A_out": [ - 9999.0, - 9999.0, 7.0, 8.0, 9999.0, @@ -68,29 +60,25 @@ 6.0, 9999.0, 9999.0, - 9999.0, - 9999.0, - 9999.0, - 9999.0, - 4.0, 3.0, + 4.0, 9999.0, 9999.0, 1.0, 2.0, 9999.0, 9999.0, - 9999.0, - 9999.0, - 9999.0, - 9999.0, 11.0, 12.0, 9999.0, 9999.0, 9.0, - 10.0, - 9999.0, - 9999.0 + 10.0 + ], + + "A_mat_out": [ + [ 5.0, 6.0, 7.0, 8.0 ], + [ 1.0, 2.0, 3.0, 4.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_offset.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_offset.json index 16e97ecf78e4..b1da01332276 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_offset.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_offset.json @@ -8,6 +8,12 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": 1, @@ -22,5 +28,11 @@ [ 2, 1 ] ], - "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] + "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ], + + "A_mat_out": [ + [ 5.0, 6.0, 7.0, 8.0 ], + [ 1.0, 2.0, 3.0, 4.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_negative.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_negative.json index c531a5795541..611d915eb9a2 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_negative.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_negative.json @@ -8,6 +8,12 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] + ], + "k1": 0, "k2": 2, "incK": -1, @@ -22,5 +28,11 @@ [ 0, 2 ] ], - "A_out": [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] + "A_out": [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ], + + "A_out_mat": [ + [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + [ 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_positive.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_positive.json index 974cec079fbc..c39a1b304a65 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_positive.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_ipiv_stride_positive.json @@ -8,6 +8,12 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] + ], + "k1": 0, "k2": 2, "incK": 1, @@ -22,5 +28,11 @@ [ 0, 2 ] ], - "A_out": [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] + "A_out": [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ], + + "A_out_mat": [ + [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], + [ 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_k1.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_k1.json index a6d5a1f5968f..95ef254e5fc7 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_k1.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_k1.json @@ -8,6 +8,15 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ], + [ 17.0, 18.0, 19.0, 20.0 ], + [ 21.0, 22.0, 23.0, 24.0 ] + ], + "k1": 3, "k2": 5, "incK": 1, @@ -22,5 +31,14 @@ [ 5, 0 ] ], - "A_out": [ 21.0, 22.0, 23.0, 24.0, 17.0, 18.0, 19.0, 20.0, 13.0, 14.0, 15.0, 16.0, 9.0, 10.0, 11.0, 12.0, 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] + "A_out": [ 21.0, 22.0, 23.0, 24.0, 17.0, 18.0, 19.0, 20.0, 13.0, 14.0, 15.0, 16.0, 9.0, 10.0, 11.0, 12.0, 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ], + + "A_out_mat": [ + [ 21.0, 22.0, 23.0, 24.0 ], + [ 17.0, 18.0, 19.0,20.0 ], + [ 13.0, 14.0, 15.0, 16.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 1.0, 2.0, 3.0, 4.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_lda.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_lda.json index 34978c5541b1..6bdde039e27f 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_lda.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_lda.json @@ -33,6 +33,12 @@ 9999.0 ], +"A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": 1, @@ -72,5 +78,10 @@ 9999.0, 9999.0, 9999.0 + ], + "A_mat_out": [ + [ 5.0, 6.0, 7.0, 8.0 ], + [ 1.0, 2.0, 3.0, 4.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_no_offsets.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_no_offsets.json index 72c6cf2d9795..4b7f68cfd5f5 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_no_offsets.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_no_offsets.json @@ -8,6 +8,12 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": 1, @@ -22,5 +28,10 @@ [ 2, 1 ] ], - "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] + "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ], + "A_mat_out": [ + [ 5.0, 6.0, 7.0, 8.0 ], + [ 1.0, 2.0, 3.0, 4.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots.json index bb928bc65ff7..56dbe67c9761 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots.json @@ -8,6 +8,12 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": -1, @@ -22,5 +28,11 @@ [ 0, 2 ] ], - "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] + "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ], + + "A_mat_out": [ + [ 5.0, 6.0, 7.0, 8.0 ], + [ 1.0, 2.0, 3.0, 4.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_offset.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_offset.json index 7cb31e2ade4a..0f6038997db5 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_offset.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_offset.json @@ -8,6 +8,12 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": -1, @@ -22,5 +28,10 @@ [ 0, 2 ] ], - "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] + "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ], + "A_mat_out": [ + [ 5.0, 6.0, 7.0, 8.0 ], + [ 1.0, 2.0, 3.0, 4.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_stride.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_stride.json index ccfdd705ed50..74ab87a77c96 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_stride.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_reverse_pivots_ipiv_stride.json @@ -8,6 +8,12 @@ "offsetA": 0, "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ], + "k1": 0, "k2": 2, "incK": -1, @@ -22,5 +28,11 @@ [ 0, 2 ] ], - "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ] + "A_out": [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0, 9.0, 10.0, 11.0, 12.0 ], + + "A_mat_out": [ + [ 5.0, 6.0, 7.0, 8.0 ], + [ 1.0, 2.0, 3.0, 4.0 ], + [ 9.0, 10.0, 11.0, 12.0 ] + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js index 1ad7a7e9c66f..bfbedfeea83c 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js @@ -89,7 +89,7 @@ tape( 'the function performs a series of row interchanges (column-major)', funct out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -110,7 +110,7 @@ tape( 'the function performs a series of row interchanges (column-major, k1 > 0) out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -131,7 +131,7 @@ tape( 'the function supports applying pivots in reverse order (column-major)', f out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -152,7 +152,7 @@ tape( 'the function supports an `IPIV` stride (column-major)', function test( t out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -173,7 +173,7 @@ tape( 'the function supports an `IPIV` stride (reverse pivots, column-major)', f out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -194,7 +194,7 @@ tape( 'the function supports an `IPIV` offset (column-major)', function test( t out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -215,7 +215,7 @@ tape( 'the function supports an `IPIV` offset (reverse pivots, column-major)', f out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -236,7 +236,7 @@ tape( 'the function supports `A` strides (column-major)', function test( t ) { out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -257,7 +257,7 @@ tape( 'the function supports an `A` offset (column-major)', function test( t ) { out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -278,7 +278,7 @@ tape( 'the function supports complex access patterns (column-major)', function t out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -301,16 +301,16 @@ tape( 'the function efficiently handles large datasets (column-major)', function o = 0; // Define a linear buffer: - buf = oneTo( numel( sh ), 'generic' ); + buf = oneTo( ( 2 * numel( sh ) ), 'generic' ); // Convert to a nested array: - mat = ndarray2array( buf, sh, st, o, ord ); + mat = ndarray2array( buf, [ sh[0], 2*sh[1] ], st, o, ord ); // Define an input matrix in linear storage: A = new Complex128Array( buf ); // Create an array of pivot indices: - IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] ); + IPIV = new Int32Array( [ 1, 0 ] ); // Define the expected output array: expected = reverse( mat.slice() ); @@ -320,7 +320,7 @@ tape( 'the function efficiently handles large datasets (column-major)', function out = zlaswp( sh[1], A, st[0], st[1], o, 3, 4, 1, IPIV, 1, 0 ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -341,7 +341,7 @@ tape( 'the function performs a series of row interchanges (row-major)', function out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -362,7 +362,7 @@ tape( 'the function performs a series of row interchanges (row-major, k1 > 0)', out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -383,7 +383,7 @@ tape( 'the function supports applying pivots in reverse order (row-major)', func out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -404,7 +404,7 @@ tape( 'the function supports an `IPIV` stride (row-major)', function test( t ) { out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -425,7 +425,7 @@ tape( 'the function supports an `IPIV` stride (reverse pivots, row-major)', func out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -446,7 +446,7 @@ tape( 'the function supports an `IPIV` offset (row-major)', function test( t ) { out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -467,7 +467,7 @@ tape( 'the function supports an `IPIV` offset (reverse pivots, row-major)', func out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -488,7 +488,7 @@ tape( 'the function supports `A` strides (row-major)', function test( t ) { out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -509,7 +509,7 @@ tape( 'the function supports an `A` offset (row-major)', function test( t ) { out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -530,7 +530,7 @@ tape( 'the function supports complex access patterns (row-major)', function test out = zlaswp( data.N, A, data.strideA1, data.strideA2, data.offsetA, data.k1, data.k2, data.incK, IPIV, data.strideIPIV, data.offsetIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -572,7 +572,7 @@ tape( 'the function efficiently handles large datasets (row-major)', function te out = zlaswp( sh[1], A, st[0], st[1], o, 3, 4, 1, IPIV, 1, 0 ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js index 0b432c18d46e..b85360b85ca1 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js @@ -140,7 +140,7 @@ tape( 'the function performs a series of row interchanges (column-major)', funct out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -161,7 +161,7 @@ tape( 'the function performs a series of row interchanges (column-major, k1 > 0) out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -182,7 +182,7 @@ tape( 'the function supports applying pivots in reverse order (column-major)', f out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -203,7 +203,7 @@ tape( 'the function supports specifying an `LDA` parameter for operating on sub- out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -224,7 +224,7 @@ tape( 'the function supports specifying a positive increment between successive out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -245,7 +245,7 @@ tape( 'the function supports specifying a negative increment between successive out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -266,7 +266,7 @@ tape( 'if provided an increment between successive values of `IPIV` equal to `0` out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, 0 ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -308,7 +308,7 @@ tape( 'the function efficiently handles large datasets (column-major)', function out = zlaswp( ord, sh[1], A, sh[0], 3, 4, IPIV, 1 ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -329,7 +329,7 @@ tape( 'the function performs a series of row interchanges (row-major)', function out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -350,7 +350,7 @@ tape( 'the function performs a series of row interchanges (row-major, k1 > 0)', out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -371,7 +371,7 @@ tape( 'the function supports applying pivots in reverse order (row-major)', func out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -392,7 +392,7 @@ tape( 'the function supports specifying an `LDA` parameter for operating on sub- out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -413,7 +413,7 @@ tape( 'the function supports specifying a positive increment between successive out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -434,7 +434,7 @@ tape( 'the function supports specifying a negative increment between successive out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, data.strideIPIV ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -455,7 +455,7 @@ tape( 'if provided an increment between successive values of `IPIV` equal to `0` out = zlaswp( data.order, data.N, A, data.LDA, data.k1, data.k2, IPIV, 0 ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); @@ -497,7 +497,7 @@ tape( 'the function efficiently handles large datasets (row-major)', function te out = zlaswp( ord, sh[1], A, sh[1], 3, 4, IPIV, 1 ); t.strictEqual( out, A, 'returns expected value' ); - t.strictEqual( isSameComplex128Array( out, expected ), true, 'returns expected value' ); + t.ok( isSameComplex128Array( out, expected ), 'returns expected value' ); t.end(); }); From bbb7321653c6e889b7b7cc36a7e91188be49ecd5 Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Sun, 16 Mar 2025 10:41:22 +0000 Subject: [PATCH 16/22] test: restore previous tests for large data sets --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/lapack/base/zlaswp/test/test.ndarray.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js index bfbedfeea83c..a4c4f7fde60e 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js @@ -301,16 +301,16 @@ tape( 'the function efficiently handles large datasets (column-major)', function o = 0; // Define a linear buffer: - buf = oneTo( ( 2 * numel( sh ) ), 'generic' ); + buf = oneTo( numel( sh ), 'generic' ); // Convert to a nested array: - mat = ndarray2array( buf, [ sh[0], 2*sh[1] ], st, o, ord ); + mat = ndarray2array( buf, sh, st, o, ord ); // Define an input matrix in linear storage: A = new Complex128Array( buf ); // Create an array of pivot indices: - IPIV = new Int32Array( [ 1, 0 ] ); + IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] ); // Define the expected output array: expected = reverse( mat.slice() ); From 61f1a517c8f7b54ecbec85fd86794c97e790ccca Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Mon, 17 Mar 2025 08:12:18 +0000 Subject: [PATCH 17/22] test: fix ndarray tests for large datasets --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../lapack/base/zlaswp/test/test.ndarray.js | 41 +++++++++++++------ 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js index a4c4f7fde60e..c683885e4a4d 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js @@ -32,6 +32,7 @@ var reverse = require( '@stdlib/array/base/reverse' ); var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); var numel = require( '@stdlib/ndarray/base/numel' ); var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); var zlaswp = require( './../lib/ndarray.js' ); @@ -284,8 +285,11 @@ tape( 'the function supports complex access patterns (column-major)', function t }); tape( 'the function efficiently handles large datasets (column-major)', function test( t ) { + var expectedMat; + var expectedBuf; var expected; var IPIV; + var Abuf; var buf; var mat; var out; @@ -296,25 +300,29 @@ tape( 'the function efficiently handles large datasets (column-major)', function var o; ord = 'column-major'; - sh = [ 5, 100 ]; + sh = [ 5, 1000 ]; st = shape2strides( sh, ord ); o = 0; // Define a linear buffer: - buf = oneTo( numel( sh ), 'generic' ); - - // Convert to a nested array: - mat = ndarray2array( buf, sh, st, o, ord ); + buf = oneTo( 2 * numel( sh ), 'generic' ); // Define an input matrix in linear storage: A = new Complex128Array( buf ); + Abuf = reinterpret( A, 0 ); + + // Convert to a nested array: + mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord ); + // Create an array of pivot indices: IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] ); // Define the expected output array: - expected = reverse( mat.slice() ); - expected = new Complex128Array( flatten( expected, sh, true ) ); + expectedMat = reverse( mat.slice() ); + expectedBuf = flatten( expectedMat, sh, true ); + expectedBuf = flatten( expectedBuf, [ numel( sh ), 2 ], false ); + expected = new Complex128Array( expectedBuf ); // Interchange rows: out = zlaswp( sh[1], A, st[0], st[1], o, 3, 4, 1, IPIV, 1, 0 ); @@ -536,8 +544,11 @@ tape( 'the function supports complex access patterns (row-major)', function test }); tape( 'the function efficiently handles large datasets (row-major)', function test( t ) { + var expectedBuf; + var expectedMat; var expected; var IPIV; + var Abuf; var buf; var mat; var out; @@ -553,20 +564,24 @@ tape( 'the function efficiently handles large datasets (row-major)', function te o = 0; // Define a linear buffer: - buf = oneTo( numel( sh ), 'generic' ); - - // Convert to a nested array: - mat = ndarray2array( buf, sh, st, o, ord ); + buf = oneTo( 2 * numel( sh ), 'generic' ); // Define an input matrix in linear storage: A = new Complex128Array( buf ); + Abuf = reinterpret( A, 0 ); + + // Convert to a nested array: + mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord ); + // Create an array of pivot indices: IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] ); // Define the expected output array: - expected = reverse( mat.slice() ); - expected = new Complex128Array( flatten( expected, sh, false ) ); + expectedMat = reverse( mat.slice() ); + expectedBuf = flatten( expectedMat, sh, false ); + expectedBuf = flatten( expectedBuf, [ numel( sh ), 2 ], false ); + expected = new Complex128Array( expectedBuf ); // Interchange rows: out = zlaswp( sh[1], A, st[0], st[1], o, 3, 4, 1, IPIV, 1, 0 ); From a6da690402c6b6024f9721db7b15d741a7ca90d2 Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Mon, 17 Mar 2025 08:16:35 +0000 Subject: [PATCH 18/22] test: fix zlaswp tests for large datasets --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../lapack/base/zlaswp/test/test.ndarray.js | 2 +- .../lapack/base/zlaswp/test/test.zlaswp.js | 43 +++++++++++++------ 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js index c683885e4a4d..7f352597b656 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js @@ -559,7 +559,7 @@ tape( 'the function efficiently handles large datasets (row-major)', function te var o; ord = 'row-major'; - sh = [ 5, 100 ]; + sh = [ 5, 1000 ]; st = shape2strides( sh, ord ); o = 0; diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js index b85360b85ca1..90bcd38008f3 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js @@ -32,6 +32,7 @@ var reverse = require( '@stdlib/array/base/reverse' ); var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); var numel = require( '@stdlib/ndarray/base/numel' ); var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); var zlaswp = require( './../lib/zlaswp.js' ); @@ -272,8 +273,11 @@ tape( 'if provided an increment between successive values of `IPIV` equal to `0` }); tape( 'the function efficiently handles large datasets (column-major)', function test( t ) { + var expectedMat; + var expectedBuf; var expected; var IPIV; + var Abuf; var buf; var mat; var out; @@ -284,25 +288,29 @@ tape( 'the function efficiently handles large datasets (column-major)', function var o; ord = 'column-major'; - sh = [ 5, 100 ]; + sh = [ 5, 1000 ]; st = shape2strides( sh, ord ); o = 0; // Define a linear buffer: - buf = oneTo( numel( sh ), 'generic' ); - - // Convert to a nested array: - mat = ndarray2array( buf, sh, st, o, ord ); + buf = oneTo( 2 * numel( sh ), 'generic' ); // Define an input matrix in linear storage: A = new Complex128Array( buf ); + Abuf = reinterpret( A, 0 ); + + // Convert to a nested array: + mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord ); + // Create an array of pivot indices: IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] ); // Define the expected output array: - expected = reverse( mat.slice() ); - expected = new Complex128Array( flatten( expected, sh, true ) ); + expectedMat = reverse( mat.slice() ); + expectedBuf = flatten( expectedMat, sh, true ); + expectedBuf = flatten( expectedBuf, [ numel( sh ), 2 ], false ); + expected = new Complex128Array( expectedBuf ); // Interchange rows: out = zlaswp( ord, sh[1], A, sh[0], 3, 4, IPIV, 1 ); @@ -461,8 +469,11 @@ tape( 'if provided an increment between successive values of `IPIV` equal to `0` }); tape( 'the function efficiently handles large datasets (row-major)', function test( t ) { + var expectedBuf; + var expectedMat; var expected; var IPIV; + var Abuf; var buf; var mat; var out; @@ -473,25 +484,29 @@ tape( 'the function efficiently handles large datasets (row-major)', function te var o; ord = 'row-major'; - sh = [ 5, 100 ]; + sh = [ 5, 1000 ]; st = shape2strides( sh, ord ); o = 0; // Define a linear buffer: - buf = oneTo( numel( sh ), 'generic' ); - - // Convert to a nested array: - mat = ndarray2array( buf, sh, st, o, ord ); + buf = oneTo( 2 * numel( sh ), 'generic' ); // Define an input matrix in linear storage: A = new Complex128Array( buf ); + Abuf = reinterpret( A, 0 ); + + // Convert to a nested array: + mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord ); + // Create an array of pivot indices: IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] ); // Define the expected output array: - expected = reverse( mat.slice() ); - expected = new Complex128Array( flatten( expected, sh, false ) ); + expectedMat = reverse( mat.slice() ); + expectedBuf = flatten( expectedMat, sh, false ); + expectedBuf = flatten( expectedBuf, [ numel( sh ), 2 ], false ); + expected = new Complex128Array( expectedBuf ); // Interchange rows: out = zlaswp( ord, sh[1], A, sh[1], 3, 4, IPIV, 1 ); From fc1d3ea59897408438f68009b68a9a4af161b676 Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Mon, 17 Mar 2025 09:17:52 +0000 Subject: [PATCH 19/22] chore: self review fixtures --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../fixtures/column_major_reverse_pivots_ipiv_stride.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_stride.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_stride.json index 98f2c79c57c8..e1e06039622b 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_stride.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/column_major_reverse_pivots_ipiv_stride.json @@ -9,9 +9,9 @@ "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], "A_mat": [ - [1.0, 2.0, 7.0, 8.0], - [3.0, 4.0, 9.0, 10.0], - [5.0, 6.0, 11.0, 12.0] + [ 1.0, 2.0, 7.0, 8.0 ], + [ 3.0, 4.0, 9.0, 10.0 ], + [ 5.0, 6.0, 11.0, 12.0 ] ], "k1": 0, From 92d8fdae46088764e2aa19ccebace6ad26584d96 Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Mon, 17 Mar 2025 12:29:17 +0000 Subject: [PATCH 20/22] docs: update examples from repl.txt --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt index 290df329a6b8..2038b7c9e907 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt @@ -43,10 +43,10 @@ Examples -------- - > var IPIV = new {{alias:@stdlib/array/int32}}( [ 1 ] ); + > var IPIV = new {{alias:@stdlib/array/int32}}( [ 1, 1 ] ); > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); > var ord = 'row-major'; - > {{alias}}( ord, 2, A, 2, 0, 0, IPIV, 1 ) + > {{alias}}( ord, 2, A, 2, 0, 1, IPIV, 1 ) [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] // Using typed array views: From 16b78680c0d0464ce07edd00f78ca4e5472008ed Mon Sep 17 00:00:00 2001 From: aayush0325 Date: Mon, 17 Mar 2025 12:30:45 +0000 Subject: [PATCH 21/22] docs: update examples in repl.txt --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt index 2038b7c9e907..ad82ede3b4f6 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt @@ -50,11 +50,11 @@ [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] // Using typed array views: - > var IPIV0 = new {{alias:@stdlib/array/int32}}( [ 0, 1 ] ); + > var IPIV0 = new {{alias:@stdlib/array/int32}}( [ 0, 1, 1 ] ); > var A0 = new {{alias:@stdlib/array/complex128}}( [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0 ] ); > IPIV = new Int32Array( IPIV0.buffer, IPIV0.BYTES_PER_ELEMENT*1 ); > A = new Complex128Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); - > {{alias}}( ord, 1, A, 1, 0, 0, IPIV, 1 ); + > {{alias}}( ord, 1, A, 1, 0, 1, IPIV, 1 ); > A0 [ 0.0, 0.0, 3.0, 4.0, 1.0, 2.0 ] @@ -110,9 +110,9 @@ Examples -------- - > var IPIV = new {{alias:@stdlib/array/int32}}( [ 1 ] ); + > var IPIV = new {{alias:@stdlib/array/int32}}( [ 1, 1 ] ); > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - > {{alias}}.ndarray( 2, A, 2, 1, 0, 0, 0, 1, IPIV, 1, 0 ) + > {{alias}}.ndarray( 2, A, 2, 1, 0, 0, 1, 1, IPIV, 1, 0 ) [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] See Also From 6635b79f02fba55da018835e2591defd0103748c Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 29 Apr 2025 01:49:17 -0700 Subject: [PATCH 22/22] chore: clean-up --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/lapack/base/zlaswp/README.md | 16 ++++++++++++---- .../@stdlib/lapack/base/zlaswp/docs/repl.txt | 6 ++++-- .../lapack/base/zlaswp/docs/types/index.d.ts | 1 - .../@stdlib/lapack/base/zlaswp/examples/index.js | 2 +- .../base/zlaswp/test/fixtures/row_major_k1.json | 2 +- .../lapack/base/zlaswp/test/test.ndarray.js | 14 ++++++-------- .../lapack/base/zlaswp/test/test.zlaswp.js | 14 ++++++-------- 7 files changed, 30 insertions(+), 25 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/README.md b/lib/node_modules/@stdlib/lapack/base/zlaswp/README.md index aabcd228b90f..3616f8969f58 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/README.md +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/README.md @@ -18,8 +18,6 @@ limitations under the License. --> - - # zlaswp > Perform a series of row interchanges on an input matrix. @@ -36,6 +34,8 @@ var zlaswp = require( '@stdlib/lapack/base/zlaswp' ); Performs a series of row interchanges on an input matrix `A` using pivot indices stored in `IPIV`. + + ```javascript var Int32Array = require( '@stdlib/array/int32' ); var Complex128Array = require( '@stdlib/array/complex128' ); @@ -60,6 +60,8 @@ The function has the following parameters: The sign of the increment parameter `incx` determines the order in which pivots are applied. For example, to apply pivots in reverse order, + + ```javascript var Int32Array = require( '@stdlib/array/int32' ); var Complex128Array = require( '@stdlib/array/complex128' ); @@ -73,6 +75,8 @@ zlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, -1 ); To perform strided access over `IPIV`, provide an `abs(incx)` value greater than one. For example, to access every other element in `IPIV`, + + ```javascript var Int32Array = require( '@stdlib/array/int32' ); var Complex128Array = require( '@stdlib/array/complex128' ); @@ -86,7 +90,7 @@ zlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, 2 ); Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. - + ```javascript var Int32Array = require( '@stdlib/array/int32' ); @@ -108,6 +112,8 @@ zlaswp( 'row-major', 2, A1, 2, 0, 2, IPIV1, 1 ); Performs a series of row interchanges on the matrix `A` using pivot indices stored in `IPIV` and alternative indexing semantics. + + ```javascript var Int32Array = require( '@stdlib/array/int32' ); var Complex128Array = require( '@stdlib/array/complex128' ); @@ -168,6 +174,8 @@ zlaswp.ndarray( 2, A, 2, 1, 2, 0, 2, 1, IPIV, 1, 2 ); ## Examples + + ```javascript @@ -183,7 +191,7 @@ var offset = 0; var order = 'column-major'; // Create a matrix stored in linear memory: -var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] ); // eslint-disable-line max-len +var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ] ); console.log( ndarray2array( A, shape, strides, offset, order ) ); // Define a vector of pivot indices: diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt index ad82ede3b4f6..d90fe83ef87c 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt @@ -44,7 +44,8 @@ Examples -------- > var IPIV = new {{alias:@stdlib/array/int32}}( [ 1, 1 ] ); - > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + > var v = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; + > var A = new {{alias:@stdlib/array/complex128}}( v ); > var ord = 'row-major'; > {{alias}}( ord, 2, A, 2, 0, 1, IPIV, 1 ) [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] @@ -111,7 +112,8 @@ Examples -------- > var IPIV = new {{alias:@stdlib/array/int32}}( [ 1, 1 ] ); - > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + > var v = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ]; + > var A = new {{alias:@stdlib/array/complex128}}( v ); > {{alias}}.ndarray( 2, A, 2, 1, 0, 0, 1, 1, IPIV, 1, 0 ) [ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ] diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/index.d.ts index 373873e94425..de8de30fefa9 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/docs/types/index.d.ts @@ -23,7 +23,6 @@ import { Layout } from '@stdlib/types/blas'; import { Complex128Array } from '@stdlib/types/array'; - /** * Interface describing `zlaswp`. */ diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/examples/index.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/examples/index.js index 97c6a1347640..56e89e3e3765 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/examples/index.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/examples/index.js @@ -30,7 +30,7 @@ var offset = 0; var order = 'column-major'; // Create a matrix stored in linear memory: -var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] ); // eslint-disable-line max-len +var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ] ); // eslint-disable-line max-len console.log( ndarray2array( A, shape, strides, offset, order ) ); // Define a vector of pivot indices: diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_k1.json b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_k1.json index 95ef254e5fc7..dfb38ee59873 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_k1.json +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/fixtures/row_major_k1.json @@ -35,7 +35,7 @@ "A_out_mat": [ [ 21.0, 22.0, 23.0, 24.0 ], - [ 17.0, 18.0, 19.0,20.0 ], + [ 17.0, 18.0, 19.0, 20.0 ], [ 13.0, 14.0, 15.0, 16.0 ], [ 9.0, 10.0, 11.0, 12.0 ], [ 5.0, 6.0, 7.0, 8.0 ], diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js index 7f352597b656..f8936b3041e9 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js @@ -289,7 +289,7 @@ tape( 'the function efficiently handles large datasets (column-major)', function var expectedBuf; var expected; var IPIV; - var Abuf; + var abuf; var buf; var mat; var out; @@ -309,11 +309,10 @@ tape( 'the function efficiently handles large datasets (column-major)', function // Define an input matrix in linear storage: A = new Complex128Array( buf ); - - Abuf = reinterpret( A, 0 ); + abuf = reinterpret( A, 0 ); // Convert to a nested array: - mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord ); + mat = ndarray2array( abuf, [ sh[0], sh[1], 2 ], [ 2*st[0], 2*st[1], 1 ], o, ord ); // Create an array of pivot indices: IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] ); @@ -548,7 +547,7 @@ tape( 'the function efficiently handles large datasets (row-major)', function te var expectedMat; var expected; var IPIV; - var Abuf; + var abuf; var buf; var mat; var out; @@ -568,11 +567,10 @@ tape( 'the function efficiently handles large datasets (row-major)', function te // Define an input matrix in linear storage: A = new Complex128Array( buf ); - - Abuf = reinterpret( A, 0 ); + abuf = reinterpret( A, 0 ); // Convert to a nested array: - mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord ); + mat = ndarray2array( abuf, [ sh[0], sh[1], 2 ], [ 2*st[0], 2*st[1], 1 ], o, ord ); // Create an array of pivot indices: IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] ); diff --git a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js index 90bcd38008f3..57320786bbcb 100644 --- a/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js +++ b/lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js @@ -277,7 +277,7 @@ tape( 'the function efficiently handles large datasets (column-major)', function var expectedBuf; var expected; var IPIV; - var Abuf; + var abuf; var buf; var mat; var out; @@ -297,11 +297,10 @@ tape( 'the function efficiently handles large datasets (column-major)', function // Define an input matrix in linear storage: A = new Complex128Array( buf ); - - Abuf = reinterpret( A, 0 ); + abuf = reinterpret( A, 0 ); // Convert to a nested array: - mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord ); + mat = ndarray2array( abuf, [ sh[0], sh[1], 2 ], [ 2*st[0], 2*st[1], 1 ], o, ord ); // Create an array of pivot indices: IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] ); @@ -473,7 +472,7 @@ tape( 'the function efficiently handles large datasets (row-major)', function te var expectedMat; var expected; var IPIV; - var Abuf; + var abuf; var buf; var mat; var out; @@ -493,11 +492,10 @@ tape( 'the function efficiently handles large datasets (row-major)', function te // Define an input matrix in linear storage: A = new Complex128Array( buf ); - - Abuf = reinterpret( A, 0 ); + abuf = reinterpret( A, 0 ); // Convert to a nested array: - mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord ); + mat = ndarray2array( abuf, [ sh[0], sh[1], 2 ], [ 2*st[0], 2*st[1], 1 ], o, ord ); // Create an array of pivot indices: IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] );