From bc30ed30f1fc9dc5041ee71ed765d6db401c33d6 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 1 Jul 2025 19:45:41 +0000 Subject: [PATCH 01/17] feat: add lapack/base/dlarf1f --- 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 --- --- .../@stdlib/lapack/base/dlarf1f/lib/base.js | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js new file mode 100644 index 000000000000..1305d0477de9 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.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'; + +/* eslint-disable max-len */ + +// MODULES // + +var iladlc = require( '@stdlib/lapack/base/iladlc' ).ndarray; +var iladlr = require( '@stdlib/lapack/base/iladlr' ).ndarray; +var dgemv = require( '@stdlib/blas/base/dgemv' ).ndarray; +var dger = require( '@stdlib/blas/base/dger' ).ndarray; +var daxpy = require( '@stdlib/blas/base/daxpy' ).ndarray; +var dscal = require( '@stdlib/blas/base/dscal' ).ndarray; + + +// MAIN // + +/** +* Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. +* +* ## Notes +* +* - `work` should have `N` indexed elements if side = `left` and `M` indexed elements if side = `right`. +* - `V` should have `1 + (M-1) * abs(strideV)` indexed elements if side = `left` and `1 + (N-1) * abs(strideV)` indexed elements if side = `right`. +* - `C` is overwritten by `H * C` if side = `left` and `C * H` if side = `right`. +* +* @private +* @param {string} side - use `left` to form `H * C` and `right` to from `C * H` +* @param {NonNegativeInteger} M - number of rows in `C` +* @param {NonNegativeInteger} N - number of columns in `C` +* @param {Float64Array} V - the vector `v` in the representation of `H` +* @param {integer} strideV - stride length for `V` +* @param {NonNegativeInteger} offsetV - starting index for `V` +* @param {number} tau - the value of `tau` in representation of `H` +* @param {Float64Array} C - input matrix +* @param {integer} strideC1 - stride of the first dimension of `C` +* @param {integer} strideC2 - stride of the second dimension of `C` +* @param {NonNegativeInteger} offsetC - starting index for `C` +* @param {Float64Array} work - workspace array +* @param {integer} strideWork - stride length for `work` +* @param {NonNegativeInteger} offsetWork - starting index for `work` +* @returns {Float64Array} `C * H` or `H * C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var C = new Float64Array( [ 1, 5, 9, 2, 6, 10, 3, 7, 11, 4, 8, 12 ] ); +* var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +* var work = new Float64Array( 3 ); +* +* var out = dlarf1f( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); +* // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +*/ +function dlarf1f( side, M, N, V, strideV, offsetV, tau, C, strideC1, strideC2, offsetC, work, strideWork, offsetWork ) { // eslint-disable-line max-params + var lastv; + var lastc; + var i; + + lastv = 1; + lastc = 0; + if ( tau !== 0.0 ) { + if ( side === 'left' ) { + lastv = M; + } else { + lastv = N; + } + if ( strideV > 0 ) { + i = offsetV + ( ( lastv - 1 ) * strideV ); + } else { + i = offsetV; + } + while ( lastv > 0 && V[ i ] === 0.0 ) { + lastv -= 1; + i -= strideV; + } + if ( side === 'left' ) { + lastc = iladlc( lastv, N, C, strideC1, strideC2, offsetC ) + 1; // to account for the difference between zero-based and one-based indexing + } else { + lastc = iladlr( M, lastv, C, strideC1, strideC2, offsetC ) + 1; // to account for the difference between zero-based and one-based indexing + } + // lastc is zero if a matrix is filled with zeros + } + if ( lastc === 0 ) { + // Returns C unchanged if tau is zero or all elements in C are zero + return C; + } + if ( side === 'left' ) { + if ( lastv === 0 ) { + dscal( lastc, 1.0 - tau, C, strideC2, offsetC ); // scale the first row + } else { + dgemv( 'transpose', lastv-1, lastc, 1.0, C, strideC1, strideC2, offsetC + strideC1, V, strideV, offsetV + strideV, 0.0, work, strideWork, offsetWork ); // C( 1, 0 ) is accessed here + daxpy( lastc, 1.0, C, strideC2, offsetC, work, strideWork, offsetWork ); // operates on the first row of C + daxpy( lastc, -tau, work, strideWork, offsetWork, C, strideC2, offsetC ); // operates on the first row of C + dger( lastv-1, lastc, -tau, V, strideV, offsetV + strideV, work, strideWork, offsetWork, C, strideC1, strideC2, offsetC + strideC1 ); // C( 1, 0 ) is accessed here + } + } else if ( lastv === 0 ) { + dscal( lastc, 1.0 - tau, C, strideC1, offsetC ); // scale the first column + } else { + dgemv( 'no-transpose', lastc, lastv-1, 1.0, C, strideC1, strideC2, offsetC + strideC2, V, strideV, offsetV + strideV, 0.0, work, strideWork, offsetWork ); // C( 0, 1 ) is accessed here + daxpy( lastc, 1.0, C, strideC1, offsetC, work, strideWork, offsetWork ); // operates on the first column of C + daxpy( lastc, -tau, work, strideWork, offsetWork, C, strideC1, offsetC ); // operates on the first column of C + dger( lastc, lastv-1, -tau, work, strideWork, offsetWork, V, strideV, offsetV + strideV, C, strideC1, strideC2, offsetC + strideC2 ); // C( 0, 1 ) is accessed here + } + + return C; +} + + +// EXPORTS // + +module.exports = dlarf1f; From 5f73e5b40875d1ebf28e6fc6afcaad780725b396 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 1 Jul 2025 20:12:15 +0000 Subject: [PATCH 02/17] feat: add main exports --- 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 --- --- .../@stdlib/lapack/base/dlarf1f/lib/base.js | 10 +- .../lapack/base/dlarf1f/lib/dlarf1f.js | 104 ++++++++++++++++++ .../@stdlib/lapack/base/dlarf1f/lib/index.js | 65 +++++++++++ .../@stdlib/lapack/base/dlarf1f/lib/main.js | 35 ++++++ .../lapack/base/dlarf1f/lib/ndarray.js | 77 +++++++++++++ 5 files changed, 286 insertions(+), 5 deletions(-) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/index.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/main.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js index 1305d0477de9..c85cf4d71b3c 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js @@ -81,11 +81,11 @@ function dlarf1f( side, M, N, V, strideV, offsetV, tau, C, strideC1, strideC2, o } else { lastv = N; } - if ( strideV > 0 ) { - i = offsetV + ( ( lastv - 1 ) * strideV ); - } else { - i = offsetV; - } + + // Determine the offset for V ----- can we set i = offsetV straight away???? + // i = offsetV + stride2offset( lastv, strideV ); + i = offsetV; + while ( lastv > 0 && V[ i ] === 0.0 ) { lastv -= 1; i -= strideV; diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js new file mode 100644 index 000000000000..648a4d5d31e2 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js @@ -0,0 +1,104 @@ +/** +* @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 isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var max = require( '@stdlib/math/base/special/max' ); +var format = require( '@stdlib/string/format' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. +* +* ## Notes +* +* - `work` should have `N` indexed elements if side = `left` and `M` indexed elements if side = `right`. +* - `V` should have `1 + (M-1) * abs(incv)` indexed elements if side = `left` and `1 + (N-1) * abs(incv)` indexed elements if side = `right`. +* - `C` is overwritten by `H * C` if side = `left` and `C * H` if side = `right`. +* +* @param {string} order - storage layout +* @param {string} side - use `left` to form `H * C` and `right` to from `C * H` +* @param {NonNegativeInteger} M - number of rows in `C` +* @param {NonNegativeInteger} N - number of columns in `C` +* @param {Float64Array} V - the vector `v` in the representation of `H` +* @param {integer} incv - stride length for `V` +* @param {number} tau - the value of `tau` in representation of `H` +* @param {Float64Array} C - input matrix +* @param {PositiveInteger} LDC - stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`) +* @param {Float64Array} work - workspace array +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must be a valid side +* @throws {RangeError} ninth argument must be greater than or equal to max(1,N) +* @throws {RangeError} fifth argument must not be zero +* @returns {Float64Array} `C * H` or `H * C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var C = new Float64Array( [ 1, 5, 9, 2, 6, 10, 3, 7, 11, 4, 8, 12 ] ); +* var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +* var work = new Float64Array( 3 ); +* +* var out = dlarf1f( 'row-major', 'left', 4, 3, V, 1, 1.0, C, 3, work ); +* // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +*/ +function dlarf1f( order, side, M, N, V, incv, tau, C, LDC, work ) { + var sc1; + var sc2; + var ov; + + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( isRowMajor( order ) && LDC < max( 1, N ) ) { + throw new RangeError( format( 'invalid argument. Fourth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDC ) ); + } + if ( side !== 'left' && side !== 'right' ) { // TODO - refactor this to make use of an array if needed + throw new TypeError( format( 'invalid argument. Second argument must be a valid side (left or right). Value: `%s`.', side ) ); + } + if ( incv === 0 ) { + throw new RangeError( format( 'invalid argument. Fifth argument must not be zero' ) ); + } + if ( isColumnMajor( order ) ) { + sc1 = 1; + sc2 = LDC; + } else { // order === 'row-major' + sc1 = LDC; + sc2 = 1; + } + if ( side === 'left' ) { + ov = stride2offset( M, incv ); + } else { + ov = stride2offset( N, incv ); + } + return base( side, M, N, V, incv, ov, tau, C, sc1, sc2, 0, work, 1, 0 ); +} + + +// EXPORTS // + +module.exports = dlarf1f; diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/index.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/index.js new file mode 100644 index 000000000000..a96852c70ff5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/index.js @@ -0,0 +1,65 @@ +/** +* @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'; + +/** +* LAPACK routine to apply a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. +* +* ## Notes +* +* - `work` should have `N` indexed elements if side = `left` and `M` indexed elements if side = `right`. +* - `V` should have `1 + (M-1) * abs(incv)` indexed elements if side = `left` and `1 + (N-1) * abs(incv)` indexed elements if side = `right`. +* - `C` is overwritten by `H * C` if side = `left` and `C * H` if side = `right`. +* +* @module @stdlib/lapack/base/dlarf1f +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dlarf1f = require( '@stdlib/lapack/base/dlarf1f' ); +* +* var C = new Float64Array( [ 1, 5, 9, 2, 6, 10, 3, 7, 11, 4, 8, 12 ] ); +* var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +* var work = new Float64Array( 3 ); +* +* var out = dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, work ); +* // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +*/ + +// 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 dlarf1f; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dlarf1f = main; +} else { + dlarf1f = tmp; +} + + +// EXPORTS // + +module.exports = dlarf1f; diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/main.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/main.js new file mode 100644 index 000000000000..147bc72d40e7 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dlarf1f = require( './dlarf1f.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dlarf1f, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dlarf1f; diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js new file mode 100644 index 000000000000..c85bca5b7f4d --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js @@ -0,0 +1,77 @@ +/** +* @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 format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. +* +* ## Notes +* +* - `work` should have `N` indexed elements if side = `left` and `M` indexed elements if side = `right`. +* - `V` should have `1 + (M-1) * abs(strideV)` indexed elements if side = `left` and `1 + (N-1) * abs(strideV)` indexed elements if side = `right`. +* - `C` is overwritten by `H * C` if side = `left` and `C * H` if side = `right`. +* +* @param {string} side - use `left` to form `H * C` and `right` to from `C * H` +* @param {NonNegativeInteger} M - number of rows in `C` +* @param {NonNegativeInteger} N - number of columns in `C` +* @param {Float64Array} V - the vector `v` in the representation of `H` +* @param {integer} strideV - stride length for `V` +* @param {NonNegativeInteger} offsetV - starting index for `V` +* @param {number} tau - the value of `tau` in representation of `H` +* @param {Float64Array} C - input matrix +* @param {integer} strideC1 - stride of the first dimension of `C` +* @param {integer} strideC2 - stride of the second dimension of `C` +* @param {NonNegativeInteger} offsetC - starting index for `C` +* @param {Float64Array} work - workspace array +* @param {integer} strideWork - stride length for `work` +* @param {NonNegativeInteger} offsetWork - starting index for `work` +* @throws {TypeError} first argument must be a valid side +* @returns {Float64Array} `C * H` or `H * C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var C = new Float64Array( [ 1, 5, 9, 2, 6, 10, 3, 7, 11, 4, 8, 12 ] ); +* var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +* var work = new Float64Array( 3 ); +* +* var out = dlarf1f( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); +* // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +*/ +function dlarf1f( side, M, N, V, strideV, offsetV, tau, C, strideC1, strideC2, offsetC, work, strideWork, offsetWork ) { // eslint-disable-line max-params + if ( side !== 'left' && side !== 'right' ) { // TODO - refactor this to make use of an array if needed + throw new TypeError( format( 'invalid argument. First argument must be a valid side (left or right). Value: `%s`.', side ) ); + } + return base( side, M, N, V, strideV, offsetV, tau, C, strideC1, strideC2, offsetC, work, strideWork, offsetWork ); +} + + +// EXPORTS // + +module.exports = dlarf1f; From 40feafc7b2a433b13e5daa4a8731cd82388a6902 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 1 Jul 2025 20:20:16 +0000 Subject: [PATCH 03/17] chore: cleanup --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js index c85cf4d71b3c..80dbf98604e5 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js @@ -82,9 +82,11 @@ function dlarf1f( side, M, N, V, strideV, offsetV, tau, C, strideC1, strideC2, o lastv = N; } - // Determine the offset for V ----- can we set i = offsetV straight away???? - // i = offsetV + stride2offset( lastv, strideV ); - i = offsetV; + if ( strideV > 0 ) { + i = offsetV + ( ( lastv - 1 ) * strideV ); + } else { + i = offsetV; + } while ( lastv > 0 && V[ i ] === 0.0 ) { lastv -= 1; From ede23c36b65d63942ca3e5c70e75b73ed041f34c Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 1 Jul 2025 20:38:57 +0000 Subject: [PATCH 04/17] test: add initial tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/lapack/base/dlarf1f/lib/base.js | 2 +- .../lapack/base/dlarf1f/lib/dlarf1f.js | 2 +- .../@stdlib/lapack/base/dlarf1f/lib/index.js | 2 +- .../lapack/base/dlarf1f/lib/ndarray.js | 2 +- .../lapack/base/dlarf1f/test/test.dlarf1f.js | 167 ++++++++++++++++++ .../@stdlib/lapack/base/dlarf1f/test/test.js | 82 +++++++++ .../lapack/base/dlarf1f/test/test.ndarray.js | 80 +++++++++ 7 files changed, 333 insertions(+), 4 deletions(-) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js index 80dbf98604e5..bdf5494b043d 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js @@ -61,7 +61,7 @@ var dscal = require( '@stdlib/blas/base/dscal' ).ndarray; * @example * var Float64Array = require( '@stdlib/array/float64' ); * -* var C = new Float64Array( [ 1, 5, 9, 2, 6, 10, 3, 7, 11, 4, 8, 12 ] ); +* var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); * var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); * var work = new Float64Array( 3 ); * diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js index 648a4d5d31e2..2c8b5ddfbaa1 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js @@ -59,7 +59,7 @@ var base = require( './base.js' ); * @example * var Float64Array = require( '@stdlib/array/float64' ); * -* var C = new Float64Array( [ 1, 5, 9, 2, 6, 10, 3, 7, 11, 4, 8, 12 ] ); +* var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); * var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); * var work = new Float64Array( 3 ); * diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/index.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/index.js index a96852c70ff5..4f8dac29928f 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/index.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/index.js @@ -33,7 +33,7 @@ * var Float64Array = require( '@stdlib/array/float64' ); * var dlarf1f = require( '@stdlib/lapack/base/dlarf1f' ); * -* var C = new Float64Array( [ 1, 5, 9, 2, 6, 10, 3, 7, 11, 4, 8, 12 ] ); +* var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); * var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); * var work = new Float64Array( 3 ); * diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js index c85bca5b7f4d..e338a9d1ed1a 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js @@ -57,7 +57,7 @@ var base = require( './base.js' ); * @example * var Float64Array = require( '@stdlib/array/float64' ); * -* var C = new Float64Array( [ 1, 5, 9, 2, 6, 10, 3, 7, 11, 4, 8, 12 ] ); +* var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); * var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); * var work = new Float64Array( 3 ); * diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js new file mode 100644 index 000000000000..1cb36c4dc856 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js @@ -0,0 +1,167 @@ +/** +* @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 Float64Array = require( '@stdlib/array/float64' ); +var dlarf1f = require( './../lib/dlarf1f.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlarf1f, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 10', function test( t ) { + t.strictEqual( dlarf1f.length, 10, '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 work; + var V; + var C; + var i; + + C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); + V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); + work = new Float64Array( 3 ); + + 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() { + dlarf1f( value, 'left', 3, 3, V, 1, 1.0, C, 3, work ); + }; + } +}); + +tape( 'the function throws an error if provided a second argument which is not a valid side', function test( t ) { + var values; + var work; + var V; + var C; + var i; + + C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); + V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); + work = new Float64Array( 3 ); + + 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() { + dlarf1f( 'row-major', value, 3, 3, V, 1, 1.0, C, 3, work ); + }; + } +}); + +tape( 'the function throws an error if provided a ninth argument which is not a valid LDC value', function test( t ) { + var values; + var work; + var V; + var C; + var i; + + C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); + V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); + work = new Float64Array( 3 ); + + values = [ + 0, + 1, + 2 + ]; + + 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() { + dlarf1f( 'row-major', 'left', 3, 3, V, 1, 1.0, C, value, work ); + }; + } +}); + +tape( 'the function throws an error if provided a sixth argument which is not a valid incv value', function test( t ) { + var work; + var V; + var C; + + C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); + V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); + work = new Float64Array( 3 ); + + t.throws( badValue( 0 ), RangeError, 'throws an error when provided ' + 0 ); + t.end(); + + function badValue( value ) { + return function badValue() { + dlarf1f( 'row-major', 'left', 3, 3, V, value, 1.0, C, 3, work ); + }; + } +}); diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.js new file mode 100644 index 000000000000..2bc5f6fbce25 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/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 dlarf1f = 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 dlarf1f, '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 dlarf1f.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 dlarf1f = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dlarf1f, 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 dlarf1f; + var main; + + main = require( './../lib/dlarf1f.js' ); + + dlarf1f = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dlarf1f, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js new file mode 100644 index 000000000000..4a02c609259f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js @@ -0,0 +1,80 @@ +/** +* @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 Float64Array = require( '@stdlib/array/float64' ); +var dlarf1f = require( './../lib/ndarray.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlarf1f, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 14', function test( t ) { + t.strictEqual( dlarf1f.length, 14, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not a valid side', function test( t ) { + var values; + var work; + var V; + var C; + var i; + + C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); + V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); + work = new Float64Array( 3 ); + + 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() { + dlarf1f( 'row-major', value, 3, 3, V, 1, 1.0, C, 3, work ); + }; + } +}); From 9878d33ca2755a6496ec4e5f9b0fb59a0cb31f94 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Wed, 2 Jul 2025 10:19:26 +0000 Subject: [PATCH 05/17] test: add tests for left side --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/lapack/base/dlarf1f/lib/base.js | 1 + .../fixtures/left_lastv_eq_one_col_major.json | 38 ++++++ .../fixtures/left_lastv_eq_one_row_major.json | 38 ++++++ .../fixtures/left_lastv_gt_one_col_major.json | 42 +++++++ .../fixtures/left_lastv_gt_one_row_major.json | 43 +++++++ .../dlarf1f/test/fixtures/tau_eq_zero.json | 36 ++++++ .../lapack/base/dlarf1f/test/test.dlarf1f.js | 116 +++++++++++++++++- 7 files changed, 313 insertions(+), 1 deletion(-) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_one_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_one_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_one_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_one_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/tau_eq_zero.json diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js index bdf5494b043d..2d606b9a731e 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js @@ -82,6 +82,7 @@ function dlarf1f( side, M, N, V, strideV, offsetV, tau, C, strideC1, strideC2, o lastv = N; } + // check here if ( strideV > 0 ) { i = offsetV + ( ( lastv - 1 ) * strideV ); } else { diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_one_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_one_col_major.json new file mode 100644 index 000000000000..dd63a9009010 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_one_col_major.json @@ -0,0 +1,38 @@ +{ + "order": "column-major", + + "side": "left", + + "M": 4, + "N": 3, + + "V": [ 1.0, 0.0, 0.0, 0.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 4.0, 7.0, 10.0, 2.0, 5.0, 8.0, 11.0, 3.0, 6.0, 9.0, 12.0 ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 0, + "LDC": 4, + "C_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 ] + ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ 0.5, 4.0, 7.0, 10.0, 1.0, 5.0, 8.0, 11.0, 1.5, 6.0, 9.0, 12.0 ], + "C_out_mat": [ + [ 0.5, 1.0, 1.5 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ], + [ 10.0, 11.0, 12.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_one_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_one_row_major.json new file mode 100644 index 000000000000..60245d504cd6 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_one_row_major.json @@ -0,0 +1,38 @@ +{ + "order": "row-major", + + "side": "left", + + "M": 4, + "N": 3, + + "V": [ 1.0, 0.0, 0.0, 0.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 0, + "LDC": 3, + "C_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 ] + ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ 0.5, 1.0, 1.5, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "C_out_mat": [ + [ 0.5, 1.0, 1.5 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ], + [ 10.0, 11.0, 12.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_one_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_one_col_major.json new file mode 100644 index 000000000000..9cdc98fc1bc5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_one_col_major.json @@ -0,0 +1,42 @@ +{ + "order": "column-major", + + "side": "left", + + "M": 4, + "N": 3, + + "V": [ 1.0, 2.0, 3.0, 4.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ 1.0, 5.0, 9.0 ], + [ 2.0, 6.0, 10.0 ], + [ 3.0, 7.0, 11.0 ], + [ 4.0, 8.0, 12.0 ] + ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ + -14.0, -28.0, -42.0, -56.0, + -30.0, -64.0, -98.0, -132.0, + -46.0, -100.0, -154.0, -208.0 + ], + "C_out_mat": [ + [ -14.0, -30.0, -46.0 ], + [ -28.0, -64.0, -100.0 ], + [ -42.0, -98.0, -154.0 ], + [ -56.0, -132.0, -208.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_one_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_one_row_major.json new file mode 100644 index 000000000000..0a19b0bf87d4 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_one_row_major.json @@ -0,0 +1,43 @@ +{ + "order": "row-major", + + "side": "left", + + "M": 4, + "N": 3, + + "V": [ 1.0, 2.0, 3.0, 4.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ 1.0, 5.0, 9.0 ], + [ 2.0, 6.0, 10.0 ], + [ 3.0, 7.0, 11.0 ], + [ 4.0, 8.0, 12.0 ] + ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ + -14.0, -30.0, -46.0, + -28.0, -64.0, -100.0, + -42.0, -98.0, -154.0, + -56.0, -132.0, -208.0 + ], + "C_out_mat": [ + [ -14.0, -30.0, -46.0 ], + [ -28.0, -64.0, -100.0 ], + [ -42.0, -98.0, -154.0 ], + [ -56.0, -132.0, -208.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/tau_eq_zero.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/tau_eq_zero.json new file mode 100644 index 000000000000..05f1a7e1aa6a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/tau_eq_zero.json @@ -0,0 +1,36 @@ +{ + "order": "row-major", + + "side": "left", + + "M": 3, + "N": 3, + + "V": [ 0.5, 0.5, 0.5 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.0, + + "C": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] + ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ], + "C_out_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js index 1cb36c4dc856..d8ab3eff9bda 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable max-len */ +/* eslint-disable max-len, id-length */ 'use strict'; @@ -27,6 +27,15 @@ var Float64Array = require( '@stdlib/array/float64' ); var dlarf1f = require( './../lib/dlarf1f.js' ); +// FIXTURES // + +var TAU_EQ_ZERO = require( './fixtures/tau_eq_zero.json' ); +var LEFT_LASTV_EQ_ONE_ROW_MAJOR = require( './fixtures/left_lastv_eq_one_row_major.json' ); +var LEFT_LASTV_EQ_ONE_COL_MAJOR = require( './fixtures/left_lastv_eq_one_col_major.json' ); +var LEFT_LASTV_GT_ONE_ROW_MAJOR = require( './fixtures/left_lastv_gt_one_row_major.json' ); +var LEFT_LASTV_GT_ONE_COL_MAJOR = require( './fixtures/left_lastv_gt_one_col_major.json' ); + + // TESTS // tape( 'main export is a function', function test( t ) { @@ -165,3 +174,108 @@ tape( 'the function throws an error if provided a sixth argument which is not a }; } }); + +tape( 'the function returns the array unchanged if tau is zero', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = TAU_EQ_ZERO; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv = 1 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_EQ_ONE_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv = 1 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_EQ_ONE_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv > 1 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_GT_ONE_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv > 1 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_GT_ONE_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); From 491f0efc035302cdea812ee3fe3c95b464a7b37f Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Wed, 2 Jul 2025 11:44:31 +0000 Subject: [PATCH 06/17] chore: cleanup --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/lapack/base/dlarf1f/lib/base.js | 4 ++-- ...json => left_lastv_eq_zero_col_major.json} | 2 +- ...json => left_lastv_eq_zero_row_major.json} | 2 +- ...json => left_lastv_gt_zero_col_major.json} | 0 ...json => left_lastv_gt_zero_row_major.json} | 0 .../lapack/base/dlarf1f/test/test.dlarf1f.js | 24 +++++++++---------- 6 files changed, 16 insertions(+), 16 deletions(-) rename lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/{left_lastv_eq_one_col_major.json => left_lastv_eq_zero_col_major.json} (95%) rename lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/{left_lastv_eq_one_row_major.json => left_lastv_eq_zero_row_major.json} (95%) rename lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/{left_lastv_gt_one_col_major.json => left_lastv_gt_zero_col_major.json} (100%) rename lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/{left_lastv_gt_one_row_major.json => left_lastv_gt_zero_row_major.json} (100%) diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js index 2d606b9a731e..8031a3001586 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js @@ -94,9 +94,9 @@ function dlarf1f( side, M, N, V, strideV, offsetV, tau, C, strideC1, strideC2, o i -= strideV; } if ( side === 'left' ) { - lastc = iladlc( lastv, N, C, strideC1, strideC2, offsetC ) + 1; // to account for the difference between zero-based and one-based indexing + lastc = iladlc( lastv + 1, N, C, strideC1, strideC2, offsetC ) + 1; // to account for the difference between zero-based and one-based indexing } else { - lastc = iladlr( M, lastv, C, strideC1, strideC2, offsetC ) + 1; // to account for the difference between zero-based and one-based indexing + lastc = iladlr( M, lastv + 1, C, strideC1, strideC2, offsetC ) + 1; // to account for the difference between zero-based and one-based indexing } // lastc is zero if a matrix is filled with zeros } diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_one_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_zero_col_major.json similarity index 95% rename from lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_one_col_major.json rename to lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_zero_col_major.json index dd63a9009010..e7253ea8e5ab 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_one_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_zero_col_major.json @@ -6,7 +6,7 @@ "M": 4, "N": 3, - "V": [ 1.0, 0.0, 0.0, 0.0 ], + "V": [ 0.0, 0.0, 0.0, 0.0 ], "strideV": 1, "offsetV": 0, diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_one_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_zero_row_major.json similarity index 95% rename from lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_one_row_major.json rename to lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_zero_row_major.json index 60245d504cd6..590889d02d3a 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_one_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_zero_row_major.json @@ -6,7 +6,7 @@ "M": 4, "N": 3, - "V": [ 1.0, 0.0, 0.0, 0.0 ], + "V": [ 0.0, 0.0, 0.0, 0.0 ], "strideV": 1, "offsetV": 0, diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_one_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_zero_col_major.json similarity index 100% rename from lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_one_col_major.json rename to lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_zero_col_major.json diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_one_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_zero_row_major.json similarity index 100% rename from lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_one_row_major.json rename to lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_zero_row_major.json diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js index d8ab3eff9bda..99b5550097b4 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js @@ -30,10 +30,10 @@ var dlarf1f = require( './../lib/dlarf1f.js' ); // FIXTURES // var TAU_EQ_ZERO = require( './fixtures/tau_eq_zero.json' ); -var LEFT_LASTV_EQ_ONE_ROW_MAJOR = require( './fixtures/left_lastv_eq_one_row_major.json' ); -var LEFT_LASTV_EQ_ONE_COL_MAJOR = require( './fixtures/left_lastv_eq_one_col_major.json' ); -var LEFT_LASTV_GT_ONE_ROW_MAJOR = require( './fixtures/left_lastv_gt_one_row_major.json' ); -var LEFT_LASTV_GT_ONE_COL_MAJOR = require( './fixtures/left_lastv_gt_one_col_major.json' ); +var LEFT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/left_lastv_eq_zero_row_major.json' ); +var LEFT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/left_lastv_eq_zero_col_major.json' ); +var LEFT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/left_lastv_gt_zero_row_major.json' ); +var LEFT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/left_lastv_gt_zero_col_major.json' ); // TESTS // @@ -196,7 +196,7 @@ tape( 'the function returns the array unchanged if tau is zero', function test( t.end(); }); -tape( 'the function expected value for left side, lastv = 1 (row-major)', function test( t ) { +tape( 'the function expected value for left side, lastv = 0 (row-major)', function test( t ) { var expectedC; var data; var work; @@ -204,7 +204,7 @@ tape( 'the function expected value for left side, lastv = 1 (row-major)', functi var V; var C; - data = LEFT_LASTV_EQ_ONE_ROW_MAJOR; + data = LEFT_LASTV_EQ_ZERO_ROW_MAJOR; V = new Float64Array( data.V ); C = new Float64Array( data.C ); @@ -217,7 +217,7 @@ tape( 'the function expected value for left side, lastv = 1 (row-major)', functi t.end(); }); -tape( 'the function expected value for left side, lastv = 1 (column-major)', function test( t ) { +tape( 'the function expected value for left side, lastv = 0 (column-major)', function test( t ) { var expectedC; var data; var work; @@ -225,7 +225,7 @@ tape( 'the function expected value for left side, lastv = 1 (column-major)', fun var V; var C; - data = LEFT_LASTV_EQ_ONE_COL_MAJOR; + data = LEFT_LASTV_EQ_ZERO_COL_MAJOR; V = new Float64Array( data.V ); C = new Float64Array( data.C ); @@ -238,7 +238,7 @@ tape( 'the function expected value for left side, lastv = 1 (column-major)', fun t.end(); }); -tape( 'the function expected value for left side, lastv > 1 (row-major)', function test( t ) { +tape( 'the function expected value for left side, lastv > 0 (row-major)', function test( t ) { var expectedC; var data; var work; @@ -246,7 +246,7 @@ tape( 'the function expected value for left side, lastv > 1 (row-major)', functi var V; var C; - data = LEFT_LASTV_GT_ONE_ROW_MAJOR; + data = LEFT_LASTV_GT_ZERO_ROW_MAJOR; V = new Float64Array( data.V ); C = new Float64Array( data.C ); @@ -259,7 +259,7 @@ tape( 'the function expected value for left side, lastv > 1 (row-major)', functi t.end(); }); -tape( 'the function expected value for left side, lastv > 1 (column-major)', function test( t ) { +tape( 'the function expected value for left side, lastv > 0 (column-major)', function test( t ) { var expectedC; var data; var work; @@ -267,7 +267,7 @@ tape( 'the function expected value for left side, lastv > 1 (column-major)', fun var V; var C; - data = LEFT_LASTV_GT_ONE_COL_MAJOR; + data = LEFT_LASTV_GT_ZERO_COL_MAJOR; V = new Float64Array( data.V ); C = new Float64Array( data.C ); From e80bd1f84270974ffab3dd8b1d86b6181a51b68d Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Wed, 2 Jul 2025 16:42:35 +0000 Subject: [PATCH 07/17] test: add more tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: 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 --- --- .../right_lastv_eq_zero_col_major.json | 38 ++++++++ .../right_lastv_eq_zero_row_major.json | 38 ++++++++ .../right_lastv_gt_zero_col_major.json | 38 ++++++++ .../right_lastv_gt_zero_row_major.json | 38 ++++++++ .../lapack/base/dlarf1f/test/test.dlarf1f.js | 88 +++++++++++++++++++ 5 files changed, 240 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_row_major.json diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..204dd1e5a5db --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_col_major.json @@ -0,0 +1,38 @@ +{ + "order": "column-major", + + "side": "right", + + "M": 4, + "N": 3, + + "V": [ 0.0, 0.0, 0.0, 0.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ 1.0, 5.0, 9.0 ], + [ 2.0, 6.0, 10.0 ], + [ 3.0, 7.0, 11.0 ], + [ 4.0, 8.0, 12.0 ] + ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ 0.5, 1.0, 1.5, 2.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "C_out_mat": [ + [ 0.5, 5.0, 9.0 ], + [ 1.0, 6.0, 10.0 ], + [ 1.5, 7.0, 11.0 ], + [ 2.0, 8.0, 12.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..8ed3a15f200c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_row_major.json @@ -0,0 +1,38 @@ +{ + "order": "row-major", + + "side": "right", + + "M": 4, + "N": 3, + + "V": [ 0.0, 0.0, 0.0, 0.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ 1.0, 5.0, 9.0 ], + [ 2.0, 6.0, 10.0 ], + [ 3.0, 7.0, 11.0 ], + [ 4.0, 8.0, 12.0 ] + ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ 0.5, 5.0, 9.0, 1.0, 6.0, 10.0, 1.5, 7.0, 11.0, 2.0, 8.0, 12.0 ], + "C_out_mat": [ + [ 0.5, 5.0, 9.0 ], + [ 1.0, 6.0, 10.0 ], + [ 1.5, 7.0, 11.0 ], + [ 2.0, 8.0, 12.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..bd818cd04059 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_col_major.json @@ -0,0 +1,38 @@ +{ + "order": "column-major", + + "side": "right", + + "M": 4, + "N": 3, + + "V": [ 1.0, 2.0, 3.0, 4.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ 1.0, 5.0, 9.0 ], + [ 2.0, 6.0, 10.0 ], + [ 3.0, 7.0, 11.0 ], + [ 4.0, 8.0, 12.0 ] + ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ -18.0, -20.0, -22.0, -24.0, -33.0, -38.0, -43.0, -48.0, -48.0, -56.0, -64.0, -72.0 ], + "C_out_mat": [ + [ -18.0, -33.0, -48.0 ], + [ -20.0, -38.0, -56.0 ], + [ -22.0, -43.0, -64.0 ], + [ -24.0, -48.0, -72.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..c813cf29c9cb --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_row_major.json @@ -0,0 +1,38 @@ +{ + "order": "row-major", + + "side": "right", + + "M": 4, + "N": 3, + + "V": [ 1.0, 2.0, 3.0, 4.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ 1.0, 5.0, 9.0 ], + [ 2.0, 6.0, 10.0 ], + [ 3.0, 7.0, 11.0 ], + [ 4.0, 8.0, 12.0 ] + ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ -18.0, -33.0, -48.0, -20.0, -38.0, -56.0, -22.0, -43.0, -64.0, -24.0, -48.0, -72.0 ], + "C_out_mat": [ + [ -18.0, -33.0, -48.0 ], + [ -20.0, -38.0, -56.0 ], + [ -22.0, -43.0, -64.0 ], + [ -24.0, -48.0, -72.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js index 99b5550097b4..d8e62d56f6d4 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js @@ -34,6 +34,10 @@ var LEFT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/left_lastv_eq_zero_row_m var LEFT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/left_lastv_eq_zero_col_major.json' ); var LEFT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/left_lastv_gt_zero_row_major.json' ); var LEFT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/left_lastv_gt_zero_col_major.json' ); +var RIGHT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/right_lastv_eq_zero_row_major.json' ); +var RIGHT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/right_lastv_eq_zero_col_major.json' ); +var RIGHT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/right_lastv_gt_zero_row_major.json' ); +var RIGHT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/right_lastv_gt_zero_col_major.json' ); // TESTS // @@ -279,3 +283,87 @@ tape( 'the function expected value for left side, lastv > 0 (column-major)', fun t.deepEqual( out, expectedC, 'returns expected value' ); t.end(); }); + +tape( 'the function expected value for right side, lastv = 0 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv = 0 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv > 0 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv > 0 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); From b4ac3f456c66e69e029961758332747bfdbed9ec Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Thu, 3 Jul 2025 09:08:16 +0000 Subject: [PATCH 08/17] test: add tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: 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/dlarf1f/lib/base.js | 9 +++------ .../test/fixtures/right_lastv_eq_zero_col_major.json | 4 ++-- .../test/fixtures/right_lastv_eq_zero_row_major.json | 4 ++-- .../test/fixtures/right_lastv_gt_zero_col_major.json | 4 ++-- .../test/fixtures/right_lastv_gt_zero_row_major.json | 4 ++-- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js index 8031a3001586..2fc67bc6ea69 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js @@ -82,13 +82,10 @@ function dlarf1f( side, M, N, V, strideV, offsetV, tau, C, strideC1, strideC2, o lastv = N; } - // check here - if ( strideV > 0 ) { - i = offsetV + ( ( lastv - 1 ) * strideV ); - } else { - i = offsetV; - } + // i points to the last element in V + i = offsetV + ( ( lastv - 1 ) * strideV ); + // Move i to the last non-zero element in V while ( lastv > 0 && V[ i ] === 0.0 ) { lastv -= 1; i -= strideV; diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_col_major.json index 204dd1e5a5db..2c21c3d3e410 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_col_major.json @@ -6,7 +6,7 @@ "M": 4, "N": 3, - "V": [ 0.0, 0.0, 0.0, 0.0 ], + "V": [ 0.0, 0.0, 0.0 ], "strideV": 1, "offsetV": 0, @@ -24,7 +24,7 @@ [ 4.0, 8.0, 12.0 ] ], - "work": [ 0.0, 0.0, 0.0 ], + "work": [ 0.0, 0.0, 0.0, 0.0 ], "strideWork": 1, "offsetWork": 0, diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_row_major.json index 8ed3a15f200c..dd34349079e5 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_row_major.json @@ -6,7 +6,7 @@ "M": 4, "N": 3, - "V": [ 0.0, 0.0, 0.0, 0.0 ], + "V": [ 0.0, 0.0, 0.0 ], "strideV": 1, "offsetV": 0, @@ -24,7 +24,7 @@ [ 4.0, 8.0, 12.0 ] ], - "work": [ 0.0, 0.0, 0.0 ], + "work": [ 0.0, 0.0, 0.0, 0.0 ], "strideWork": 1, "offsetWork": 0, diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_col_major.json index bd818cd04059..a2e361ce3d26 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_col_major.json @@ -6,7 +6,7 @@ "M": 4, "N": 3, - "V": [ 1.0, 2.0, 3.0, 4.0 ], + "V": [ 1.0, 2.0, 3.0 ], "strideV": 1, "offsetV": 0, @@ -24,7 +24,7 @@ [ 4.0, 8.0, 12.0 ] ], - "work": [ 0.0, 0.0, 0.0 ], + "work": [ 0.0, 0.0, 0.0, 0.0 ], "strideWork": 1, "offsetWork": 0, diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_row_major.json index c813cf29c9cb..d0c2d710718a 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_row_major.json @@ -6,7 +6,7 @@ "M": 4, "N": 3, - "V": [ 1.0, 2.0, 3.0, 4.0 ], + "V": [ 1.0, 2.0, 3.0 ], "strideV": 1, "offsetV": 0, @@ -24,7 +24,7 @@ [ 4.0, 8.0, 12.0 ] ], - "work": [ 0.0, 0.0, 0.0 ], + "work": [ 0.0, 0.0, 0.0, 0.0 ], "strideWork": 1, "offsetWork": 0, From cc7f34745a97c4f329352ff2933dab2aa40eb561 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Thu, 3 Jul 2025 09:28:00 +0000 Subject: [PATCH 09/17] test: add ndarray tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: 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/dlarf1f/test/test.ndarray.js | 204 +++++++++++++++++- 1 file changed, 203 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js index 4a02c609259f..2a2ed800644f 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable max-len */ +/* eslint-disable max-len, id-length */ 'use strict'; @@ -27,6 +27,19 @@ var Float64Array = require( '@stdlib/array/float64' ); var dlarf1f = require( './../lib/ndarray.js' ); +// FIXTURES // + +var TAU_EQ_ZERO = require( './fixtures/tau_eq_zero.json' ); +var LEFT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/left_lastv_eq_zero_row_major.json' ); +var LEFT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/left_lastv_eq_zero_col_major.json' ); +var LEFT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/left_lastv_gt_zero_row_major.json' ); +var LEFT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/left_lastv_gt_zero_col_major.json' ); +var RIGHT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/right_lastv_eq_zero_row_major.json' ); +var RIGHT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/right_lastv_eq_zero_col_major.json' ); +var RIGHT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/right_lastv_gt_zero_row_major.json' ); +var RIGHT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/right_lastv_gt_zero_col_major.json' ); + + // TESTS // tape( 'main export is a function', function test( t ) { @@ -78,3 +91,192 @@ tape( 'the function throws an error if provided a first argument which is not a }; } }); + +tape( 'the function returns the array unchanged if tau is zero', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = TAU_EQ_ZERO; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv = 0 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv = 0 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv > 0 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv > 0 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv = 0 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv = 0 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv > 0 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv > 0 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); From 5ac3c1b5ad4e83e9d6cc90f283a98d0fe2679459 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Sat, 5 Jul 2025 18:54:17 +0000 Subject: [PATCH 10/17] test: add ndarray tests --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: 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 --- --- .../left_lastv_eq_zero_col_major.json | 129 ++++ .../left_lastv_eq_zero_row_major.json | 129 ++++ .../left_lastv_gt_zero_col_major.json | 129 ++++ .../left_lastv_gt_zero_row_major.json | 129 ++++ .../right_lastv_eq_zero_col_major.json | 129 ++++ .../right_lastv_eq_zero_row_major.json | 129 ++++ .../right_lastv_gt_zero_col_major.json | 129 ++++ .../right_lastv_gt_zero_row_major.json | 129 ++++ .../left_lastv_eq_zero_col_major.json | 98 +++ .../left_lastv_eq_zero_row_major.json | 98 +++ .../left_lastv_gt_zero_col_major.json | 98 +++ .../left_lastv_gt_zero_row_major.json | 98 +++ .../right_lastv_eq_zero_col_major.json | 98 +++ .../right_lastv_eq_zero_row_major.json | 98 +++ .../right_lastv_gt_zero_col_major.json | 98 +++ .../right_lastv_gt_zero_row_major.json | 98 +++ .../left_lastv_eq_zero_col_major.json | 98 +++ .../left_lastv_eq_zero_row_major.json | 98 +++ .../left_lastv_gt_zero_col_major.json | 98 +++ .../left_lastv_gt_zero_row_major.json | 98 +++ .../right_lastv_eq_zero_col_major.json | 98 +++ .../right_lastv_eq_zero_row_major.json | 98 +++ .../right_lastv_gt_zero_col_major.json | 98 +++ .../right_lastv_gt_zero_row_major.json | 98 +++ .../offsets/left_lastv_eq_zero_col_major.json | 102 +++ .../offsets/left_lastv_eq_zero_row_major.json | 102 +++ .../offsets/left_lastv_gt_zero_col_major.json | 102 +++ .../offsets/left_lastv_gt_zero_row_major.json | 102 +++ .../right_lastv_eq_zero_col_major.json | 102 +++ .../right_lastv_eq_zero_row_major.json | 102 +++ .../right_lastv_gt_zero_col_major.json | 102 +++ .../right_lastv_gt_zero_row_major.json | 102 +++ .../lapack/base/dlarf1f/test/test.ndarray.js | 712 ++++++++++++++++++ 33 files changed, 4128 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_eq_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_eq_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_gt_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_gt_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_eq_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_eq_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_gt_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_gt_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_eq_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_eq_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_gt_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_gt_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_eq_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_eq_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_gt_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_gt_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_eq_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_eq_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_gt_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_gt_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_eq_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_eq_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_gt_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_gt_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_eq_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_eq_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_gt_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_gt_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_eq_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_eq_zero_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_gt_zero_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_gt_zero_row_major.json diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..f230201852fb --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_eq_zero_col_major.json @@ -0,0 +1,129 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 4, + 9999, + 7, + 9999, + 10, + 9999, + 2, + 9999, + 5, + 9999, + 8, + 9999, + 11, + 9999, + 3, + 9999, + 6, + 9999, + 9, + 9999, + 12, + 9999 + ], + "strideC1": 2, + "strideC2": 8, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + 0.5, + 9999, + 4, + 9999, + 7, + 9999, + 10, + 9999, + 1, + 9999, + 5, + 9999, + 8, + 9999, + 11, + 9999, + 1.5, + 9999, + 6, + 9999, + 9, + 9999, + 12, + 9999 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..9a3f0e99e8b4 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_eq_zero_row_major.json @@ -0,0 +1,129 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999, + 10, + 9999, + 11, + 9999, + 12, + 9999 + ], + "strideC1": 6, + "strideC2": 2, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + 0.5, + 9999, + 1, + 9999, + 1.5, + 9999, + 4, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999, + 10, + 9999, + 11, + 9999, + 12, + 9999 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..be21a7c01c07 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_gt_zero_col_major.json @@ -0,0 +1,129 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999, + 10, + 9999, + 11, + 9999, + 12, + 9999 + ], + "strideC1": 2, + "strideC2": 8, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + -14, + 9999, + -28, + 9999, + -42, + 9999, + -56, + 9999, + -30, + 9999, + -64, + 9999, + -98, + 9999, + -132, + 9999, + -46, + 9999, + -100, + 9999, + -154, + 9999, + -208, + 9999 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..e0ce8e88131b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_gt_zero_row_major.json @@ -0,0 +1,129 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 5, + 9999, + 9, + 9999, + 2, + 9999, + 6, + 9999, + 10, + 9999, + 3, + 9999, + 7, + 9999, + 11, + 9999, + 4, + 9999, + 8, + 9999, + 12, + 9999 + ], + "strideC1": 6, + "strideC2": 2, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + -14, + 9999, + -30, + 9999, + -46, + 9999, + -28, + 9999, + -64, + 9999, + -100, + 9999, + -42, + 9999, + -98, + 9999, + -154, + 9999, + -56, + 9999, + -132, + 9999, + -208, + 9999 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..eb77bfacd104 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_eq_zero_col_major.json @@ -0,0 +1,129 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999, + 10, + 9999, + 11, + 9999, + 12, + 9999 + ], + "strideC1": 2, + "strideC2": 8, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + 0.5, + 9999, + 1, + 9999, + 1.5, + 9999, + 2, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999, + 10, + 9999, + 11, + 9999, + 12, + 9999 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..9b22037de65e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_eq_zero_row_major.json @@ -0,0 +1,129 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 5, + 9999, + 9, + 9999, + 2, + 9999, + 6, + 9999, + 10, + 9999, + 3, + 9999, + 7, + 9999, + 11, + 9999, + 4, + 9999, + 8, + 9999, + 12, + 9999 + ], + "strideC1": 6, + "strideC2": 2, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + 0.5, + 9999, + 5, + 9999, + 9, + 9999, + 1, + 9999, + 6, + 9999, + 10, + 9999, + 1.5, + 9999, + 7, + 9999, + 11, + 9999, + 2, + 9999, + 8, + 9999, + 12, + 9999 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..9a2cd1b9f764 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_gt_zero_col_major.json @@ -0,0 +1,129 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 1, + 9999, + 2, + 9999, + 3, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999, + 10, + 9999, + 11, + 9999, + 12, + 9999 + ], + "strideC1": 2, + "strideC2": 8, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + -18, + 9999, + -20, + 9999, + -22, + 9999, + -24, + 9999, + -33, + 9999, + -38, + 9999, + -43, + 9999, + -48, + 9999, + -48, + 9999, + -56, + 9999, + -64, + 9999, + -72, + 9999 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..81bce5049109 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_gt_zero_row_major.json @@ -0,0 +1,129 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 1, + 9999, + 2, + 9999, + 3, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 5, + 9999, + 9, + 9999, + 2, + 9999, + 6, + 9999, + 10, + 9999, + 3, + 9999, + 7, + 9999, + 11, + 9999, + 4, + 9999, + 8, + 9999, + 12, + 9999 + ], + "strideC1": 6, + "strideC2": 2, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + -18, + 9999, + -33, + 9999, + -48, + 9999, + -20, + 9999, + -38, + 9999, + -56, + 9999, + -22, + 9999, + -43, + 9999, + -64, + 9999, + -24, + 9999, + -48, + 9999, + -72, + 9999 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..8d856581319a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_eq_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 3, + 6, + 9, + 12, + 2, + 5, + 8, + 11, + 1, + 4, + 7, + 10 + ], + "strideC1": 1, + "strideC2": -4, + "offsetC": 8, + "LDC": 4, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + 1.5, + 6, + 9, + 12, + 1, + 5, + 8, + 11, + 0.5, + 4, + 7, + 10 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..6a316d1569be --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_eq_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 10, + 11, + 12, + 7, + 8, + 9, + 4, + 5, + 6, + 1, + 2, + 3 + ], + "strideC1": -3, + "strideC2": 1, + "offsetC": 9, + "LDC": 3, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + 10, + 11, + 12, + 7, + 8, + 9, + 4, + 5, + 6, + 0.5, + 1, + 1.5 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..8b4550d38780 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_gt_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 1, + 2, + 3, + 4 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 9, + 10, + 11, + 12, + 5, + 6, + 7, + 8, + 1, + 2, + 3, + 4 + ], + "strideC1": 1, + "strideC2": -4, + "offsetC": 8, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + -46, + -100, + -154, + -208, + -30, + -64, + -98, + -132, + -14, + -28, + -42, + -56 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..096a533a3e7b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_gt_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 1, + 2, + 3, + 4 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 4, + 8, + 12, + 3, + 7, + 11, + 2, + 6, + 10, + 1, + 5, + 9 + ], + "strideC1": -3, + "strideC2": 1, + "offsetC": 9, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + -56, + -132, + -208, + -42, + -98, + -154, + -28, + -64, + -100, + -14, + -30, + -46 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..1653651cc96b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_eq_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 9, + 10, + 11, + 12, + 5, + 6, + 7, + 8, + 1, + 2, + 3, + 4 + ], + "strideC1": 1, + "strideC2": -4, + "offsetC": 8, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + 9, + 10, + 11, + 12, + 5, + 6, + 7, + 8, + 0.5, + 1, + 1.5, + 2 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..f66f8e40614c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_eq_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 4, + 8, + 12, + 3, + 7, + 11, + 2, + 6, + 10, + 1, + 5, + 9 + ], + "strideC1": -3, + "strideC2": 1, + "offsetC": 9, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + 2, + 8, + 12, + 1.5, + 7, + 11, + 1, + 6, + 10, + 0.5, + 5, + 9 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..aad7f7861cdd --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_gt_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 1, + 2, + 3 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 9, + 10, + 11, + 12, + 5, + 6, + 7, + 8, + 1, + 2, + 3, + 4 + ], + "strideC1": 1, + "strideC2": -4, + "offsetC": 8, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + -48, + -56, + -64, + -72, + -33, + -38, + -43, + -48, + -18, + -20, + -22, + -24 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..662548dc8f0a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_gt_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 1, + 2, + 3 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 4, + 8, + 12, + 3, + 7, + 11, + 2, + 6, + 10, + 1, + 5, + 9 + ], + "strideC1": -3, + "strideC2": 1, + "offsetC": 9, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + -24, + -48, + -72, + -22, + -43, + -64, + -20, + -38, + -56, + -18, + -33, + -48 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..322908914c72 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_eq_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0, + 0 + ], + "strideV": -1, + "offsetV": 3, + "tau": 0.5, + "C": [ + 12, + 9, + 6, + 3, + 11, + 8, + 5, + 2, + 10, + 7, + 4, + 1 + ], + "strideC1": -1, + "strideC2": -4, + "offsetC": 11, + "LDC": 4, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 2, + "C_out": [ + 12, + 9, + 6, + 1.5, + 11, + 8, + 5, + 1, + 10, + 7, + 4, + 0.5 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..b41eef4ac9c5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_eq_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0, + 0 + ], + "strideV": -1, + "offsetV": 3, + "tau": 0.5, + "C": [ + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + "strideC1": -3, + "strideC2": -1, + "offsetC": 11, + "LDC": 3, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 2, + "C_out": [ + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 1.5, + 1, + 0.5 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..3f885d50ed5a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_gt_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 4, + 3, + 2, + 1 + ], + "strideV": -1, + "offsetV": 3, + "tau": 0.5, + "C": [ + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + "strideC1": -1, + "strideC2": -4, + "offsetC": 11, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 2, + "C_out": [ + -208, + -154, + -100, + -46, + -132, + -98, + -64, + -30, + -56, + -42, + -28, + -14 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..c35a607c9556 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_gt_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 4, + 3, + 2, + 1 + ], + "strideV": -1, + "offsetV": 3, + "tau": 0.5, + "C": [ + 12, + 8, + 4, + 11, + 7, + 3, + 10, + 6, + 2, + 9, + 5, + 1 + ], + "strideC1": -3, + "strideC2": -1, + "offsetC": 11, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 2, + "C_out": [ + -208, + -132, + -56, + -154, + -98, + -42, + -100, + -64, + -28, + -46, + -30, + -14 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..454418019bfd --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_eq_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0 + ], + "strideV": -1, + "offsetV": 2, + "tau": 0.5, + "C": [ + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + "strideC1": -1, + "strideC2": -4, + "offsetC": 11, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 3, + "C_out": [ + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 2, + 1.5, + 1, + 0.5 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..aa43f90b21fc --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_eq_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0 + ], + "strideV": -1, + "offsetV": 2, + "tau": 0.5, + "C": [ + 12, + 8, + 4, + 11, + 7, + 3, + 10, + 6, + 2, + 9, + 5, + 1 + ], + "strideC1": -3, + "strideC2": -1, + "offsetC": 11, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 3, + "C_out": [ + 12, + 8, + 2, + 11, + 7, + 1.5, + 10, + 6, + 1, + 9, + 5, + 0.5 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..2b6a1c4f9362 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_gt_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 3, + 2, + 1 + ], + "strideV": -1, + "offsetV": 2, + "tau": 0.5, + "C": [ + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + "strideC1": -1, + "strideC2": -4, + "offsetC": 11, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 3, + "C_out": [ + -72, + -64, + -56, + -48, + -48, + -43, + -38, + -33, + -24, + -22, + -20, + -18 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..561a238b8f1e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_gt_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 3, + 2, + 1 + ], + "strideV": -1, + "offsetV": 2, + "tau": 0.5, + "C": [ + 12, + 8, + 4, + 11, + 7, + 3, + 10, + 6, + 2, + 9, + 5, + 1 + ], + "strideC1": -3, + "strideC2": -1, + "offsetC": 11, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 3, + "C_out": [ + -72, + -48, + -24, + -64, + -43, + -22, + -56, + -38, + -20, + -48, + -33, + -18 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..42f40da2e09b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_eq_zero_col_major.json @@ -0,0 +1,102 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 9999, + 0, + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 4, + 7, + 10, + 2, + 5, + 8, + 11, + 3, + 6, + 9, + 12 + ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 1, + "LDC": 4, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + 0.5, + 4, + 7, + 10, + 1, + 5, + 8, + 11, + 1.5, + 6, + 9, + 12 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..4befe77602d8 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_eq_zero_row_major.json @@ -0,0 +1,102 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 9999, + 0, + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 1, + "LDC": 3, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + 0.5, + 1, + 1.5, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..eddfa2e1c391 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_gt_zero_col_major.json @@ -0,0 +1,102 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 9999, + 1, + 2, + 3, + 4 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 1, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + -14, + -28, + -42, + -56, + -30, + -64, + -98, + -132, + -46, + -100, + -154, + -208 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..2f95e1b1e4a5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_gt_zero_row_major.json @@ -0,0 +1,102 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 9999, + 1, + 2, + 3, + 4 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 5, + 9, + 2, + 6, + 10, + 3, + 7, + 11, + 4, + 8, + 12 + ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 1, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + -14, + -30, + -46, + -28, + -64, + -100, + -42, + -98, + -154, + -56, + -132, + -208 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..6a21255deca5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_eq_zero_col_major.json @@ -0,0 +1,102 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 9999, + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 1, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + 0.5, + 1, + 1.5, + 2, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..dd21b4750c5e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_eq_zero_row_major.json @@ -0,0 +1,102 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 9999, + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 5, + 9, + 2, + 6, + 10, + 3, + 7, + 11, + 4, + 8, + 12 + ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 1, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + 0.5, + 5, + 9, + 1, + 6, + 10, + 1.5, + 7, + 11, + 2, + 8, + 12 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..8e03d1dc0430 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_gt_zero_col_major.json @@ -0,0 +1,102 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 9999, + 1, + 2, + 3 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 1, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + -18, + -20, + -22, + -24, + -33, + -38, + -43, + -48, + -48, + -56, + -64, + -72 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..646dacef2538 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_gt_zero_row_major.json @@ -0,0 +1,102 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 9999, + 1, + 2, + 3 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 5, + 9, + 2, + 6, + 10, + 3, + 7, + 11, + 4, + 8, + 12 + ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 1, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + -18, + -33, + -48, + -20, + -38, + -56, + -22, + -43, + -64, + -24, + -48, + -72 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js index 2a2ed800644f..2b26ee36112a 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js @@ -39,6 +39,46 @@ var RIGHT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/right_lastv_eq_zero_col var RIGHT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/right_lastv_gt_zero_row_major.json' ); var RIGHT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/right_lastv_gt_zero_col_major.json' ); +var MIXED_STRIDES_RIGHT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/mixed_strides/right_lastv_gt_zero_row_major.json' ); +var NEGATIVE_STRIDES_RIGHT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/negative_strides/right_lastv_gt_zero_row_major.json' ); +var LARGE_STRIDES_RIGHT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/large_strides/right_lastv_gt_zero_row_major.json' ); +var OFFSETS_RIGHT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/offsets/right_lastv_gt_zero_row_major.json' ); + +var NEGATIVE_STRIDES_RIGHT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/negative_strides/right_lastv_gt_zero_col_major.json' ); +var MIXED_STRIDES_RIGHT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/mixed_strides/right_lastv_gt_zero_col_major.json' ); +var LARGE_STRIDES_RIGHT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/large_strides/right_lastv_gt_zero_col_major.json' ); +var OFFSETS_RIGHT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/offsets/right_lastv_gt_zero_col_major.json' ); + +var MIXED_STRIDES_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/mixed_strides/right_lastv_eq_zero_row_major.json' ); +var NEGATIVE_STRIDES_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/negative_strides/right_lastv_eq_zero_row_major.json' ); +var LARGE_STRIDES_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/large_strides/right_lastv_eq_zero_row_major.json' ); +var OFFSETS_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/offsets/right_lastv_eq_zero_row_major.json' ); + +var NEGATIVE_STRIDES_RIGHT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/negative_strides/right_lastv_eq_zero_col_major.json' ); +var MIXED_STRIDES_RIGHT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/mixed_strides/right_lastv_eq_zero_col_major.json' ); +var LARGE_STRIDES_RIGHT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/large_strides/right_lastv_eq_zero_col_major.json' ); +var OFFSETS_RIGHT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/offsets/right_lastv_eq_zero_col_major.json' ); + +var NEGATIVE_STRIDES_LEFT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/negative_strides/left_lastv_gt_zero_row_major.json' ); +var MIXED_STRIDES_LEFT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/mixed_strides/left_lastv_gt_zero_row_major.json' ); +var LARGE_STRIDES_LEFT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/large_strides/left_lastv_gt_zero_row_major.json' ); +var OFFSETS_LEFT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/offsets/left_lastv_gt_zero_row_major.json' ); + +var MIXED_STRIDES_LEFT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/mixed_strides/left_lastv_gt_zero_col_major.json' ); +var LARGE_STRIDES_LEFT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/large_strides/left_lastv_gt_zero_col_major.json' ); +var OFFSETS_LEFT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/offsets/left_lastv_gt_zero_col_major.json' ); +var NEGATIVE_STRIDES_LEFT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/negative_strides/left_lastv_gt_zero_col_major.json' ); + +var MIXED_STRIDES_LEFT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/mixed_strides/left_lastv_eq_zero_row_major.json' ); +var LARGE_STRIDES_LEFT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/large_strides/left_lastv_eq_zero_row_major.json' ); +var OFFSETS_LEFT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/offsets/left_lastv_eq_zero_row_major.json' ); +var NEGATIVE_STRIDES_LEFT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/negative_strides/left_lastv_eq_zero_row_major.json' ); + +var MIXED_STRIDES_LEFT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/mixed_strides/left_lastv_eq_zero_col_major.json' ); +var LARGE_STRIDES_LEFT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/large_strides/left_lastv_eq_zero_col_major.json' ); +var OFFSETS_LEFT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/offsets/left_lastv_eq_zero_col_major.json' ); +var NEGATIVE_STRIDES_LEFT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/negative_strides/left_lastv_eq_zero_col_major.json' ); + // TESTS // @@ -280,3 +320,675 @@ tape( 'the function expected value for right side, lastv > 0 (column-major)', fu t.deepEqual( out, expectedC, 'returns expected value' ); t.end(); }); + +tape( 'the function computes the expected value for right side, lastv > 0 (row-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_RIGHT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (row-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_RIGHT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (row-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_RIGHT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (row-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_RIGHT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (column-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_RIGHT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (column-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_RIGHT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (column-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_RIGHT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (column-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_RIGHT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (row-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (row-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (row-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (row-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (column-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_RIGHT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (column-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_RIGHT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (column-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_RIGHT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (column-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_RIGHT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (row-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_LEFT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (row-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_LEFT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (row-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_LEFT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (row-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_LEFT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (column-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_LEFT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (column-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_LEFT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (column-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_LEFT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (column-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_LEFT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (row-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_LEFT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (row-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_LEFT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (row-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_LEFT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (row-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_LEFT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (column-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_LEFT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (column-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_LEFT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (column-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_LEFT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (column-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_LEFT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); From 944bd459c247f7785a40c5d0d48396cfd4550e5f Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Sat, 5 Jul 2025 19:13:23 +0000 Subject: [PATCH 11/17] docs: add ts files --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../lapack/base/dlarf1f/docs/types/index.d.ts | 127 ++++++ .../lapack/base/dlarf1f/docs/types/test.ts | 422 ++++++++++++++++++ 2 files changed, 549 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/test.ts diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/index.d.ts new file mode 100644 index 000000000000..374f15b4a37f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/index.d.ts @@ -0,0 +1,127 @@ +/* +* @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 + +/** +* Must be either `'left'` or `'right'`. +*/ +type Side = 'left' | 'right'; + +/** +* Interface describing `dlarf1f`. +*/ +interface Routine { + /** + * Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. + * + * @param side - use `left` to form `H * C` and `right` to from `C * H` + * @param M - number of rows in `C` + * @param N - number of columns in `C` + * @param V - the vector `v` in the representation of `H` + * @param incv - stride length for `V` + * @param tau - the value of `tau` in representation of `H` + * @param C - input matrix + * @param ldc - leading dimension of `C` + * @param work - workspace array + * @returns `C * H` or `H * C` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); + * var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); + * var work = new Float64Array( 3 ); + * + * dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, work ); + * // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] + */ + ( side: Side, M: number, N: number, V: Float64Array, incv: number, tau: number, C: Float64Array, ldc: number, work: Float64Array ): Float64Array; + + /** + * Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C` using alternative indexing semantics. + * + * @param side - use `left` to form `H * C` and `right` to from `C * H` + * @param M - number of rows in `C` + * @param N - number of columns in `C` + * @param V - the vector `v` in the representation of `H` + * @param strideV - stride length for `V` + * @param offsetV - starting index for `V` + * @param tau - the value of `tau` in representation of `H` + * @param C - input matrix + * @param strideC1 - stride of the first dimension of `C` + * @param strideC2 - stride of the second dimension of `C` + * @param offsetC - starting index for `C` + * @param work - workspace array + * @param strideWork - stride length for `work` + * @param offsetWork - starting index for `work` + * @returns `C * H` or `H * C` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); + * var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); + * var work = new Float64Array( 3 ); + * + * dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); + * // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] + */ + ndarray( side: Side, M: number, N: number, V: Float64Array, strideV: number, offsetV: number, tau: number, C: Float64Array, strideC1: number, strideC2: number, offsetC: number, work: Float64Array, strideWork: number, offsetWork: number ): Float64Array; +} + +/** +* Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. +* +* @param side - use `left` to form `H * C` and `right` to from `C * H` +* @param M - number of rows in `C` +* @param N - number of columns in `C` +* @param V - the vector `v` in the representation of `H` +* @param incv - stride length for `V` +* @param tau - the value of `tau` in representation of `H` +* @param C - input matrix +* @param ldc - leading dimension of `C` +* @param work - workspace array +* @returns `C * H` or `H * C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +* var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +* var work = new Float64Array( 3 ); +* +* dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, work ); +* // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +* var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +* var work = new Float64Array( 3 ); +* +* dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); +* // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +*/ +declare var dlarf1f: Routine; + + +// EXPORTS // + +export = dlarf1f; diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/test.ts b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/test.ts new file mode 100644 index 000000000000..2a94efd1f844 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/test.ts @@ -0,0 +1,422 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import dlarf1f = require( './index' ); + + +// TESTS // + +// The function returns a Float64Array... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 5, 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( true, 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( false, 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( null, 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( void 0, 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( [], 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( {}, 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( ( x: number ): number => x, 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', '5', 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', true, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', false, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', null, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', void 0, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', [], 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', {}, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', ( x: number ): number => x, 3, V, 1, 1.0, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', 4, '5', V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, true, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, false, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, null, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, void 0, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, [], V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, {}, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, ( x: number ): number => x, V, 1, 1.0, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a Float64Array... +{ + const C = new Float64Array( 12 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', 4, 3, '5', 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, 5, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, true, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, false, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, null, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, void 0, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, [], 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, {}, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, ( x: number ): number => x, 1, 1.0, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', 4, 3, V, '5', 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, true, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, false, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, null, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, void 0, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, [], 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, {}, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, ( x: number ): number => x, 1.0, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', 4, 3, V, 1, '5', C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, true, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, false, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, null, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, void 0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, [], C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, {}, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, ( x: number ): number => x, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a Float64Array... +{ + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', 4, 3, V, 1, 1.0, '5', 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, 5, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, true, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, false, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, null, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, void 0, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, [], 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, {}, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, ( x: number ): number => x, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, '5', work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, true, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, false, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, null, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, void 0, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, [], work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, {}, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, ( x: number ): number => x, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a Float64Array... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, '5' ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, 5 ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, true ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, false ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, null ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, void 0 ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, [] ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, {} ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f(); // $ExpectError + dlarf1f( 'left' ); // $ExpectError + dlarf1f( 'left', 4 ); // $ExpectError + dlarf1f( 'left', 4, 3 ); // $ExpectError + dlarf1f( 'left', 4, 3, V ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1 ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0 ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3 ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, work, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Float64Array... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a string... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 5, 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( true, 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( false, 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( null, 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( void 0, 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( [], 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( {}, 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( ( x: number ): number => x, 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', '5', 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', true, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', false, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', null, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', void 0, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', [], 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', {}, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', ( x: number ): number => x, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, '5', V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, true, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, false, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, null, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, void 0, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, [], V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, {}, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, ( x: number ): number => x, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a Float64Array... +{ + const C = new Float64Array( 12 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, '5', 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, 5, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, true, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, false, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, null, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, void 0, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, [], 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, {}, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, ( x: number ): number => x, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, '5', 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, true, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, false, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, null, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, void 0, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, [], 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, {}, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, ( x: number ): number => x, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, '5', 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, true, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, false, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, null, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, void 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, [], 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, {}, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, ( x: number ): number => x, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, '5', C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, true, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, false, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, null, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, void 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, [], C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, {}, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, ( x: number ): number => x, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an eighth argument which is not a Float64Array... +{ + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, '5', 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, 5, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, true, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, false, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, null, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, void 0, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, [], 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, {}, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, ( x: number ): number => x, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a ninth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, '5', 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, true, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, false, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, null, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, void 0, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, [], 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, {}, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, ( x: number ): number => x, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a tenth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, '5', 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, true, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, false, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, null, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, void 0, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, [], 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, {}, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, ( x: number ): number => x, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an eleventh argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, '5', work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, true, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, false, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, null, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, void 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, [], work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, {}, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, ( x: number ): number => x, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a twelfth argument which is not a Float64Array... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, '5', 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, 5, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, true, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, false, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, null, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, void 0, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, [], 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, {}, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a thirteenth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, '5', 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, true, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, false, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, null, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, void 0, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, [], 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, {}, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourteenth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, '5' ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, true ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, false ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, null ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, void 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, [] ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, {} ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray(); // $ExpectError + dlarf1f.ndarray( 'left' ); // $ExpectError + dlarf1f.ndarray( 'left', 4 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0, 10 ); // $ExpectError +} From 7e044600d3bb005ed6e384f3a1d953971d1871ae Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Sun, 6 Jul 2025 01:18:33 +0530 Subject: [PATCH 12/17] 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: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - 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 --- --- .../lapack/base/dlarf1f/examples/index.js | 41 +++++++++++ .../lapack/base/dlarf1f/lib/dlarf1f.js | 2 +- .../@stdlib/lapack/base/dlarf1f/package.json | 69 +++++++++++++++++++ 3 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/examples/index.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/package.json diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/examples/index.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/examples/index.js new file mode 100644 index 000000000000..3a4d17bc6a8c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/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 Float64Array = require( '@stdlib/array/float64' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var dlarf1f = require( './../lib' ); + +// Specify matrix meta data: +var shape = [ 4, 3 ]; +var order = 'row-major'; +var strides = shape2strides( shape, order ); + +// Create a matrix stored in linear memory: +var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +console.log( ndarray2array( C, shape, strides, 0, order ) ); + +// Define the vector `v` and workspace array: +var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +var work = new Float64Array( 3 ); + +// Apply the elementary reflector: +dlarf1f( order, 'left', shape[ 0 ], shape[ 1 ], V, 1, 1.0, C, strides[ 0 ], work ); +console.log( ndarray2array( C, shape, strides, 0, order ) ); diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js index 2c8b5ddfbaa1..aa563c71859a 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js @@ -63,7 +63,7 @@ var base = require( './base.js' ); * var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); * var work = new Float64Array( 3 ); * -* var out = dlarf1f( 'row-major', 'left', 4, 3, V, 1, 1.0, C, 3, work ); +* var out = dlarf1f( 'row-major', 'left', 4, 3, V, 1, 1.0, C, 3, work ); * // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] */ function dlarf1f( order, side, M, N, V, incv, tau, C, LDC, work ) { diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/package.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/package.json new file mode 100644 index 000000000000..38ac47aeb9f4 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/package.json @@ -0,0 +1,69 @@ +{ + "name": "@stdlib/lapack/base/dlarf1f", + "version": "0.0.0", + "description": "LAPACK routine to apply a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`.", + "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", + "dlarf1f", + "reflector", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "matrix", + "float64", + "double", + "float64array" + ] +} From 848889c381a98529340fd68992c05c7a0f8a45d8 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Sat, 5 Jul 2025 20:39:15 +0000 Subject: [PATCH 13/17] bench: add benchmarks --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../base/dlarf1f/benchmark/benchmark.js | 127 ++++++++++++++++ .../dlarf1f/benchmark/benchmark.ndarray.js | 141 ++++++++++++++++++ 2 files changed, 268 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.ndarray.js diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.js new file mode 100644 index 000000000000..c1c5be2014c2 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.js @@ -0,0 +1,127 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var Float64Array = require( '@stdlib/array/float64' ); +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 dlarf1f = require( './../lib/dlarf1f.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; +var SIDES = [ + 'left', + 'right' +]; +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 {string} side - specifies the side (left or right) +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N, side ) { + var work = new Float64Array( N ); + var C = discreteUniform( N*N, 1.0, 10.0, opts ); + var V = new Float64Array( N ); + V[ N-1 ] = 1.0; // keeping only the last element non zero to ensure maximum iterations but minimum overflow + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + var z; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dlarf1f( order, side, N, N, V, 1, 1.0, C, N, work ); + 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 side; + 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 ( j = 0; j < SIDES.length; j++ ) { + side = SIDES[ j ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N, side ); + bench( pkg+'::square_matrix:order='+ord+',side='+side+',size='+(N*N), f ); + } + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..1358705d29bb --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.ndarray.js @@ -0,0 +1,141 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var Float64Array = require( '@stdlib/array/float64' ); +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 dlarf1f = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; +var SIDES = [ + 'left', + 'right' +]; +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 {string} side - specifies the side (left or right) +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N, side ) { + var work; + var sc1; + var sc2; + var C; + var V; + + work = new Float64Array( N ); + C = discreteUniform( N*N, 1.0, 10.0, opts ); + V = new Float64Array( N ); + V[ N-1 ] = 1.0; // keeping only the last element non zero to ensure maximum iterations but minimum overflow + if ( isColumnMajor( order ) ) { + sc1 = 1; + sc2 = N; + } else { // order === 'row-major' + sc1 = N; + sc2 = 1; + } + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + var z; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dlarf1f( side, N, N, V, 1, 0, 1.0, C, sc1, sc2, 0, work, 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 side; + 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 ( j = 0; j < SIDES.length; j++ ) { + side = SIDES[ j ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N, side ); + bench( pkg+'::square_matrix:order='+ord+',side='+side+',size='+(N*N), f ); + } + } + } +} + +main(); From 9bdf5a88688ed93b9c346fdc1e7f63dea7c71b77 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Sat, 5 Jul 2025 21:14:04 +0000 Subject: [PATCH 14/17] 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 --- --- .../@stdlib/lapack/base/dlarf1f/README.md | 316 ++++++++++++++++++ 1 file changed, 316 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/README.md diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/README.md b/lib/node_modules/@stdlib/lapack/base/dlarf1f/README.md new file mode 100644 index 000000000000..4251787f8643 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/README.md @@ -0,0 +1,316 @@ + + +# dlarf1f + +
+ +In linear algebra, a `Householder transformation` (or an `elementary reflector`) is a linear transformation that describes a reflection about a plane or a hyperplane containing the origin. + +
+ + + +> Apply a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. + +
+ +## Usage + +```javascript +var dlarf1f = require( '@stdlib/lapack/base/dlarf1f' ); +``` + +#### dlarf1f( order, side, M, N, V, incv, tau, C, LDC, work ) + +Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +var work = new Float64Array( 3 ); + +var out = dlarf1f( 'row-major', 'left', 4, 3, V, 1, 1.0, C, 3, work ); +// returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +``` + +The function has the following parameters: + +- **order**: storage layout. +- **side**: use `left` to form `H * C` and `right` to from `C * H`. +- **M**: number of rows in `C`. +- **N**: number of columns in `C`. +- **V**: the vector `v` in the representation of `H` as a [`Float64Array`][mdn-float64array]. +- **incv**: stride length for `V`. If `incv` is negative, the elements of `V` are accessed in reverse order. +- **tau**: the value of `tau` in representation of `H`. +- **C**: input matrix stored in linear memory as a [`Float64Array`][mdn-float64array]. +- **LDC**: stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`). +- **work**: workspace [`Float64Array`][mdn-float64array]. + +The sign of the increment parameter `incv` determines the order in which elements of `V` are accessed. For example, to access elements in reverse order, + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +var work = new Float64Array( 3 ); + +var out = dlarf1f( 'row-major', 'left', 4, 3, V, -1, 1.0, C, 3, work ); +// returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +``` + +To perform strided access over `V`, provide an `abs(incv)` value greater than one. For example, to access every other element in `V`, + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +var V = new Float64Array( [ 0.5, 999, 0.5, 999, 0.5, 999, 0.5 ] ); +var work = new Float64Array( 3 ); + +var out = dlarf1f( 'row-major', 'left', 4, 3, V, 2, 1.0, C, 3, work ); +// returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial arrays... +var C0 = new Float64Array( [ 0.0, 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +var V0 = new Float64Array( [ 0.0, 0.5, 0.5, 0.5, 0.5 ] ); +var work0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + +// Create offset views... +var C1 = new Float64Array( C0.buffer, C0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var V1 = new Float64Array( V0.buffer, V0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var work1 = new Float64Array( work0.buffer, work0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +var our = dlarf1f( 'row-major', 'left', 4, 3, V1, 1, 1.0, C1, 3, work1 ); +// C0 => [ 0.0, -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +``` + +#### dlarf1f.ndarray( side, M, N, V, sv, ov, tau, C, sc1, sc2, oc, work, sw, ow ) + +Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C` using alternative indexing semantics. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +var work = new Float64Array( 3 ); + +var out = dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); +// returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +``` + +The function has the following additional parameters: + +- **side**: use `left` to form `H * C` and `right` to from `C * H`. +- **M**: number of rows in `C`. +- **N**: number of columns in `C`. +- **V**: the vector `v` in the representation of `H` as a [`Float64Array`][mdn-float64array]. +- **sv**: stride length for `V`. +- **ov**: starting index for `V`. +- **tau**: the value of `tau` in representation of `H`. +- **C**: input matrix as a [`Float64Array`][mdn-float64array]. +- **sc1**: stride of the first dimension of `C`. +- **sc2**: stride of the second dimension of `C`. +- **oc**: starting index for `C`. +- **work**: workspace array as a [`Float64Array`][mdn-float64array]. +- **sw**: stride length for `work`. +- **ow**: starting index for `work`. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var C = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +var V = new Float64Array( [ 0.0, 0.0, 0.5, 0.5, 0.5, 0.5 ] ); +var work = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + +var out = dlarf1f.ndarray( 'left', 4, 3, V, 1, 2, 1.0, C, 3, 1, 4, work, 1, 0 ); +// C => [ 0.0, 0.0, 0.0, 0.0, -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +``` + +
+ + + +
+ +## Notes + +- `work` should have `N` indexed elements if side = `left` and `M` indexed elements if side = `right`. +- `V` should have `1 + (M-1) * abs(incv)` indexed elements if side = `left` and `1 + (N-1) * abs(incv)` indexed elements if side = `right`. +- `C` is overwritten by `H * C` if side = `left` and `C * H` if side = `right`. +- `dlarf1f()` corresponds to the [LAPACK][LAPACK] function [`dlarf1f`][lapack-dlarf1f]. + +
+ + + +
+ +## Examples + + + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var dlarf1f = require( '@stdlib/lapack/base/dlarf1f' ); + +// Specify matrix meta data: +var shape = [ 4, 3 ]; +var order = 'row-major'; +var strides = shape2strides( shape, order ); + +// Create a matrix stored in linear memory: +var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +console.log( ndarray2array( C, shape, strides, 0, order ) ); + +// Define the vector `v` and workspace array: +var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +var work = new Float64Array( 3 ); + +// Apply the elementary reflector: +dlarf1f( order, 'left', shape[ 0 ], shape[ 1 ], V, 1, 1.0, C, strides[ 0 ], work ); +console.log( ndarray2array( C, shape, strides, 0, order ) ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + From d765274f02110d1dce4893efddb673ac7e7982e5 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Sat, 5 Jul 2025 21:30:37 +0000 Subject: [PATCH 15/17] docs: add 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 --- --- .../@stdlib/lapack/base/dlarf1f/docs/repl.txt | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/repl.txt diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/repl.txt new file mode 100644 index 000000000000..b9bff09e7751 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/repl.txt @@ -0,0 +1,116 @@ + +{{alias}}( order, side, M, N, V, incv, tau, C, LDC, work ) + Applies a real elementary reflector `H = I - tau * v * v ^ T` + to a real M by N matrix `C`. + + Parameters + ---------- + order: string + Storage layout. Must be either 'row-major' or 'column-major'. + + side: string + Specifies whether to form `H * C` ('left') or + `C * H` ('right'). + + M: integer + Number of rows in `C`. + + N: integer + Number of columns in `C`. + + V: Float64Array + The vector `v` in the representation of `H`. + + incv: integer + Stride length for `V`. + + tau: number + The value of `tau` in representation of `H`. + + C: Float64Array + Input matrix. + + LDC: integer + Stride of the first dimension of `C` (a.k.a., leading + dimension of the matrix `C`). + + work: Float64Array + Workspace array. + + Returns + ------- + C: Float64Array + Output matrix. + + Examples + -------- + > var C = new {{alias:@stdlib/array/float64}}( [ 1.0, 3.0, 2.0, 4.0 ] ); + > var V = new {{alias:@stdlib/array/float64}}( [ 0.5, 0.5 ] ); + > var work = new {{alias:@stdlib/array/float64}}( 2 ); + > {{alias}}( 'row-major', 'left', 2, 2, V, 1, 1.0, C, 2, work ) + [ -1.0, -2.0, 1.0, 1.5 ] + + +{{alias}}.ndarray( side, M, N, V, sv, ov, tau, C, sc1, sc2, oc, work, sw, ow ) + Applies a real elementary reflector `H = I - tau * v * v ^ T` + to a real M by N matrix `C` using alternative indexing semantics. + + Parameters + ---------- + side: string + Specifies whether to form `H * C` ('left') or `C * H` ('right'). + + M: integer + Number of rows in `C`. + + N: integer + Number of columns in `C`. + + V: Float64Array + The vector `v` in the representation of `H`. + + sv: integer + Stride length for `V`. + + ov: integer + Starting index for `V`. + + tau: number + The value of `tau` in representation of `H`. + + C: Float64Array + Input matrix. + + sc1: integer + Stride of the first dimension of `C`. + + sc2: integer + Stride of the second dimension of `C`. + + oc: integer + Starting index for `C`. + + work: Float64Array + Workspace array. + + sw: integer + Stride length for `work`. + + ow: integer + Starting index for `work`. + + Returns + ------- + C: Float64Array + Output matrix. + + Examples + -------- + > var C = new {{alias:@stdlib/array/float64}}( [ 1.0, 3.0, 2.0, 4.0 ] ); + > var V = new {{alias:@stdlib/array/float64}}( [ 0.5, 0.5 ] ); + > var work = new {{alias:@stdlib/array/float64}}( 2 ); + > {{alias}}.ndarray( 'left', 2, 2, V, 1, 0, 1.0, C, 2, 1, 0, work, 1, 0 ) + [ -1.0, -2.0, 1.0, 1.5 ] + + See Also + -------- From 29ec29281f03e5cc35fe255738b28593c0107220 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Sun, 6 Jul 2025 04:14:12 +0000 Subject: [PATCH 16/17] chore: update copyright years --- .../@stdlib/lapack/base/dlarf1f/benchmark/benchmark.js | 2 +- .../@stdlib/lapack/base/dlarf1f/benchmark/benchmark.ndarray.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.js index c1c5be2014c2..c77192834718 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.ndarray.js index 1358705d29bb..37f920536611 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.ndarray.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 1b4bf6c0e2be3eac9361060d2455220c98c5605a Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Wed, 9 Jul 2025 07:54:22 +0000 Subject: [PATCH 17/17] chore: cleaning up --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/lapack/base/dlarf1f/README.md | 16 ++++++++++++---- .../@stdlib/lapack/base/dlarf1f/docs/repl.txt | 19 ++++++++++--------- .../lapack/base/dlarf1f/docs/types/index.d.ts | 6 +++--- .../lapack/base/dlarf1f/examples/index.js | 2 +- .../@stdlib/lapack/base/dlarf1f/lib/base.js | 2 +- .../lapack/base/dlarf1f/lib/dlarf1f.js | 2 +- .../lapack/base/dlarf1f/lib/ndarray.js | 2 +- 7 files changed, 29 insertions(+), 20 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/README.md b/lib/node_modules/@stdlib/lapack/base/dlarf1f/README.md index 4251787f8643..6e505279bbc5 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/README.md +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/README.md @@ -58,7 +58,7 @@ var out = dlarf1f( 'row-major', 'left', 4, 3, V, 1, 1.0, C, 3, work ); The function has the following parameters: - **order**: storage layout. -- **side**: use `left` to form `H * C` and `right` to from `C * H`. +- **side**: specifies the side of multiplication with `C`. Use `left` to form `H * C` and `right` to from `C * H`. - **M**: number of rows in `C`. - **N**: number of columns in `C`. - **V**: the vector `v` in the representation of `H` as a [`Float64Array`][mdn-float64array]. @@ -68,6 +68,11 @@ The function has the following parameters: - **LDC**: stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`). - **work**: workspace [`Float64Array`][mdn-float64array]. +Based on the `side` of multiplication, the expected storage of the array changes: + +- `work` should have `N` indexed elements if `side` = `left` and `M` indexed elements if `side` = `right`. +- `V` should have `1 + (M-1) * abs(incv)` indexed elements if `side` = `left` and `1 + (N-1) * abs(incv)` indexed elements if `side` = `right`. + The sign of the increment parameter `incv` determines the order in which elements of `V` are accessed. For example, to access elements in reverse order, @@ -138,7 +143,7 @@ var out = dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); The function has the following additional parameters: -- **side**: use `left` to form `H * C` and `right` to from `C * H`. +- **side**: specifies the side of multiplication with `C`. Use `left` to form `H * C` and `right` to from `C * H`. - **M**: number of rows in `C`. - **N**: number of columns in `C`. - **V**: the vector `v` in the representation of `H` as a [`Float64Array`][mdn-float64array]. @@ -153,6 +158,11 @@ The function has the following additional parameters: - **sw**: stride length for `work`. - **ow**: starting index for `work`. +Based on the `side` of multiplication, the expected storage of the array changes: + +- `work` should have `N` indexed elements if `side` = `left` and `M` indexed elements if `side` = `right`. +- `V` should have `1 + (M-1) * abs(incv)` indexed elements if `side` = `left` and `1 + (N-1) * abs(incv)` indexed elements if `side` = `right`. + 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, @@ -176,8 +186,6 @@ var out = dlarf1f.ndarray( 'left', 4, 3, V, 1, 2, 1.0, C, 3, 1, 4, work, 1, 0 ); ## Notes -- `work` should have `N` indexed elements if side = `left` and `M` indexed elements if side = `right`. -- `V` should have `1 + (M-1) * abs(incv)` indexed elements if side = `left` and `1 + (N-1) * abs(incv)` indexed elements if side = `right`. - `C` is overwritten by `H * C` if side = `left` and `C * H` if side = `right`. - `dlarf1f()` corresponds to the [LAPACK][LAPACK] function [`dlarf1f`][lapack-dlarf1f]. diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/repl.txt index b9bff09e7751..85077fc8f7ee 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/repl.txt +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/repl.txt @@ -1,7 +1,7 @@ {{alias}}( order, side, M, N, V, incv, tau, C, LDC, work ) - Applies a real elementary reflector `H = I - tau * v * v ^ T` - to a real M by N matrix `C`. + Applies a real elementary reflector `H = I - tau * v * v ^ T` to a + real M by N matrix `C`. Parameters ---------- @@ -9,8 +9,8 @@ Storage layout. Must be either 'row-major' or 'column-major'. side: string - Specifies whether to form `H * C` ('left') or - `C * H` ('right'). + Specifies the side of multiplication with `C`. Use `left` to form + `H * C` and `right` to from `C * H`. M: integer Number of rows in `C`. @@ -31,8 +31,8 @@ Input matrix. LDC: integer - Stride of the first dimension of `C` (a.k.a., leading - dimension of the matrix `C`). + Stride of the first dimension of `C` (a.k.a., leading dimension + of the matrix `C`). work: Float64Array Workspace array. @@ -52,13 +52,14 @@ {{alias}}.ndarray( side, M, N, V, sv, ov, tau, C, sc1, sc2, oc, work, sw, ow ) - Applies a real elementary reflector `H = I - tau * v * v ^ T` - to a real M by N matrix `C` using alternative indexing semantics. + Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real + M by N matrix `C` using alternative indexing semantics. Parameters ---------- side: string - Specifies whether to form `H * C` ('left') or `C * H` ('right'). + Specifies the side of multiplication with `C`. Use `left` to form + `H * C` and `right` to from `C * H`. M: integer Number of rows in `C`. diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/index.d.ts index 374f15b4a37f..406aa44c3609 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/index.d.ts @@ -30,7 +30,7 @@ interface Routine { /** * Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. * - * @param side - use `left` to form `H * C` and `right` to from `C * H` + * @param side - specifies the side of multiplication with `C`. Use `left` to form `H * C` and `right` to from `C * H`. * @param M - number of rows in `C` * @param N - number of columns in `C` * @param V - the vector `v` in the representation of `H` @@ -56,7 +56,7 @@ interface Routine { /** * Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C` using alternative indexing semantics. * - * @param side - use `left` to form `H * C` and `right` to from `C * H` + * @param side - specifies the side of multiplication with `C`. Use `left` to form `H * C` and `right` to from `C * H`. * @param M - number of rows in `C` * @param N - number of columns in `C` * @param V - the vector `v` in the representation of `H` @@ -88,7 +88,7 @@ interface Routine { /** * Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. * -* @param side - use `left` to form `H * C` and `right` to from `C * H` +* @param side - specifies the side of multiplication with `C`. Use `left` to form `H * C` and `right` to from `C * H`. * @param M - number of rows in `C` * @param N - number of columns in `C` * @param V - the vector `v` in the representation of `H` diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/examples/index.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/examples/index.js index 3a4d17bc6a8c..c85ee2419df8 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/examples/index.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/examples/index.js @@ -29,7 +29,7 @@ var order = 'row-major'; var strides = shape2strides( shape, order ); // Create a matrix stored in linear memory: -var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); // eslint-disable-line max-len console.log( ndarray2array( C, shape, strides, 0, order ) ); // Define the vector `v` and workspace array: diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js index 2fc67bc6ea69..1da894fe3c3c 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js @@ -42,7 +42,7 @@ var dscal = require( '@stdlib/blas/base/dscal' ).ndarray; * - `C` is overwritten by `H * C` if side = `left` and `C * H` if side = `right`. * * @private -* @param {string} side - use `left` to form `H * C` and `right` to from `C * H` +* @param {string} side - specifies the side of multiplication with `C`. Use `left` to form `H * C` and `right` to from `C * H`. * @param {NonNegativeInteger} M - number of rows in `C` * @param {NonNegativeInteger} N - number of columns in `C` * @param {Float64Array} V - the vector `v` in the representation of `H` diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js index aa563c71859a..499b785f6e13 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js @@ -41,7 +41,7 @@ var base = require( './base.js' ); * - `C` is overwritten by `H * C` if side = `left` and `C * H` if side = `right`. * * @param {string} order - storage layout -* @param {string} side - use `left` to form `H * C` and `right` to from `C * H` +* @param {string} side - specifies the side of multiplication with `C`. Use `left` to form `H * C` and `right` to from `C * H`. * @param {NonNegativeInteger} M - number of rows in `C` * @param {NonNegativeInteger} N - number of columns in `C` * @param {Float64Array} V - the vector `v` in the representation of `H` diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js index e338a9d1ed1a..08dc4db7c3eb 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js @@ -37,7 +37,7 @@ var base = require( './base.js' ); * - `V` should have `1 + (M-1) * abs(strideV)` indexed elements if side = `left` and `1 + (N-1) * abs(strideV)` indexed elements if side = `right`. * - `C` is overwritten by `H * C` if side = `left` and `C * H` if side = `right`. * -* @param {string} side - use `left` to form `H * C` and `right` to from `C * H` +* @param {string} side - specifies the side of multiplication with `C`. Use `left` to form `H * C` and `right` to from `C * H`. * @param {NonNegativeInteger} M - number of rows in `C` * @param {NonNegativeInteger} N - number of columns in `C` * @param {Float64Array} V - the vector `v` in the representation of `H`