From 2339ecb6e1debcc2b9aaeb7a8a3c805ed6ab1ad5 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 24 Jun 2025 00:38:44 +0000 Subject: [PATCH 01/13] feat: add lapack/base/dlaset --- 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/dlaset/lib/base.js | 237 ++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/lib/base.js diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dlaset/lib/base.js new file mode 100644 index 000000000000..596c0645ede6 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/lib/base.js @@ -0,0 +1,237 @@ +/** +* @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 isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var loopOrder = require( '@stdlib/ndarray/base/nullary-loop-interchange-order' ); +var min = require( '@stdlib/math/base/special/fast/min' ); + + +// FUNCTIONS // + +/** +* Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals, setting all of matrix `A`. +* +* @private +* @param {NonNegativeInteger} M - number of rows in matrix `A` +* @param {NonNegativeInteger} N - number of columns in matrix `A` +* @param {Float64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {number} alpha - number to set on off diagonal elements +* @param {number} beta - number to set on diagonal elements +* @returns {Float64Array} `A` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( 4 ); +* +* setAll( 2, 2, A, 2, 1, 0, 0.0, 1.0 ); +* // A => [ 1.0, 0.0, 0.0, 1.0 ] +*/ +function setAll( M, N, A, strideA1, strideA2, offsetA, alpha, beta ) { + var da0; + var da1; + var sh; + var S0; + var S1; + var sa; + var ia; + var i0; + var i1; + var o; + + // Resolve the loop interchange order: + o = loopOrder( [ M, N ], [ strideA1, strideA2 ] ); + sh = o.sh; + sa = o.sx; + + // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... + S0 = sh[ 0 ]; + S1 = sh[ 1 ]; + da0 = sa[ 0 ]; + da1 = sa[ 1 ] - ( S0*sa[0] ); + + // Set the pointers to the first indexed elements in the respective matrices... + ia = offsetA; + + // Iterate over the matrix dimensions... + for ( i1 = 0; i1 < S1; i1++ ) { + for ( i0 = 0; i0 < S0; i0++ ) { + A[ ia ] = alpha; + ia += da0; + } + ia += da1; + } + + ia = offsetA; + for ( i1 = 0; i1 < min( M, N ); i1++ ) { + A[ ia ] = beta; + ia += strideA1 + strideA2; + } + return A; +} + +/** +* Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals, setting upper triangular elements of `A`. +* +* @private +* @param {NonNegativeInteger} M - number of rows in matrix `A` +* @param {NonNegativeInteger} N - number of columns in matrix `A` +* @param {Float64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {number} alpha - number to set on off diagonal elements +* @param {number} beta - number to set on diagonal elements +* @returns {Float64Array} `A` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( 4 ); +* +* setUpper( 2, 2, A, 2, 1, 0, 1.0, 2.0 ); +* // A => [ 2.0, 1.0, 0.0, 2.0 ] +*/ +function setUpper( M, N, A, strideA1, strideA2, offsetA, alpha, beta ) { + var ia; + var i0; + var i1; + + ia = offsetA; + if ( isRowMajor( [ strideA1, strideA2 ] ) ) { + for ( i1 = 0; i1 < M; i1++ ) { + for ( i0 = i1; i0 < N; i0++ ) { + A[ ia+(i0*strideA2) ] = alpha; + } + ia += strideA1; + } + } else { + for ( i1 = 0; i1 < N; i1++ ) { + for ( i0 = 0; i0 <= min( i1, M-1 ); i0++ ) { + A[ ia+(i0*strideA1) ] = alpha; + } + ia += strideA2; + } + } + + ia = offsetA; + for ( i1 = 0; i1 < min( M, N ); i1++ ) { + A[ ia ] = beta; + ia += strideA1 + strideA2; + } + return A; +} + +/** +* Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals, setting upper triangular elements of `A`. +* +* @private +* @param {NonNegativeInteger} M - number of rows in matrix `A` +* @param {NonNegativeInteger} N - number of columns in matrix `A` +* @param {Float64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {number} alpha - number to set on off diagonal elements +* @param {number} beta - number to set on diagonal elements +* @returns {Float64Array} `A` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( 4 ); +* +* setLower( 2, 2, A, 2, 1, 0, 1.0, 2.0 ); +* // A => [ 2.0, 0.0, 1.0, 2.0 ] +*/ +function setLower( M, N, A, strideA1, strideA2, offsetA, alpha, beta ) { + var ia; + var i0; + var i1; + + ia = offsetA; + if ( isRowMajor( [ strideA1, strideA2 ] ) ) { + for ( i1 = 0; i1 < M; i1++ ) { + for ( i0 = 0; i0 <= min( i1, N-1 ); i0++ ) { + A[ ia+(i0*strideA2) ] = alpha; + } + ia += strideA1; + } + } else { + for ( i1 = 0; i1 < N; i1++ ) { + for ( i0 = i1; i0 < M; i0++ ) { + A[ ia+(i0*strideA1) ] = alpha; + } + ia += strideA2; + } + } + ia = offsetA; + for ( i1 = 0; i1 < min( M, N ); i1++ ) { + A[ ia ] = beta; + ia += strideA1 + strideA2; + } + return A; +} + + +// MAIN // + +/** +* Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals. +* +* @private +* @param {string} uplo - specifies whether to copy the upper or lower triangular/trapezoidal part of matrix `A` +* @param {NonNegativeInteger} M - number of rows in matrix `A` +* @param {NonNegativeInteger} N - number of columns in matrix `A` +* @param {Float64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {number} alpha - number to set on off diagonal elements +* @param {number} beta - number to set on diagonal elements +* @returns {Float64Array} `A` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( 4 ); +* +* dlaset( 'all', 2, 2, A, 2, 1, 0, 0.0, 1.0 ); +* // A => [ 1.0, 0.0, 0.0, 1.0 ] +*/ +function dlaset( uplo, M, N, A, strideA1, strideA2, offsetA, alpha, beta ) { + if ( uplo === 'upper' ) { + return setUpper( M, N, A, strideA1, strideA2, offsetA, alpha, beta ); + } + if ( uplo === 'lower' ) { + return setLower( M, N, A, strideA1, strideA2, offsetA, alpha, beta ); + } + return setAll( M, N, A, strideA1, strideA2, offsetA, alpha, beta ); +} + + +// EXPORTS // + +module.exports = dlaset; From deb41b888f7f0b66e73e34abb9b0f86460a43634 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 24 Jun 2025 00:55:02 +0000 Subject: [PATCH 02/13] 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/dlaset/lib/base.js | 2 +- .../@stdlib/lapack/base/dlaset/lib/dlaset.js | 76 +++++++++++++++++++ .../@stdlib/lapack/base/dlaset/lib/index.js | 59 ++++++++++++++ .../@stdlib/lapack/base/dlaset/lib/main.js | 35 +++++++++ .../@stdlib/lapack/base/dlaset/lib/ndarray.js | 58 ++++++++++++++ 5 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/lib/dlaset.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/lib/index.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/lib/main.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/lib/ndarray.js diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dlaset/lib/base.js index 596c0645ede6..3bea37e86573 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/lib/base.js +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/lib/base.js @@ -202,7 +202,7 @@ function setLower( M, N, A, strideA1, strideA2, offsetA, alpha, beta ) { * Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals. * * @private -* @param {string} uplo - specifies whether to copy the upper or lower triangular/trapezoidal part of matrix `A` +* @param {string} uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A` * @param {NonNegativeInteger} M - number of rows in matrix `A` * @param {NonNegativeInteger} N - number of columns in matrix `A` * @param {Float64Array} A - input matrix diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/lib/dlaset.js b/lib/node_modules/@stdlib/lapack/base/dlaset/lib/dlaset.js new file mode 100644 index 000000000000..ca01634da766 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/lib/dlaset.js @@ -0,0 +1,76 @@ +/** +* @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 isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals. +* +* @param {string} order - storage layout of `A` and `B` +* @param {string} uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A` +* @param {NonNegativeInteger} M - number of rows in matrix `A` +* @param {NonNegativeInteger} N - number of columns in matrix `A` +* @param {Float64Array} A - input matrix +* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {number} alpha - number to set on off diagonal elements +* @param {number} beta - number to set on diagonal elements +* @throws {TypeError} first argument must be a valid order +* @throws {RangeError} sixth argument must be greater than or equal to `N` +* @returns {Float64Array} `A` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( 4 ); +* +* dlaset( 'row-major', 'all', 2, 2, A, 2, 0.0, 1.0 ); +* // A => [ 1.0, 0.0, 0.0, 1.0 ] +*/ +function dlaset( order, uplo, M, N, A, LDA, alpha, beta ) { + var sa1; + var sa2; + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + if ( LDA < N ) { + throw new RangeError( format( 'invalid argument. Sixth argument must be greater than or equal to %d. Value: `%d`.', N, LDA ) ); + } + sa1 = LDA; + sa2 = 1; + } + return base( uplo, M, N, A, sa1, sa2, 0, alpha, beta ); +} + + +// EXPORTS // + +module.exports = dlaset; diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/lib/index.js b/lib/node_modules/@stdlib/lapack/base/dlaset/lib/index.js new file mode 100644 index 000000000000..6527e32b45a6 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/lib/index.js @@ -0,0 +1,59 @@ +/** +* @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 initialize an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals. +* +* @module @stdlib/lapack/base/dlaset +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dlaset = require( '@stdlib/lapack/base/dlaset' ); +* +* var A = new Float64Array( 4 ); +* +* dlaset( 'row-major', 'all', 2, 2, A, 2, 0.0, 1.0 ); +* // A => [ 1.0, 0.0, 0.0, 1.0 ] +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var dlaset; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dlaset = main; +} else { + dlaset = tmp; +} + + +// EXPORTS // + +module.exports = dlaset; + +// exports: { "ndarray": "dlaset.ndarray" } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/lib/main.js b/lib/node_modules/@stdlib/lapack/base/dlaset/lib/main.js new file mode 100644 index 000000000000..78b09ba862e7 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/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 dlaset = require( './dlaset.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dlaset, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dlaset; diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/lib/ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlaset/lib/ndarray.js new file mode 100644 index 000000000000..946554759061 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/lib/ndarray.js @@ -0,0 +1,58 @@ +/** +* @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 base = require( './base.js' ); + + +// MAIN // + +/** +* Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals using alternative indexing semantics. +* +* @private +* @param {string} uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A` +* @param {NonNegativeInteger} M - number of rows in matrix `A` +* @param {NonNegativeInteger} N - number of columns in matrix `A` +* @param {Float64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {number} alpha - number to set on off diagonal elements +* @param {number} beta - number to set on diagonal elements +* @returns {Float64Array} `A` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( 4 ); +* +* dlaset( 'all', 2, 2, A, 2, 1, 0, 0.0, 1.0 ); +* // A => [ 1.0, 0.0, 0.0, 1.0 ] +*/ +function dlaset( uplo, M, N, A, strideA1, strideA2, offsetA, alpha, beta ) { + return base( uplo, M, N, A, strideA1, strideA2, offsetA, alpha, beta ); +} + + +// EXPORTS // + +module.exports = dlaset; From 18a8394e479c0bfd71f2e46f117211d4d39e5e94 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 24 Jun 2025 01:23:05 +0000 Subject: [PATCH 03/13] feat: add examples and bench --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../lapack/base/dlaset/benchmark/benchmark.js | 114 ++++++++++++++++ .../dlaset/benchmark/benchmark.ndarray.js | 124 ++++++++++++++++++ .../lapack/base/dlaset/examples/index.js | 39 ++++++ .../@stdlib/lapack/base/dlaset/package.json | 72 ++++++++++ 4 files changed, 349 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/benchmark/benchmark.ndarray.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/examples/index.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/package.json diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/benchmark/benchmark.js b/lib/node_modules/@stdlib/lapack/base/dlaset/benchmark/benchmark.js new file mode 100644 index 000000000000..5ba2c2acb558 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/benchmark/benchmark.js @@ -0,0 +1,114 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var 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 dlaset = require( './../lib/dlaset.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N ) { + var A; + + A = uniform( N*N, -10.0, 10.0, { + 'dtype': 'float64' + }); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dlaset( order, 'all', N, N, A, N, 1.0, 0.0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var ord; + var N; + var f; + var i; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N ); + bench( pkg+'::square_matrix:order='+ord+',size='+(N*N), f ); + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlaset/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..da6d9366ac79 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/benchmark/benchmark.ndarray.js @@ -0,0 +1,124 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var pkg = require( './../package.json' ).name; +var dlaswp = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N ) { + var sa1; + var sa2; + var A; + + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = N; + } else { // order === 'row-major' + sa1 = N; + sa2 = 1; + } + A = uniform( N*N, -10.0, 10.0, { + 'dtype': 'float64' + }); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dlaswp( 'all', N, N, A, sa1, sa2, 0, 1.0, 0.0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var ord; + var N; + var f; + var i; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N ); + bench( pkg+'::square_matrix:order='+ord+',size='+(N*N), f ); + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/examples/index.js b/lib/node_modules/@stdlib/lapack/base/dlaset/examples/index.js new file mode 100644 index 000000000000..d1fe70db9809 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/examples/index.js @@ -0,0 +1,39 @@ +/** +* @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 ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var uniform = require( '@stdlib/random/array/discrete-uniform' ); +var numel = require( '@stdlib/ndarray/base/numel' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var dlaset = require( './../lib' ); + +var shape = [ 5, 8 ]; +var order = 'row-major'; +var strides = shape2strides( shape, order ); + +var N = numel( shape ); + +var A = uniform( N, -10, 10, { + 'dtype': 'float64' +}); +console.log( ndarray2array( A, shape, strides, 0, order ) ); + +dlaset( order, 'all', shape[ 0 ], shape[ 1 ], A, strides[ 0 ], 2.0, 3.0 ); +console.log( ndarray2array( A, shape, strides, 0, order ) ); diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/package.json b/lib/node_modules/@stdlib/lapack/base/dlaset/package.json new file mode 100644 index 000000000000..dd03d0781dc0 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/package.json @@ -0,0 +1,72 @@ +{ + "name": "@stdlib/lapack/base/dlaset", + "version": "0.0.0", + "description": "Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals.", + "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", + "dlaset", + "initialize", + "set", + "exchange", + "permute", + "permutedims", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "float64", + "double", + "float64array" + ] +} From 4049a3cebd11a5bef818d87fcf4510b60723f2f7 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 24 Jun 2025 02:49:52 +0000 Subject: [PATCH 04/13] 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: 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 --- --- .../dlaset/test/fixtures/all_col_major.json | 29 +++ .../dlaset/test/fixtures/all_row_major.json | 29 +++ .../dlaset/test/fixtures/lower_col_major.json | 29 +++ .../dlaset/test/fixtures/lower_row_major.json | 29 +++ .../dlaset/test/fixtures/upper_col_major.json | 29 +++ .../dlaset/test/fixtures/upper_row_major.json | 29 +++ .../lapack/base/dlaset/test/test.dlaset.js | 197 ++++++++++++++++++ .../@stdlib/lapack/base/dlaset/test/test.js | 82 ++++++++ 8 files changed, 453 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/test.dlaset.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/test.js diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_col_major.json new file mode 100644 index 000000000000..50fa15ee1fe5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_col_major.json @@ -0,0 +1,29 @@ +{ + "order": "column-major", + "uplo": "all", + + "M": 3, + "N": 3, + + "A": [ 1.0, 4.0, 7.0, 2.0, 5.0, 8.0, 3.0, 6.0, 9.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] + ], + + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "LDA": 3, + + "alpha": 2.0, + "beta": 3.0, + + "out": [ 3.0, 2.0, 2.0, 2.0, 3.0, 2.0, 2.0, 2.0, 3.0 ], + "out_mat": [ + [ 3.0, 2.0, 2.0 ], + [ 2.0, 3.0, 2.0 ], + [ 2.0, 2.0, 3.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_row_major.json new file mode 100644 index 000000000000..86a0dfc18673 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_row_major.json @@ -0,0 +1,29 @@ +{ + "order": "row-major", + "uplo": "all", + + "M": 3, + "N": 3, + + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] + ], + + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "LDA": 3, + + "alpha": 2.0, + "beta": 3.0, + + "out": [ 3.0, 2.0, 2.0, 2.0, 3.0, 2.0, 2.0, 2.0, 3.0 ], + "out_mat": [ + [ 3.0, 2.0, 2.0 ], + [ 2.0, 3.0, 2.0 ], + [ 2.0, 2.0, 3.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_col_major.json new file mode 100644 index 000000000000..46bc0552009a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_col_major.json @@ -0,0 +1,29 @@ +{ + "order": "column-major", + "uplo": "lower", + + "M": 3, + "N": 3, + + "A": [ 1.0, 4.0, 7.0, 2.0, 5.0, 8.0, 3.0, 6.0, 9.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] + ], + + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "LDA": 3, + + "alpha": 2.0, + "beta": 3.0, + + "out": [ 3.0, 2.0, 2.0, 2.0, 3.0, 2.0, 3.0, 6.0, 3.0 ], + "out_mat": [ + [ 3.0, 2.0, 3.0 ], + [ 2.0, 3.0, 6.0 ], + [ 2.0, 2.0, 3.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_row_major.json new file mode 100644 index 000000000000..fe351b1f714d --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_row_major.json @@ -0,0 +1,29 @@ +{ + "order": "row-major", + "uplo": "lower", + + "M": 3, + "N": 3, + + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] + ], + + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "LDA": 3, + + "alpha": 2.0, + "beta": 3.0, + + "out": [ 3.0, 2.0, 3.0, 2.0, 3.0, 6.0, 2.0, 2.0, 3.0 ], + "out_mat": [ + [ 3.0, 2.0, 3.0 ], + [ 2.0, 3.0, 6.0 ], + [ 2.0, 2.0, 3.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_col_major.json new file mode 100644 index 000000000000..be7a2d32cbd5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_col_major.json @@ -0,0 +1,29 @@ +{ + "order": "column-major", + "uplo": "upper", + + "M": 3, + "N": 3, + + "A": [ 1.0, 4.0, 7.0, 2.0, 5.0, 8.0, 3.0, 6.0, 9.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] + ], + + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "LDA": 3, + + "alpha": 2.0, + "beta": 3.0, + + "out": [ 3.0, 4.0, 7.0, 2.0, 3.0, 8.0, 2.0, 2.0, 3.0 ], + "out_mat": [ + [ 3.0, 2.0, 2.0 ], + [ 4.0, 3.0, 2.0 ], + [ 7.0, 8.0, 3.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_row_major.json new file mode 100644 index 000000000000..39ec45ab0148 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_row_major.json @@ -0,0 +1,29 @@ +{ + "order": "row-major", + "uplo": "upper", + + "M": 3, + "N": 3, + + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] + ], + + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "LDA": 3, + + "alpha": 2.0, + "beta": 3.0, + + "out": [ 3.0, 2.0, 2.0, 4.0, 3.0, 2.0, 7.0, 8.0, 3.0 ], + "out_mat": [ + [ 3.0, 2.0, 2.0 ], + [ 4.0, 3.0, 2.0 ], + [ 7.0, 8.0, 3.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.dlaset.js b/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.dlaset.js new file mode 100644 index 000000000000..7dc461d2514f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.dlaset.js @@ -0,0 +1,197 @@ +/** +* @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 dlaset = require( './../lib/dlaset.js' ); + + +// FIXTURES // + +var ALL_ROW_MAJOR = require( './fixtures/all_row_major.json' ); +var ALL_COL_MAJOR = require( './fixtures/all_col_major.json' ); +var LOWER_ROW_MAJOR = require( './fixtures/lower_row_major.json' ); +var LOWER_COL_MAJOR = require( './fixtures/lower_col_major.json' ); +var UPPER_ROW_MAJOR = require( './fixtures/upper_row_major.json' ); +var UPPER_COL_MAJOR = require( './fixtures/upper_col_major.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlaset, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 8', function test( t ) { + t.strictEqual( dlaset.length, 8, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', function test( t ) { + var values; + var A; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + 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() { + dlaset( value, 'all', 2, 2, A, 2, 2.0, 3.0 ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid sixth argument (row-major)', function test( t ) { + var values; + var A; + var i; + + values = [ + 0, + 1 + ]; + + A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dlaset( 'row-major', 'all', 2, 2, A, value, 2.0, 3.0 ); + }; + } +}); + +tape( 'the function returns expected value when setting all values (row-major)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = ALL_ROW_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting all values (column-major)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = ALL_COL_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting lower triangular values (row-major)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = LOWER_ROW_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting lower triangular values (column-major)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = LOWER_COL_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting upper triangular values (row-major)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = UPPER_ROW_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting upper triangular values (column-major)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = UPPER_COL_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.js b/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.js new file mode 100644 index 000000000000..1c663fa0bb28 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/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 dlaset = 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 dlaset, '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 dlaset.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 dlaset = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dlaset, 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 dlaset; + var main; + + main = require( './../lib/dlaset.js' ); + + dlaset = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dlaset, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); From 19f20ed15bbb214c1ae28a91b01154997b0d12f8 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 24 Jun 2025 03:10:38 +0000 Subject: [PATCH 05/13] test: add initial 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/dlaset/test/test.ndarray.js | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js new file mode 100644 index 000000000000..7bd904672a2d --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js @@ -0,0 +1,147 @@ +/** +* @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 dlaset = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var ALL_ROW_MAJOR = require( './fixtures/all_row_major.json' ); +var ALL_COL_MAJOR = require( './fixtures/all_col_major.json' ); +var LOWER_ROW_MAJOR = require( './fixtures/lower_row_major.json' ); +var LOWER_COL_MAJOR = require( './fixtures/lower_col_major.json' ); +var UPPER_ROW_MAJOR = require( './fixtures/upper_row_major.json' ); +var UPPER_COL_MAJOR = require( './fixtures/upper_col_major.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlaset, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 9', function test( t ) { + t.strictEqual( dlaset.length, 9, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting all values (row-major)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = ALL_ROW_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting all values (column-major)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = ALL_COL_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting lower triangular values (row-major)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = LOWER_ROW_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting lower triangular values (column-major)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = LOWER_COL_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting upper triangular values (row-major)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = UPPER_ROW_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting upper triangular values (column-major)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = UPPER_COL_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); From dd74f3fe068765ddf9c570208d2a870818d19ed9 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 24 Jun 2025 03:18:35 +0000 Subject: [PATCH 06/13] test: add offset cases --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: 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 --- --- .../fixtures/large_strides/all_col_major.json | 86 +++++++++++++++ .../fixtures/large_strides/all_row_major.json | 86 +++++++++++++++ .../large_strides/lower_col_major.json | 86 +++++++++++++++ .../large_strides/lower_row_major.json | 86 +++++++++++++++ .../large_strides/upper_col_major.json | 86 +++++++++++++++ .../large_strides/upper_row_major.json | 86 +++++++++++++++ .../fixtures/mixed_strides/all_col_major.json | 68 ++++++++++++ .../fixtures/mixed_strides/all_row_major.json | 68 ++++++++++++ .../mixed_strides/lower_col_major.json | 68 ++++++++++++ .../mixed_strides/lower_row_major.json | 68 ++++++++++++ .../mixed_strides/upper_col_major.json | 68 ++++++++++++ .../mixed_strides/upper_row_major.json | 68 ++++++++++++ .../negative_strides/all_col_major.json | 69 ++++++++++++ .../negative_strides/all_row_major.json | 69 ++++++++++++ .../negative_strides/lower_col_major.json | 69 ++++++++++++ .../negative_strides/lower_row_major.json | 69 ++++++++++++ .../negative_strides/upper_col_major.json | 69 ++++++++++++ .../negative_strides/upper_row_major.json | 69 ++++++++++++ .../test/fixtures/offsets/all_col_major.json | 70 ++++++++++++ .../test/fixtures/offsets/all_row_major.json | 70 ++++++++++++ .../fixtures/offsets/lower_col_major.json | 70 ++++++++++++ .../fixtures/offsets/lower_row_major.json | 70 ++++++++++++ .../fixtures/offsets/upper_col_major.json | 70 ++++++++++++ .../fixtures/offsets/upper_row_major.json | 70 ++++++++++++ .../lapack/base/dlaset/test/test.ndarray.js | 103 ++++++++++++++++++ 25 files changed, 1861 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_row_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_col_major.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_row_major.json diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_col_major.json new file mode 100644 index 000000000000..754aa46df2ee --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_col_major.json @@ -0,0 +1,86 @@ +{ + "order": "column-major", + "uplo": "all", + "M": 3, + "N": 3, + "A": [ + 1, + 9999, + 4, + 9999, + 7, + 9999, + 2, + 9999, + 5, + 9999, + 8, + 9999, + 3, + 9999, + 6, + 9999, + 9, + 9999 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 2, + "strideA2": 6, + "offsetA": 0, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 9999, + 2, + 9999, + 2, + 9999, + 2, + 9999, + 3, + 9999, + 2, + 9999, + 2, + 9999, + 2, + 9999, + 3, + 9999 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 2, + 3, + 2 + ], + [ + 2, + 2, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_row_major.json new file mode 100644 index 000000000000..729a681b8aa9 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_row_major.json @@ -0,0 +1,86 @@ +{ + "order": "row-major", + "uplo": "all", + "M": 3, + "N": 3, + "A": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 6, + "strideA2": 2, + "offsetA": 0, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 9999, + 2, + 9999, + 2, + 9999, + 2, + 9999, + 3, + 9999, + 2, + 9999, + 2, + 9999, + 2, + 9999, + 3, + 9999 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 2, + 3, + 2 + ], + [ + 2, + 2, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_col_major.json new file mode 100644 index 000000000000..beed7d983639 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_col_major.json @@ -0,0 +1,86 @@ +{ + "order": "column-major", + "uplo": "lower", + "M": 3, + "N": 3, + "A": [ + 1, + 9999, + 4, + 9999, + 7, + 9999, + 2, + 9999, + 5, + 9999, + 8, + 9999, + 3, + 9999, + 6, + 9999, + 9, + 9999 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 2, + "strideA2": 6, + "offsetA": 0, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 9999, + 2, + 9999, + 2, + 9999, + 2, + 9999, + 3, + 9999, + 2, + 9999, + 3, + 9999, + 6, + 9999, + 3, + 9999 + ], + "out_mat": [ + [ + 3, + 2, + 3 + ], + [ + 2, + 3, + 6 + ], + [ + 2, + 2, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_row_major.json new file mode 100644 index 000000000000..1054283435a0 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_row_major.json @@ -0,0 +1,86 @@ +{ + "order": "row-major", + "uplo": "lower", + "M": 3, + "N": 3, + "A": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 6, + "strideA2": 2, + "offsetA": 0, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 9999, + 2, + 9999, + 3, + 9999, + 2, + 9999, + 3, + 9999, + 6, + 9999, + 2, + 9999, + 2, + 9999, + 3, + 9999 + ], + "out_mat": [ + [ + 3, + 2, + 3 + ], + [ + 2, + 3, + 6 + ], + [ + 2, + 2, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_col_major.json new file mode 100644 index 000000000000..f32ecfbe7a35 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_col_major.json @@ -0,0 +1,86 @@ +{ + "order": "column-major", + "uplo": "upper", + "M": 3, + "N": 3, + "A": [ + 1, + 9999, + 4, + 9999, + 7, + 9999, + 2, + 9999, + 5, + 9999, + 8, + 9999, + 3, + 9999, + 6, + 9999, + 9, + 9999 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 2, + "strideA2": 6, + "offsetA": 0, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 9999, + 4, + 9999, + 7, + 9999, + 2, + 9999, + 3, + 9999, + 8, + 9999, + 2, + 9999, + 2, + 9999, + 3, + 9999 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 4, + 3, + 2 + ], + [ + 7, + 8, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_row_major.json new file mode 100644 index 000000000000..3711ddd017ac --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_row_major.json @@ -0,0 +1,86 @@ +{ + "order": "row-major", + "uplo": "upper", + "M": 3, + "N": 3, + "A": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 6, + "strideA2": 2, + "offsetA": 0, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 9999, + 2, + 9999, + 2, + 9999, + 4, + 9999, + 3, + 9999, + 2, + 9999, + 7, + 9999, + 8, + 9999, + 3, + 9999 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 4, + 3, + 2 + ], + [ + 7, + 8, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json new file mode 100644 index 000000000000..42d45ae265a9 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json @@ -0,0 +1,68 @@ +{ + "order": "column-major", + "uplo": "all", + "M": 3, + "N": 3, + "A": [ + 3, + 6, + 9, + 2, + 5, + 8, + 1, + 4, + 7 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 1, + "strideA2": -3, + "offsetA": 6, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 2, + 2, + 2, + 3, + 2, + 2, + 2, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 2, + 3, + 2 + ], + [ + 2, + 2, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json new file mode 100644 index 000000000000..c8446ed6a645 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json @@ -0,0 +1,68 @@ +{ + "order": "row-major", + "uplo": "all", + "M": 3, + "N": 3, + "A": [ + 7, + 8, + 9, + 4, + 5, + 6, + 1, + 2, + 3 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": -3, + "strideA2": 1, + "offsetA": 6, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 2, + 2, + 2, + 3, + 2, + 2, + 2, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 2, + 3, + 2 + ], + [ + 2, + 2, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json new file mode 100644 index 000000000000..ed604c6ee8be --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json @@ -0,0 +1,68 @@ +{ + "order": "column-major", + "uplo": "lower", + "M": 3, + "N": 3, + "A": [ + 3, + 6, + 9, + 2, + 5, + 8, + 1, + 4, + 7 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 1, + "strideA2": -3, + "offsetA": 6, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 2, + 2, + 2, + 3, + 2, + 3, + 6, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 3 + ], + [ + 2, + 3, + 6 + ], + [ + 2, + 2, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json new file mode 100644 index 000000000000..cc882d051e66 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json @@ -0,0 +1,68 @@ +{ + "order": "row-major", + "uplo": "lower", + "M": 3, + "N": 3, + "A": [ + 7, + 8, + 9, + 4, + 5, + 6, + 1, + 2, + 3 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": -3, + "strideA2": 1, + "offsetA": 6, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 2, + 3, + 2, + 3, + 6, + 2, + 2, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 3 + ], + [ + 2, + 3, + 6 + ], + [ + 2, + 2, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json new file mode 100644 index 000000000000..eb44b307f78b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json @@ -0,0 +1,68 @@ +{ + "order": "column-major", + "uplo": "upper", + "M": 3, + "N": 3, + "A": [ + 3, + 6, + 9, + 2, + 5, + 8, + 1, + 4, + 7 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 1, + "strideA2": -3, + "offsetA": 6, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 4, + 7, + 2, + 3, + 8, + 2, + 2, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 4, + 3, + 2 + ], + [ + 7, + 8, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json new file mode 100644 index 000000000000..6f234ca6d998 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json @@ -0,0 +1,68 @@ +{ + "order": "row-major", + "uplo": "upper", + "M": 3, + "N": 3, + "A": [ + 7, + 8, + 9, + 4, + 5, + 6, + 1, + 2, + 3 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": -3, + "strideA2": 1, + "offsetA": 6, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 2, + 2, + 4, + 3, + 2, + 7, + 8, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 4, + 3, + 2 + ], + [ + 7, + 8, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json new file mode 100644 index 000000000000..70c5fb0446b1 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json @@ -0,0 +1,69 @@ +{ + "order": "column-major", + "uplo": "all", + "M": 3, + "N": 3, + "A": [ + 9, + 6, + 3, + 8, + 5, + 2, + 7, + 4, + 1 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": -1, + "strideA2": -3, + "offsetA": 8, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 2, + 2, + 2, + 3, + 2, + 2, + 2, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 2, + 3, + 2 + ], + [ + 2, + 2, + 3 + ] + ], + "offsetOut": 8 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json new file mode 100644 index 000000000000..72657ebe7204 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json @@ -0,0 +1,69 @@ +{ + "order": "row-major", + "uplo": "all", + "M": 3, + "N": 3, + "A": [ + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": -3, + "strideA2": -1, + "offsetA": 8, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 2, + 2, + 2, + 3, + 2, + 2, + 2, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 2, + 3, + 2 + ], + [ + 2, + 2, + 3 + ] + ], + "offsetOut": 8 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json new file mode 100644 index 000000000000..f2e4c979ab62 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json @@ -0,0 +1,69 @@ +{ + "order": "column-major", + "uplo": "lower", + "M": 3, + "N": 3, + "A": [ + 9, + 6, + 3, + 8, + 5, + 2, + 7, + 4, + 1 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": -1, + "strideA2": -3, + "offsetA": 8, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 6, + 3, + 2, + 3, + 2, + 2, + 2, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 3 + ], + [ + 2, + 3, + 6 + ], + [ + 2, + 2, + 3 + ] + ], + "offsetOut": 8 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json new file mode 100644 index 000000000000..db9237942693 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json @@ -0,0 +1,69 @@ +{ + "order": "row-major", + "uplo": "lower", + "M": 3, + "N": 3, + "A": [ + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": -3, + "strideA2": -1, + "offsetA": 8, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 2, + 2, + 6, + 3, + 2, + 3, + 2, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 3 + ], + [ + 2, + 3, + 6 + ], + [ + 2, + 2, + 3 + ] + ], + "offsetOut": 8 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json new file mode 100644 index 000000000000..b464fb871633 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json @@ -0,0 +1,69 @@ +{ + "order": "column-major", + "uplo": "upper", + "M": 3, + "N": 3, + "A": [ + 9, + 6, + 3, + 8, + 5, + 2, + 7, + 4, + 1 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": -1, + "strideA2": -3, + "offsetA": 8, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 2, + 2, + 8, + 3, + 2, + 7, + 4, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 4, + 3, + 2 + ], + [ + 7, + 8, + 3 + ] + ], + "offsetOut": 8 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json new file mode 100644 index 000000000000..dd180fa8b61d --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json @@ -0,0 +1,69 @@ +{ + "order": "row-major", + "uplo": "upper", + "M": 3, + "N": 3, + "A": [ + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": -3, + "strideA2": -1, + "offsetA": 8, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 3, + 8, + 7, + 2, + 3, + 4, + 2, + 2, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 4, + 3, + 2 + ], + [ + 7, + 8, + 3 + ] + ], + "offsetOut": 8 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_col_major.json new file mode 100644 index 000000000000..7aed32d86f6a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_col_major.json @@ -0,0 +1,70 @@ +{ + "order": "column-major", + "uplo": "all", + "M": 3, + "N": 3, + "A": [ + 9999, + 1, + 4, + 7, + 2, + 5, + 8, + 3, + 6, + 9 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 1, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 9999, + 3, + 2, + 2, + 2, + 3, + 2, + 2, + 2, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 2, + 3, + 2 + ], + [ + 2, + 2, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_row_major.json new file mode 100644 index 000000000000..cbd92a0ad700 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_row_major.json @@ -0,0 +1,70 @@ +{ + "order": "row-major", + "uplo": "all", + "M": 3, + "N": 3, + "A": [ + 9999, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 3, + "strideA2": 1, + "offsetA": 1, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 9999, + 3, + 2, + 2, + 2, + 3, + 2, + 2, + 2, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 2, + 3, + 2 + ], + [ + 2, + 2, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_col_major.json new file mode 100644 index 000000000000..b328d114055a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_col_major.json @@ -0,0 +1,70 @@ +{ + "order": "column-major", + "uplo": "lower", + "M": 3, + "N": 3, + "A": [ + 9999, + 1, + 4, + 7, + 2, + 5, + 8, + 3, + 6, + 9 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 1, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 9999, + 3, + 2, + 2, + 2, + 3, + 2, + 3, + 6, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 3 + ], + [ + 2, + 3, + 6 + ], + [ + 2, + 2, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_row_major.json new file mode 100644 index 000000000000..5797d422832e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_row_major.json @@ -0,0 +1,70 @@ +{ + "order": "row-major", + "uplo": "lower", + "M": 3, + "N": 3, + "A": [ + 9999, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 3, + "strideA2": 1, + "offsetA": 1, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 9999, + 3, + 2, + 3, + 2, + 3, + 6, + 2, + 2, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 3 + ], + [ + 2, + 3, + 6 + ], + [ + 2, + 2, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_col_major.json new file mode 100644 index 000000000000..778ab988445e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_col_major.json @@ -0,0 +1,70 @@ +{ + "order": "column-major", + "uplo": "upper", + "M": 3, + "N": 3, + "A": [ + 9999, + 1, + 4, + 7, + 2, + 5, + 8, + 3, + 6, + 9 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 1, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 9999, + 3, + 4, + 7, + 2, + 3, + 8, + 2, + 2, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 4, + 3, + 2 + ], + [ + 7, + 8, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_row_major.json new file mode 100644 index 000000000000..f55e6415cf17 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_row_major.json @@ -0,0 +1,70 @@ +{ + "order": "row-major", + "uplo": "upper", + "M": 3, + "N": 3, + "A": [ + 9999, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "A_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "strideA1": 3, + "strideA2": 1, + "offsetA": 1, + "LDA": 3, + "alpha": 2, + "beta": 3, + "out": [ + 9999, + 3, + 2, + 2, + 4, + 3, + 2, + 7, + 8, + 3 + ], + "out_mat": [ + [ + 3, + 2, + 2 + ], + [ + 4, + 3, + 2 + ], + [ + 7, + 8, + 3 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js index 7bd904672a2d..8886178ae5d0 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js @@ -36,6 +36,13 @@ var LOWER_COL_MAJOR = require( './fixtures/lower_col_major.json' ); var UPPER_ROW_MAJOR = require( './fixtures/upper_row_major.json' ); var UPPER_COL_MAJOR = require( './fixtures/upper_col_major.json' ); +var OFFSET_ALL_ROW_MAJOR = require( './fixtures/offsets/all_row_major.json' ); +var OFFSET_ALL_COL_MAJOR = require( './fixtures/offsets/all_col_major.json' ); +var OFFSET_LOWER_ROW_MAJOR = require( './fixtures/offsets/lower_row_major.json' ); +var OFFSET_LOWER_COL_MAJOR = require( './fixtures/offsets/lower_col_major.json' ); +var OFFSET_UPPER_ROW_MAJOR = require( './fixtures/offsets/upper_row_major.json' ); +var OFFSET_UPPER_COL_MAJOR = require( './fixtures/offsets/upper_col_major.json' ); + // TESTS // @@ -145,3 +152,99 @@ tape( 'the function returns expected value when setting upper triangular values t.deepEqual( out, expectedOut, 'returns expected value' ); t.end(); }); + +tape( 'the function returns expected value when setting all values (row-major) (offsets)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = OFFSET_ALL_ROW_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting all values (column-major) (offsets)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = OFFSET_ALL_COL_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting lower triangular values (row-major) (offsets)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = OFFSET_LOWER_ROW_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting lower triangular values (column-major) (offsets)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = OFFSET_LOWER_COL_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting upper triangular values (row-major) (offsets)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = OFFSET_UPPER_ROW_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting upper triangular values (column-major) (offsets)', function test( t ) { + var expectedOut; + var data; + var out; + var A; + + data = OFFSET_UPPER_COL_MAJOR; + + A = new Float64Array( data.A ); + out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.out ); + + t.deepEqual( out, expectedOut, 'returns expected value' ); + t.end(); +}); From 073260595f92409fb433da9936327c5840650606 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 24 Jun 2025 03:50:47 +0000 Subject: [PATCH 07/13] test: add tests for mixed strides --- 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 --- --- .../dlaset/test/fixtures/all_col_major.json | 4 +- .../dlaset/test/fixtures/all_row_major.json | 4 +- .../fixtures/large_strides/all_col_major.json | 4 +- .../fixtures/large_strides/all_row_major.json | 4 +- .../large_strides/lower_col_major.json | 4 +- .../large_strides/lower_row_major.json | 4 +- .../large_strides/upper_col_major.json | 4 +- .../large_strides/upper_row_major.json | 4 +- .../dlaset/test/fixtures/lower_col_major.json | 4 +- .../dlaset/test/fixtures/lower_row_major.json | 4 +- .../fixtures/mixed_strides/all_col_major.json | 15 +- .../fixtures/mixed_strides/all_row_major.json | 15 +- .../mixed_strides/lower_col_major.json | 17 +- .../mixed_strides/lower_row_major.json | 13 +- .../mixed_strides/upper_col_major.json | 19 +- .../mixed_strides/upper_row_major.json | 19 +- .../negative_strides/all_col_major.json | 6 +- .../negative_strides/all_row_major.json | 6 +- .../negative_strides/lower_col_major.json | 6 +- .../negative_strides/lower_row_major.json | 6 +- .../negative_strides/upper_col_major.json | 6 +- .../negative_strides/upper_row_major.json | 6 +- .../test/fixtures/offsets/all_col_major.json | 4 +- .../test/fixtures/offsets/all_row_major.json | 4 +- .../fixtures/offsets/lower_col_major.json | 4 +- .../fixtures/offsets/lower_row_major.json | 4 +- .../fixtures/offsets/upper_col_major.json | 4 +- .../fixtures/offsets/upper_row_major.json | 4 +- .../dlaset/test/fixtures/upper_col_major.json | 4 +- .../dlaset/test/fixtures/upper_row_major.json | 4 +- .../lapack/base/dlaset/test/test.dlaset.js | 48 ++--- .../lapack/base/dlaset/test/test.ndarray.js | 201 +++++++++++++----- 32 files changed, 288 insertions(+), 167 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_col_major.json index 50fa15ee1fe5..da9bd15e7357 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_col_major.json @@ -20,8 +20,8 @@ "alpha": 2.0, "beta": 3.0, - "out": [ 3.0, 2.0, 2.0, 2.0, 3.0, 2.0, 2.0, 2.0, 3.0 ], - "out_mat": [ + "A_out": [ 3.0, 2.0, 2.0, 2.0, 3.0, 2.0, 2.0, 2.0, 3.0 ], + "A_out_mat": [ [ 3.0, 2.0, 2.0 ], [ 2.0, 3.0, 2.0 ], [ 2.0, 2.0, 3.0 ] diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_row_major.json index 86a0dfc18673..88ebeb1aca7a 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/all_row_major.json @@ -20,8 +20,8 @@ "alpha": 2.0, "beta": 3.0, - "out": [ 3.0, 2.0, 2.0, 2.0, 3.0, 2.0, 2.0, 2.0, 3.0 ], - "out_mat": [ + "A_out": [ 3.0, 2.0, 2.0, 2.0, 3.0, 2.0, 2.0, 2.0, 3.0 ], + "A_out_mat": [ [ 3.0, 2.0, 2.0 ], [ 2.0, 3.0, 2.0 ], [ 2.0, 2.0, 3.0 ] diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_col_major.json index 754aa46df2ee..91bb524a2a39 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_col_major.json @@ -46,7 +46,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 3, 9999, 2, @@ -66,7 +66,7 @@ 3, 9999 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_row_major.json index 729a681b8aa9..4ea65fe7414e 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_row_major.json @@ -46,7 +46,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 3, 9999, 2, @@ -66,7 +66,7 @@ 3, 9999 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_col_major.json index beed7d983639..6291e9e0359e 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_col_major.json @@ -46,7 +46,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 3, 9999, 2, @@ -66,7 +66,7 @@ 3, 9999 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_row_major.json index 1054283435a0..0e9afcf5e3ec 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_row_major.json @@ -46,7 +46,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 3, 9999, 2, @@ -66,7 +66,7 @@ 3, 9999 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_col_major.json index f32ecfbe7a35..057801cfb6a9 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_col_major.json @@ -46,7 +46,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 3, 9999, 4, @@ -66,7 +66,7 @@ 3, 9999 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_row_major.json index 3711ddd017ac..b0f19bfdde77 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_row_major.json @@ -46,7 +46,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 3, 9999, 2, @@ -66,7 +66,7 @@ 3, 9999 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_col_major.json index 46bc0552009a..7b5320815a72 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_col_major.json @@ -20,8 +20,8 @@ "alpha": 2.0, "beta": 3.0, - "out": [ 3.0, 2.0, 2.0, 2.0, 3.0, 2.0, 3.0, 6.0, 3.0 ], - "out_mat": [ + "A_out": [ 3.0, 2.0, 2.0, 2.0, 3.0, 2.0, 3.0, 6.0, 3.0 ], + "A_out_mat": [ [ 3.0, 2.0, 3.0 ], [ 2.0, 3.0, 6.0 ], [ 2.0, 2.0, 3.0 ] diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_row_major.json index fe351b1f714d..a3ff01bbf3f0 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/lower_row_major.json @@ -20,8 +20,8 @@ "alpha": 2.0, "beta": 3.0, - "out": [ 3.0, 2.0, 3.0, 2.0, 3.0, 6.0, 2.0, 2.0, 3.0 ], - "out_mat": [ + "A_out": [ 3.0, 2.0, 3.0, 2.0, 3.0, 6.0, 2.0, 2.0, 3.0 ], + "A_out_mat": [ [ 3.0, 2.0, 3.0 ], [ 2.0, 3.0, 6.0 ], [ 2.0, 2.0, 3.0 ] diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json index 42d45ae265a9..09a4defddc74 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json @@ -37,18 +37,18 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ - 3, - 2, + "A_out": [ 2, 2, 3, 2, + 3, 2, + 3, 2, - 3 + 2 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, @@ -64,5 +64,8 @@ 2, 3 ] - ] + ], + "offsetA_out": 6, + "strideA_out1": 1, + "strideA_out2": -3 } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json index c8446ed6a645..20005721488c 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json @@ -37,18 +37,18 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ - 3, - 2, + "A_out": [ 2, 2, 3, 2, + 3, 2, + 3, 2, - 3 + 2 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, @@ -64,5 +64,8 @@ 2, 3 ] - ] + ], + "offsetA_out": 6, + "strideA_out1": -3, + "strideA_out2": 1 } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json index ed604c6ee8be..8794036c8ad6 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json @@ -37,18 +37,18 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ + 3, + 6, 3, - 2, - 2, 2, 3, 2, 3, - 6, - 3 + 2, + 2 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, @@ -64,5 +64,8 @@ 2, 3 ] - ] + ], + "offsetA_out": 6, + "strideA_out1": 1, + "strideA_out2": -3 } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json index cc882d051e66..9f6f186d0c85 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json @@ -37,18 +37,18 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ - 3, + "A_out": [ + 2, 2, 3, 2, 3, 6, - 2, + 3, 2, 3 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, @@ -64,5 +64,8 @@ 2, 3 ] - ] + ], + "offsetA_out": 6, + "strideA_out1": -3, + "strideA_out2": 1 } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json index eb44b307f78b..d35a1d032b24 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json @@ -37,18 +37,18 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ + 2, + 2, 3, - 4, - 7, 2, 3, 8, - 2, - 2, - 3 + 3, + 4, + 7 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, @@ -64,5 +64,8 @@ 8, 3 ] - ] + ], + "offsetA_out": 6, + "strideA_out1": 1, + "strideA_out2": -3 } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json index 6f234ca6d998..145f0536080b 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json @@ -37,18 +37,18 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ + 7, + 8, 3, - 2, - 2, 4, 3, 2, - 7, - 8, - 3 + 3, + 2, + 2 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, @@ -64,5 +64,8 @@ 8, 3 ] - ] + ], + "offsetA_out": 6, + "strideA_out1": -3, + "strideA_out2": 1 } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json index 70c5fb0446b1..762a27c08aa3 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json @@ -37,7 +37,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 3, 2, 2, @@ -48,7 +48,7 @@ 2, 3 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, @@ -65,5 +65,5 @@ 3 ] ], - "offsetOut": 8 + "offsetA_out": 8 } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json index 72657ebe7204..98a9963effb3 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json @@ -37,7 +37,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 3, 2, 2, @@ -48,7 +48,7 @@ 2, 3 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, @@ -65,5 +65,5 @@ 3 ] ], - "offsetOut": 8 + "offsetA_out": 8 } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json index f2e4c979ab62..f1dd8e0f0c2f 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json @@ -37,7 +37,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 3, 6, 3, @@ -48,7 +48,7 @@ 2, 3 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, @@ -65,5 +65,5 @@ 3 ] ], - "offsetOut": 8 + "offsetA_out": 8 } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json index db9237942693..a3e694f2111a 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json @@ -37,7 +37,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 3, 2, 2, @@ -48,7 +48,7 @@ 2, 3 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, @@ -65,5 +65,5 @@ 3 ] ], - "offsetOut": 8 + "offsetA_out": 8 } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json index b464fb871633..b40216c077fa 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json @@ -37,7 +37,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 3, 2, 2, @@ -48,7 +48,7 @@ 4, 3 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, @@ -65,5 +65,5 @@ 3 ] ], - "offsetOut": 8 + "offsetA_out": 8 } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json index dd180fa8b61d..fb49a7fc6a02 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json @@ -37,7 +37,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 3, 8, 7, @@ -48,7 +48,7 @@ 2, 3 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, @@ -65,5 +65,5 @@ 3 ] ], - "offsetOut": 8 + "offsetA_out": 8 } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_col_major.json index 7aed32d86f6a..525ee5c59368 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_col_major.json @@ -38,7 +38,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 9999, 3, 2, @@ -50,7 +50,7 @@ 2, 3 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_row_major.json index cbd92a0ad700..d0e5cb7d737b 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_row_major.json @@ -38,7 +38,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 9999, 3, 2, @@ -50,7 +50,7 @@ 2, 3 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_col_major.json index b328d114055a..25fe7d95a2c6 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_col_major.json @@ -38,7 +38,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 9999, 3, 2, @@ -50,7 +50,7 @@ 6, 3 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_row_major.json index 5797d422832e..e646f8040285 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_row_major.json @@ -38,7 +38,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 9999, 3, 2, @@ -50,7 +50,7 @@ 2, 3 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_col_major.json index 778ab988445e..49bacd4b674f 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_col_major.json @@ -38,7 +38,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 9999, 3, 4, @@ -50,7 +50,7 @@ 2, 3 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_row_major.json index f55e6415cf17..ccb667b465af 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_row_major.json @@ -38,7 +38,7 @@ "LDA": 3, "alpha": 2, "beta": 3, - "out": [ + "A_out": [ 9999, 3, 2, @@ -50,7 +50,7 @@ 8, 3 ], - "out_mat": [ + "A_out_mat": [ [ 3, 2, diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_col_major.json index be7a2d32cbd5..c524bfdb6307 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_col_major.json @@ -20,8 +20,8 @@ "alpha": 2.0, "beta": 3.0, - "out": [ 3.0, 4.0, 7.0, 2.0, 3.0, 8.0, 2.0, 2.0, 3.0 ], - "out_mat": [ + "A_out": [ 3.0, 4.0, 7.0, 2.0, 3.0, 8.0, 2.0, 2.0, 3.0 ], + "A_out_mat": [ [ 3.0, 2.0, 2.0 ], [ 4.0, 3.0, 2.0 ], [ 7.0, 8.0, 3.0 ] diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_row_major.json index 39ec45ab0148..478c9e24ca99 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/upper_row_major.json @@ -20,8 +20,8 @@ "alpha": 2.0, "beta": 3.0, - "out": [ 3.0, 2.0, 2.0, 4.0, 3.0, 2.0, 7.0, 8.0, 3.0 ], - "out_mat": [ + "A_out": [ 3.0, 2.0, 2.0, 4.0, 3.0, 2.0, 7.0, 8.0, 3.0 ], + "A_out_mat": [ [ 3.0, 2.0, 2.0 ], [ 4.0, 3.0, 2.0 ], [ 7.0, 8.0, 3.0 ] diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.dlaset.js b/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.dlaset.js index 7dc461d2514f..7f0c7e0bef89 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.dlaset.js +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.dlaset.js @@ -102,96 +102,96 @@ tape( 'the function throws an error if provided an invalid sixth argument (row-m tape( 'the function returns expected value when setting all values (row-major)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = ALL_ROW_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting all values (column-major)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = ALL_COL_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting lower triangular values (row-major)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = LOWER_ROW_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting lower triangular values (column-major)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = LOWER_COL_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting upper triangular values (row-major)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = UPPER_ROW_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting upper triangular values (column-major)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = UPPER_COL_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.order, data.uplo, data.M, data.N, A, data.LDA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js index 8886178ae5d0..9fd7b29eeb87 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable max-len */ +/* eslint-disable max-len, id-length */ 'use strict'; @@ -43,6 +43,13 @@ var OFFSET_LOWER_COL_MAJOR = require( './fixtures/offsets/lower_col_major.json' var OFFSET_UPPER_ROW_MAJOR = require( './fixtures/offsets/upper_row_major.json' ); var OFFSET_UPPER_COL_MAJOR = require( './fixtures/offsets/upper_col_major.json' ); +var MIXED_STRIDES_ALL_ROW_MAJOR = require( './fixtures/mixed_strides/all_row_major.json' ); +var MIXED_STRIDES_ALL_COL_MAJOR = require( './fixtures/mixed_strides/all_col_major.json' ); +var MIXED_STRIDES_LOWER_ROW_MAJOR = require( './fixtures/mixed_strides/lower_row_major.json' ); +var MIXED_STRIDES_LOWER_COL_MAJOR = require( './fixtures/mixed_strides/lower_col_major.json' ); +var MIXED_STRIDES_UPPER_ROW_MAJOR = require( './fixtures/mixed_strides/upper_row_major.json' ); +var MIXED_STRIDES_UPPER_COL_MAJOR = require( './fixtures/mixed_strides/upper_col_major.json' ); + // TESTS // @@ -59,192 +66,288 @@ tape( 'the function has an arity of 9', function test( t ) { tape( 'the function returns expected value when setting all values (row-major)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = ALL_ROW_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting all values (column-major)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = ALL_COL_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting lower triangular values (row-major)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = LOWER_ROW_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting lower triangular values (column-major)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = LOWER_COL_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting upper triangular values (row-major)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = UPPER_ROW_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting upper triangular values (column-major)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = UPPER_COL_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting all values (row-major) (offsets)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = OFFSET_ALL_ROW_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting all values (column-major) (offsets)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = OFFSET_ALL_COL_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting lower triangular values (row-major) (offsets)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = OFFSET_LOWER_ROW_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting lower triangular values (column-major) (offsets)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = OFFSET_LOWER_COL_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting upper triangular values (row-major) (offsets)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = OFFSET_UPPER_ROW_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); tape( 'the function returns expected value when setting upper triangular values (column-major) (offsets)', function test( t ) { var expectedOut; + var actualOut; var data; - var out; var A; data = OFFSET_UPPER_COL_MAJOR; A = new Float64Array( data.A ); - out = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); - expectedOut = new Float64Array( data.out ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting all values (row-major) (mixed strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = MIXED_STRIDES_ALL_ROW_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting all values (column-major) (mixed strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = MIXED_STRIDES_ALL_COL_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting lower triangular values (row-major) (mixed strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = MIXED_STRIDES_LOWER_ROW_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting lower triangular values (column-major) (mixed strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = MIXED_STRIDES_LOWER_COL_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting upper triangular values (row-major) (mixed strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = MIXED_STRIDES_UPPER_ROW_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting upper triangular values (column-major) (mixed strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = MIXED_STRIDES_UPPER_COL_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); - t.deepEqual( out, expectedOut, 'returns expected value' ); + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); From 7a973cfa049d5c4b4ab3b0e4fedac29f3520dc1a Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 24 Jun 2025 08:00:06 +0000 Subject: [PATCH 08/13] test: add all 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 --- --- .../fixtures/mixed_strides/all_col_major.json | 5 +- .../fixtures/mixed_strides/all_row_major.json | 5 +- .../mixed_strides/lower_col_major.json | 5 +- .../mixed_strides/lower_row_major.json | 5 +- .../mixed_strides/upper_col_major.json | 5 +- .../mixed_strides/upper_row_major.json | 5 +- .../negative_strides/all_col_major.json | 3 +- .../negative_strides/all_row_major.json | 3 +- .../negative_strides/lower_col_major.json | 3 +- .../negative_strides/lower_row_major.json | 3 +- .../negative_strides/upper_col_major.json | 3 +- .../negative_strides/upper_row_major.json | 3 +- .../lapack/base/dlaset/test/test.ndarray.js | 206 ++++++++++++++++++ 13 files changed, 218 insertions(+), 36 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json index 09a4defddc74..260f4d8d9344 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json @@ -64,8 +64,5 @@ 2, 3 ] - ], - "offsetA_out": 6, - "strideA_out1": 1, - "strideA_out2": -3 + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json index 20005721488c..2fa6db0eacaf 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json @@ -64,8 +64,5 @@ 2, 3 ] - ], - "offsetA_out": 6, - "strideA_out1": -3, - "strideA_out2": 1 + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json index 8794036c8ad6..44502623a871 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json @@ -64,8 +64,5 @@ 2, 3 ] - ], - "offsetA_out": 6, - "strideA_out1": 1, - "strideA_out2": -3 + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json index 9f6f186d0c85..cb3eee70e4d3 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json @@ -64,8 +64,5 @@ 2, 3 ] - ], - "offsetA_out": 6, - "strideA_out1": -3, - "strideA_out2": 1 + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json index d35a1d032b24..5c05d3a0910d 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json @@ -64,8 +64,5 @@ 8, 3 ] - ], - "offsetA_out": 6, - "strideA_out1": 1, - "strideA_out2": -3 + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json index 145f0536080b..13ad55184ed7 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json @@ -64,8 +64,5 @@ 8, 3 ] - ], - "offsetA_out": 6, - "strideA_out1": -3, - "strideA_out2": 1 + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json index 762a27c08aa3..a4dad6b7cc99 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json @@ -64,6 +64,5 @@ 2, 3 ] - ], - "offsetA_out": 8 + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json index 98a9963effb3..280b83c1525f 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json @@ -64,6 +64,5 @@ 2, 3 ] - ], - "offsetA_out": 8 + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json index f1dd8e0f0c2f..e3db532e005d 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json @@ -64,6 +64,5 @@ 2, 3 ] - ], - "offsetA_out": 8 + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json index a3e694f2111a..0e58191c6763 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json @@ -64,6 +64,5 @@ 2, 3 ] - ], - "offsetA_out": 8 + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json index b40216c077fa..33ed758a5326 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json @@ -64,6 +64,5 @@ 8, 3 ] - ], - "offsetA_out": 8 + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json index fb49a7fc6a02..06c84c9c4d6e 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json @@ -64,6 +64,5 @@ 8, 3 ] - ], - "offsetA_out": 8 + ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js index 9fd7b29eeb87..ab2cb2133178 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/test.ndarray.js @@ -50,6 +50,20 @@ var MIXED_STRIDES_LOWER_COL_MAJOR = require( './fixtures/mixed_strides/lower_col var MIXED_STRIDES_UPPER_ROW_MAJOR = require( './fixtures/mixed_strides/upper_row_major.json' ); var MIXED_STRIDES_UPPER_COL_MAJOR = require( './fixtures/mixed_strides/upper_col_major.json' ); +var NEGATIVE_STRIDES_ALL_ROW_MAJOR = require( './fixtures/negative_strides/all_row_major.json' ); +var NEGATIVE_STRIDES_ALL_COL_MAJOR = require( './fixtures/negative_strides/all_col_major.json' ); +var NEGATIVE_STRIDES_LOWER_ROW_MAJOR = require( './fixtures/negative_strides/lower_row_major.json' ); +var NEGATIVE_STRIDES_LOWER_COL_MAJOR = require( './fixtures/negative_strides/lower_col_major.json' ); +var NEGATIVE_STRIDES_UPPER_ROW_MAJOR = require( './fixtures/negative_strides/upper_row_major.json' ); +var NEGATIVE_STRIDES_UPPER_COL_MAJOR = require( './fixtures/negative_strides/upper_col_major.json' ); + +var LARGE_STRIDES_ALL_ROW_MAJOR = require( './fixtures/large_strides/all_row_major.json' ); +var LARGE_STRIDES_ALL_COL_MAJOR = require( './fixtures/large_strides/all_col_major.json' ); +var LARGE_STRIDES_LOWER_ROW_MAJOR = require( './fixtures/large_strides/lower_row_major.json' ); +var LARGE_STRIDES_LOWER_COL_MAJOR = require( './fixtures/large_strides/lower_col_major.json' ); +var LARGE_STRIDES_UPPER_ROW_MAJOR = require( './fixtures/large_strides/upper_row_major.json' ); +var LARGE_STRIDES_UPPER_COL_MAJOR = require( './fixtures/large_strides/upper_col_major.json' ); + // TESTS // @@ -351,3 +365,195 @@ tape( 'the function returns expected value when setting upper triangular values t.deepEqual( actualOut, expectedOut, 'returns expected value' ); t.end(); }); + +tape( 'the function returns expected value when setting all values (row-major) (negative strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = NEGATIVE_STRIDES_ALL_ROW_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting all values (column-major) (negative strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = NEGATIVE_STRIDES_ALL_COL_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting lower triangular values (row-major) (negative strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = NEGATIVE_STRIDES_LOWER_ROW_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting lower triangular values (column-major) (negative strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = NEGATIVE_STRIDES_LOWER_COL_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting upper triangular values (row-major) (negative strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = NEGATIVE_STRIDES_UPPER_ROW_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting upper triangular values (column-major) (negative strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = NEGATIVE_STRIDES_UPPER_COL_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting all values (row-major) (large strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = LARGE_STRIDES_ALL_ROW_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting all values (column-major) (large strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = LARGE_STRIDES_ALL_COL_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting lower triangular values (row-major) (large strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = LARGE_STRIDES_LOWER_ROW_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting lower triangular values (column-major) (large strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = LARGE_STRIDES_LOWER_COL_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting upper triangular values (row-major) (large strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = LARGE_STRIDES_UPPER_ROW_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns expected value when setting upper triangular values (column-major) (large strides)', function test( t ) { + var expectedOut; + var actualOut; + var data; + var A; + + data = LARGE_STRIDES_UPPER_COL_MAJOR; + + A = new Float64Array( data.A ); + actualOut = dlaset( data.uplo, data.M, data.N, A, data.strideA1, data.strideA2, data.offsetA, data.alpha, data.beta ); + expectedOut = new Float64Array( data.A_out ); + + t.deepEqual( actualOut, expectedOut, 'returns expected value' ); + t.end(); +}); From 9bb0f3fefcafc22b5a04388a4b4bc63b69971e3d Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 24 Jun 2025 08:18:48 +0000 Subject: [PATCH 09/13] test: update fixtures --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../fixtures/large_strides/all_col_major.json | 36 ++++--------------- .../fixtures/large_strides/all_row_major.json | 36 ++++--------------- .../large_strides/lower_col_major.json | 36 ++++--------------- .../large_strides/lower_row_major.json | 36 ++++--------------- .../large_strides/upper_col_major.json | 36 ++++--------------- .../large_strides/upper_row_major.json | 36 ++++--------------- .../fixtures/mixed_strides/all_col_major.json | 36 ++++--------------- .../fixtures/mixed_strides/all_row_major.json | 36 ++++--------------- .../mixed_strides/lower_col_major.json | 36 ++++--------------- .../mixed_strides/lower_row_major.json | 36 ++++--------------- .../mixed_strides/upper_col_major.json | 36 ++++--------------- .../mixed_strides/upper_row_major.json | 36 ++++--------------- .../negative_strides/all_col_major.json | 36 ++++--------------- .../negative_strides/all_row_major.json | 36 ++++--------------- .../negative_strides/lower_col_major.json | 36 ++++--------------- .../negative_strides/lower_row_major.json | 36 ++++--------------- .../negative_strides/upper_col_major.json | 36 ++++--------------- .../negative_strides/upper_row_major.json | 36 ++++--------------- .../test/fixtures/offsets/all_col_major.json | 36 ++++--------------- .../test/fixtures/offsets/all_row_major.json | 36 ++++--------------- .../fixtures/offsets/lower_col_major.json | 36 ++++--------------- .../fixtures/offsets/lower_row_major.json | 36 ++++--------------- .../fixtures/offsets/upper_col_major.json | 36 ++++--------------- .../fixtures/offsets/upper_row_major.json | 36 ++++--------------- 24 files changed, 144 insertions(+), 720 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_col_major.json index 91bb524a2a39..7f86f5259875 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_col_major.json @@ -24,21 +24,9 @@ 9999 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 2, "strideA2": 6, @@ -67,20 +55,8 @@ 9999 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 2, - 3, - 2 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 2.0, 3.0, 2.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_row_major.json index 4ea65fe7414e..32ff0c758275 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/all_row_major.json @@ -24,21 +24,9 @@ 9999 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 6, "strideA2": 2, @@ -67,20 +55,8 @@ 9999 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 2, - 3, - 2 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 2.0, 3.0, 2.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_col_major.json index 6291e9e0359e..1ca81d015e8b 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_col_major.json @@ -24,21 +24,9 @@ 9999 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 2, "strideA2": 6, @@ -67,20 +55,8 @@ 9999 ], "A_out_mat": [ - [ - 3, - 2, - 3 - ], - [ - 2, - 3, - 6 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 3.0 ], + [ 2.0, 3.0, 6.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_row_major.json index 0e9afcf5e3ec..e28ee3709072 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/lower_row_major.json @@ -24,21 +24,9 @@ 9999 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 6, "strideA2": 2, @@ -67,20 +55,8 @@ 9999 ], "A_out_mat": [ - [ - 3, - 2, - 3 - ], - [ - 2, - 3, - 6 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 3.0 ], + [ 2.0, 3.0, 6.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_col_major.json index 057801cfb6a9..a49b6265fd00 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_col_major.json @@ -24,21 +24,9 @@ 9999 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 2, "strideA2": 6, @@ -67,20 +55,8 @@ 9999 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 4, - 3, - 2 - ], - [ - 7, - 8, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 4.0, 3.0, 2.0 ], + [ 7.0, 8.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_row_major.json index b0f19bfdde77..ee3f596ecbd2 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/large_strides/upper_row_major.json @@ -24,21 +24,9 @@ 9999 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 6, "strideA2": 2, @@ -67,20 +55,8 @@ 9999 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 4, - 3, - 2 - ], - [ - 7, - 8, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 4.0, 3.0, 2.0 ], + [ 7.0, 8.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json index 260f4d8d9344..207b151cc180 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_col_major.json @@ -15,21 +15,9 @@ 7 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 1, "strideA2": -3, @@ -49,20 +37,8 @@ 2 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 2, - 3, - 2 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 2.0, 3.0, 2.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json index 2fa6db0eacaf..60bb9db83081 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/all_row_major.json @@ -15,21 +15,9 @@ 3 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": -3, "strideA2": 1, @@ -49,20 +37,8 @@ 2 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 2, - 3, - 2 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 2.0, 3.0, 2.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json index 44502623a871..381ac37e99ce 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_col_major.json @@ -15,21 +15,9 @@ 7 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 1, "strideA2": -3, @@ -49,20 +37,8 @@ 2 ], "A_out_mat": [ - [ - 3, - 2, - 3 - ], - [ - 2, - 3, - 6 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 3.0 ], + [ 2.0, 3.0, 6.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json index cb3eee70e4d3..ba93497dc10e 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/lower_row_major.json @@ -15,21 +15,9 @@ 3 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": -3, "strideA2": 1, @@ -49,20 +37,8 @@ 3 ], "A_out_mat": [ - [ - 3, - 2, - 3 - ], - [ - 2, - 3, - 6 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 3.0 ], + [ 2.0, 3.0, 6.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json index 5c05d3a0910d..57d490b24f68 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_col_major.json @@ -15,21 +15,9 @@ 7 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 1, "strideA2": -3, @@ -49,20 +37,8 @@ 7 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 4, - 3, - 2 - ], - [ - 7, - 8, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 4.0, 3.0, 2.0 ], + [ 7.0, 8.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json index 13ad55184ed7..12d941dab552 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/mixed_strides/upper_row_major.json @@ -15,21 +15,9 @@ 3 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": -3, "strideA2": 1, @@ -49,20 +37,8 @@ 2 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 4, - 3, - 2 - ], - [ - 7, - 8, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 4.0, 3.0, 2.0 ], + [ 7.0, 8.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json index a4dad6b7cc99..49c1e40c7ff7 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_col_major.json @@ -15,21 +15,9 @@ 1 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": -1, "strideA2": -3, @@ -49,20 +37,8 @@ 3 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 2, - 3, - 2 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 2.0, 3.0, 2.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json index 280b83c1525f..450f0ed563c8 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/all_row_major.json @@ -15,21 +15,9 @@ 1 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": -3, "strideA2": -1, @@ -49,20 +37,8 @@ 3 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 2, - 3, - 2 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 2.0, 3.0, 2.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json index e3db532e005d..717e939433ad 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_col_major.json @@ -15,21 +15,9 @@ 1 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": -1, "strideA2": -3, @@ -49,20 +37,8 @@ 3 ], "A_out_mat": [ - [ - 3, - 2, - 3 - ], - [ - 2, - 3, - 6 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 3.0 ], + [ 2.0, 3.0, 6.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json index 0e58191c6763..ee89f39439d0 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/lower_row_major.json @@ -15,21 +15,9 @@ 1 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": -3, "strideA2": -1, @@ -49,20 +37,8 @@ 3 ], "A_out_mat": [ - [ - 3, - 2, - 3 - ], - [ - 2, - 3, - 6 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 3.0 ], + [ 2.0, 3.0, 6.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json index 33ed758a5326..542967cebdac 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_col_major.json @@ -15,21 +15,9 @@ 1 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": -1, "strideA2": -3, @@ -49,20 +37,8 @@ 3 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 4, - 3, - 2 - ], - [ - 7, - 8, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 4.0, 3.0, 2.0 ], + [ 7.0, 8.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json index 06c84c9c4d6e..68c1cb329343 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/negative_strides/upper_row_major.json @@ -15,21 +15,9 @@ 1 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": -3, "strideA2": -1, @@ -49,20 +37,8 @@ 3 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 4, - 3, - 2 - ], - [ - 7, - 8, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 4.0, 3.0, 2.0 ], + [ 7.0, 8.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_col_major.json index 525ee5c59368..f4f959e78f3f 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_col_major.json @@ -16,21 +16,9 @@ 9 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 1, "strideA2": 3, @@ -51,20 +39,8 @@ 3 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 2, - 3, - 2 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 2.0, 3.0, 2.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_row_major.json index d0e5cb7d737b..17857942ff1d 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/all_row_major.json @@ -16,21 +16,9 @@ 9 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 3, "strideA2": 1, @@ -51,20 +39,8 @@ 3 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 2, - 3, - 2 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 2.0, 3.0, 2.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_col_major.json index 25fe7d95a2c6..384910013f12 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_col_major.json @@ -16,21 +16,9 @@ 9 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 1, "strideA2": 3, @@ -51,20 +39,8 @@ 3 ], "A_out_mat": [ - [ - 3, - 2, - 3 - ], - [ - 2, - 3, - 6 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 3.0 ], + [ 2.0, 3.0, 6.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_row_major.json index e646f8040285..418a629c08f0 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/lower_row_major.json @@ -16,21 +16,9 @@ 9 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 3, "strideA2": 1, @@ -51,20 +39,8 @@ 3 ], "A_out_mat": [ - [ - 3, - 2, - 3 - ], - [ - 2, - 3, - 6 - ], - [ - 2, - 2, - 3 - ] + [ 3.0, 2.0, 3.0 ], + [ 2.0, 3.0, 6.0 ], + [ 2.0, 2.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_col_major.json index 49bacd4b674f..b40f4485b2bd 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_col_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_col_major.json @@ -16,21 +16,9 @@ 9 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 1, "strideA2": 3, @@ -51,20 +39,8 @@ 3 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 4, - 3, - 2 - ], - [ - 7, - 8, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 4.0, 3.0, 2.0 ], + [ 7.0, 8.0, 3.0 ] ] } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_row_major.json index ccb667b465af..92bb2b325ec9 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_row_major.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/test/fixtures/offsets/upper_row_major.json @@ -16,21 +16,9 @@ 9 ], "A_mat": [ - [ - 1, - 2, - 3 - ], - [ - 4, - 5, - 6 - ], - [ - 7, - 8, - 9 - ] + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] ], "strideA1": 3, "strideA2": 1, @@ -51,20 +39,8 @@ 3 ], "A_out_mat": [ - [ - 3, - 2, - 2 - ], - [ - 4, - 3, - 2 - ], - [ - 7, - 8, - 3 - ] + [ 3.0, 2.0, 2.0 ], + [ 4.0, 3.0, 2.0 ], + [ 7.0, 8.0, 3.0 ] ] } From 5e70f15470fee47c4926162f4e333d570354d456 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 24 Jun 2025 08:51:34 +0000 Subject: [PATCH 10/13] docs: add index.d.ts --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../lapack/base/dlaset/docs/types/index.d.ts | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/index.d.ts diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/index.d.ts new file mode 100644 index 000000000000..30a28f55cf35 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/index.d.ts @@ -0,0 +1,111 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Layout } from '@stdlib/types/blas'; + +/** +* Interface describing `dlaset`. +*/ +interface Routine { + /** + * Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals. + * + * @param order - storage layout of `A` and `B` + * @param uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A` + * @param M - number of rows in matrix `A` + * @param N - number of columns in matrix `A` + * @param A - input matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param alpha - number to set on off diagonal elements + * @param beta - number to set on diagonal elements + * @returns `A` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var A = new Float64Array( 4 ); + * + * dlaset( 'row-major', 'all', 2, 2, A, 2, 0.0, 1.0 ); + * // A => [ 1.0, 0.0, 0.0, 1.0 ] + */ + ( order: Layout, uplo: string, M: number, N: number, A: Float64Array, LDA: number, alpha: number, beta: number ): Float64Array; + + /** + * Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals using alternative indexing semantics. + * + * @param uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A` + * @param M - number of rows in matrix `A` + * @param N - number of columns in matrix `A` + * @param A - input matrix + * @param strideA1 - stride of the first dimension of `A` + * @param strideA2 - stride of the second dimension of `A` + * @param offsetA - starting index for `A` + * @param alpha - number to set on off diagonal elements + * @param beta - number to set on diagonal elements + * @returns `A` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var A = new Float64Array( 4 ); + * + * dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 0.0, 1.0 ); + * // A => [ 1.0, 0.0, 0.0, 1.0 ] + */ + ndarray( uplo: string, M: number, N: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number, alpha: number, beta: number ): Float64Array; +} + +/** +* Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals. +* +* @param order - storage layout of `A` and `B` +* @param uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A` +* @param M - number of rows in matrix `A` +* @param N - number of columns in matrix `A` +* @param A - input matrix +* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param alpha - number to set on off diagonal elements +* @param beta - number to set on diagonal elements +* @returns `A` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( 4 ); +* +* dlaset( 'row-major', 'all', 2, 2, A, 2, 0.0, 1.0 ); +* // A => [ 1.0, 0.0, 0.0, 1.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( 4 ); +* +* dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 0.0, 1.0 ); +* // A => [ 1.0, 0.0, 0.0, 1.0 ] +*/ +declare var dlaset: Routine; + + +// EXPORTS // + +export = dlaset; From 050b4ca66b531d71493c66fb181eb261827c64d2 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 24 Jun 2025 09:18:28 +0000 Subject: [PATCH 11/13] docs: add test.ts --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../lapack/base/dlaset/docs/types/test.ts | 302 ++++++++++++++++++ 1 file changed, 302 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/test.ts diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/test.ts b/lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/test.ts new file mode 100644 index 000000000000..93fddd3cdb89 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/test.ts @@ -0,0 +1,302 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import dlaset = require( './index' ); + + +// TESTS // + +// The function returns a Float64Array... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset( 'row-major', 'all', 2, 2, A, 2, 1.0, 2.0 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset( 5, 'all', 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( true, 'all', 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( false, 'all', 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( null, 'all', 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( void 0, 'all', 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( [], 'all', 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( {}, 'all', 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( ( x: number ): number => x, 'all', 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset( 'row-major', 5, 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', true, 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', false, 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', null, 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', void 0, 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', [], 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', {}, 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', ( x: number ): number => x, 2, 2, A, 2, 2.0, 2.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset( 'row-major', 'all', '5', 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', true, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', false, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', null, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', void 0, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', [], 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', {}, 2, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', ( x: number ): number => x, 2, A, 2, 2.0, 2.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset( 'row-major', 'all', 2, '5', A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, true, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, false, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, null, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, void 0, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, [], A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, {}, A, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, ( x: number ): number => x, A, 2, 2.0, 2.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a Float64Array... +{ + dlaset( 'row-major', 'all', 2, 2, '5', 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, 5, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, true, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, false, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, null, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, void 0, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, [], 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, {}, 2, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, ( x: number ): number => x, 2, 2.0, 2.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset( 'row-major', 'all', 2, 2, A, '5', 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, true, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, false, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, null, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, void 0, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, [], 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, {}, 2.0, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, ( x: number ): number => x, 2.0, 2.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset( 'row-major', 'all', 2, 2, A, 2, '5', 2 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, true, 2 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, false, 2 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, null, 2 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, void 0, 2 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, [], 2 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, {}, 2 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, ( x: number ): number => x, 2 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset( 'row-major', 'all', 2, 2, A, 2, 2.0, '5' ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, 2.0, true ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, 2.0, false ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, 2.0, null ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, 2.0, void 0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, 2.0, [] ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, 2.0, {} ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, 2.0, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset(); // $ExpectError + dlaset( 'row-major' ); // $ExpectError + dlaset( 'row-major', 'all' ); // $ExpectError + dlaset( 'row-major', 'all', 2 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, 2.0 ); // $ExpectError + dlaset( 'row-major', 'all', 2, 2, A, 2, 2.0, 2.0, 10.0 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Float64Array... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset.ndarray( 5, 2, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( true, 2, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( false, 2, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( null, 2, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( void 0, 2, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( [], 2, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( {}, 2, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( ( x: number ): number => x, 2, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset.ndarray( 'all', '5', 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', true, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', false, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', null, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', void 0, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', [], 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', {}, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', ( x: number ): number => x, 2, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset.ndarray( 'all', 2, '5', A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, true, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, false, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, null, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, void 0, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, [], A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, {}, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, ( x: number ): number => x, A, 2, 1, 0, 2.0, 2.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a Float64Array... +{ + dlaset.ndarray( 'all', 2, 2, '5', 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, 5, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, true, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, false, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, null, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, void 0, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, [], 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, {}, 2, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, ( x: number ): number => x, 2, 1, 0, 2.0, 2.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset.ndarray( 'all', 2, 2, A, '5', 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, true, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, false, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, null, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, void 0, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, [], 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, {}, 1, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, ( x: number ): number => x, 1, 0, 2.0, 2.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset.ndarray( 'all', 2, 2, A, 2, '5', 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, true, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, false, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, null, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, void 0, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, [], 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, {}, 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, ( x: number ): number => x, 0, 2.0, 2.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset.ndarray( 'all', 2, 2, A, 2, 1, '5', 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, true, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, false, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, null, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, void 0, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, [], 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, {}, 2.0, 2.0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, ( x: number ): number => x, 2.0, 2.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, '5', 2 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, false, 2 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, null, 2 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, void 0, 2 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, [], 2 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, {}, 2 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, ( x: number ): number => x, 2 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 2.0, '5' ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 2.0, true ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 2.0, false ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 2.0, null ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 2.0, void 0 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 2.0, [] ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 2.0, {} ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 2.0, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + dlaset.ndarray(); // $ExpectError + dlaset.ndarray( 'all' ); // $ExpectError + dlaset.ndarray( 'all', 2 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 1 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 2.0, 2.0, 1 ); // $ExpectError + dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 2.0, 2.0, 1, 0, 10 ); // $ExpectError +} From 39e963a29a41d5772ab94eff816bb937c87d506f Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 24 Jun 2025 10:35:22 +0000 Subject: [PATCH 12/13] 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/dlaset/README.md | 248 ++++++++++++++++++ 1 file changed, 248 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/README.md diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/README.md b/lib/node_modules/@stdlib/lapack/base/dlaset/README.md new file mode 100644 index 000000000000..e508ff3bbf81 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/README.md @@ -0,0 +1,248 @@ + + +# dlaset + +> LAPACK routine to initialize an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals. + +
+ +## Usage + +```javascript +var dlaset = require( '@stdlib/lapack/base/dlaset' ); +``` + +#### dlaset( order, uplo, M, N, A, LDA, alpha, beta ) + +Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( 4 ); + +dlaset( 'row-major', 'all', 2, 2, A, 2, 0.0, 1.0 ); +// A => [ 1.0, 0.0, 0.0, 1.0 ] +``` + +The function has the following parameters: + +- **order**: storage layout. +- **uplo**: specifies whether to set the upper or lower triangular/trapezoidal part of a matrix `A`. +- **M**: number of rows in `A`. +- **N**: number of columns in `A`. +- **A**: input [`Float64Array`][mdn-float64array]. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **alpha**: number to set on the off-diagonal elements. +- **beta**: number to set on the diagonal elements. + +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 A0 = new Float64Array( 5 ); + +// Create offset views... +var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +dlaset( 'row-major', 'all', 2, 2, A1, 2, 0.0, 1.0 ); +// A0 => [ 0.0, 1.0, 0.0, 0.0, 1.0 ] +``` + +#### dlaset.ndarray( uplo, M, N, A, sa1, sa2, oa, alpha, beta ) + +Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals using alternative indexing semantics. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( 4 ); + +dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 0.0, 1.0 ); +// A => [ 1.0, 0.0, 0.0, 1.0 ] +``` + +The function has the following parameters: + +- **uplo**: specifies whether to copy the upper or lower triangular/trapezoidal part of a matrix `A`. +- **M**: number of rows in `A`. +- **N**: number of columns in `A`. +- **A**: input [`Float64Array`][mdn-float64array]. +- **sa1**: stride of the first dimension of `A`. +- **sa2**: stride of the second dimension of `A`. +- **oa**: starting index for `A`. +- **alpha**: number to set on the off-diagonal elements. +- **beta**: number to set on the diagonal elements. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( 5 ); + +dlaset.ndarray( 'all', 2, 2, A, 2, 1, 1, 0.0, 1.0 ); +// A => [ 0.0, 1.0, 0.0, 0.0, 1.0 ] +``` + +
+ + + +
+ +## Notes + +- `dlaset()` corresponds to the [LAPACK][lapack] routine [`dlaset`][lapack-dlaset]. + +
+ + + +
+ +## Examples + + + +```javascript +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var uniform = require( '@stdlib/random/array/discrete-uniform' ); +var numel = require( '@stdlib/ndarray/base/numel' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var dlaset = require( '@stdlib/lapack/base/dlaset' ); + +var shape = [ 5, 8 ]; +var order = 'row-major'; +var strides = shape2strides( shape, order ); + +var N = numel( shape ); + +var A = uniform( N, -10, 10, { + 'dtype': 'float64' +}); +console.log( ndarray2array( A, shape, strides, 0, order ) ); + +dlaset( order, 'all', shape[ 0 ], shape[ 1 ], A, strides[ 0 ], 2.0, 3.0 ); +console.log( ndarray2array( A, shape, strides, 0, order ) ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + From b3babe1ce073490c0242361319a0bb49ad3006f9 Mon Sep 17 00:00:00 2001 From: Aayush Khanna Date: Tue, 24 Jun 2025 10:47:37 +0000 Subject: [PATCH 13/13] 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: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: 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 --- --- .../@stdlib/lapack/base/dlaset/README.md | 2 +- .../@stdlib/lapack/base/dlaset/docs/repl.txt | 100 ++++++++++++++++++ .../lapack/base/dlaset/docs/types/index.d.ts | 2 +- .../lapack/base/dlaset/docs/types/test.ts | 2 +- 4 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaset/docs/repl.txt diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/README.md b/lib/node_modules/@stdlib/lapack/base/dlaset/README.md index e508ff3bbf81..1f226d5e329a 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/README.md +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2024 The Stdlib Authors. +Copyright (c) 2025 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/dlaset/docs/repl.txt new file mode 100644 index 000000000000..96add34336f0 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/docs/repl.txt @@ -0,0 +1,100 @@ + +{{alias}}( order, uplo, M, N, A, LDA, alpha, beta ) + Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` + on the off diagonals. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + Parameters + ---------- + order: string + Row-major (C-style) or column-major (Fortran-style) order. Must be + either 'row-major' or 'column-major'. + + uplo: string + Specifies whether to set the upper or lower triangular/trapezoidal part + of a matrix `A`. + + M: integer + Number of rows in `A`. + + N: integer + Number of columns in `A`. + + A: Float64Array + Input matrix `A`. + + LDA: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + alpha: number + Number to set on the off-diagonal elements. + + beta: number + Number to set on the diagonal elements. + + Returns + ------- + A: Float64Array + Output matrix. + + Examples + -------- + > var A = new {{alias:@stdlib/array/float64}}( 4 ); + > {{alias}}( 'row-major', 'all', 2, 2, A, 2, 0.0, 1.0 ) + [ 1.0, 0.0, 0.0, 1.0 ] + + +{{alias}}.ndarray( uplo, M, N, A, sa1, sa2, oa, alpha, beta ) + Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` + on the off diagonals using alternative indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameters support indexing semantics based on starting + indices. + + Parameters + ---------- + uplo: string + Specifies whether to set the upper or lower triangular/trapezoidal part + of a matrix `A`. + + M: integer + Number of rows in `A`. + + N: integer + Number of columns in `A`. + + A: Float64Array + Input matrix `A`. + + sa1: integer + Stride of the first dimension of `A`. + + sa2: integer + Stride of the second dimension of `A`. + + oa: integer + Starting index for `A`. + + alpha: number + Number to set on the off-diagonal elements. + + beta: number + Number to set on the diagonal elements. + + Returns + ------- + A: Float64Array + Output matrix. + + Examples + -------- + > var A = new {{alias:@stdlib/array/float64}}( 4 ); + > {{alias}}.ndarray( 'all', 2, 2, A, 2, 1, 0, 0.0, 1.0 ) + [ 1.0, 0.0, 0.0, 1.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/index.d.ts index 30a28f55cf35..cb0f09766218 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/index.d.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/test.ts b/lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/test.ts index 93fddd3cdb89..7a4749ada350 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/test.ts +++ b/lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/test.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.