From 22524531ad9345e41e3a4630e1eec9c1411d395e Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Sat, 6 Jul 2024 12:27:09 +0530 Subject: [PATCH 01/33] feat: add blas/base/dtrsm/lib --- .../@stdlib/blas/base/dtrsm/lib/base.js | 700 ++++++++++++++++++ .../@stdlib/blas/base/dtrsm/lib/dtrsm.js | 88 +++ .../@stdlib/blas/base/dtrsm/lib/index.js | 53 ++ .../@stdlib/blas/base/dtrsm/lib/main.js | 35 + .../@stdlib/blas/base/dtrsm/lib/ndarray.js | 89 +++ 5 files changed, 965 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js new file mode 100644 index 000000000000..3724043a1be9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js @@ -0,0 +1,700 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MAIN // + +/** +* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +* +* @private +* @param {string} orderA - specifies the memory layout of `A`. +* @param {string} orderB - specifies the memory layout of `B`. +* @param {string} side - specifies whether `op( A )` appears on the left or right of `X`. +* @param {string} uplo - specifies whether the matrix `A` is an upper or lower triangular matrix. +* @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication. +* @param {string} diag - specifies whether or not `A` is unit triangular. +* @param {NonNegativeInteger} m - number of rows in `B`. +* @param {NonNegativeInteger} n - number of columns in `B`. +* @param {number} alpha - scalar alpha. +* @param {Float64Array} A - input matrix `A`. +* @param {NonNegativeInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {NonNegativeInteger} offsetA - index offset for matrix `A`. +* @param {Float64Array} B - input matrix `B`. +* @param {NonNegativeInteger} LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) +* @param {NonNegativeInteger} offsetB - index offset for matrix `B`. +* @returns {Float64Array} matrix `B`. +* +* @example +* TODO: +*/ +function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ) { // eslint-disable-line max-len + var nounit; + var lside; + var lower; + var upper; + var tmp; + var i; + var j; + var k; + + lside = side === 'L'; + nounit = diag === 'N'; + upper = uplo === 'U'; + + // TODO: remove it + offsetB = offsetA; + offsetA = offsetB; + + if ( m === 0 || n === 0 ) { + return B; + } + if ( alpha === 0.0 ) { + if ( orderB === 'row-major' ) { + for ( j = 0; j < n; j++ ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] = 0.0; + } + } + return B; + } + for ( j = 0; j < n; j++ ) { + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] = 0.0; + } + } + return B; + } + if ( lside ) { + if ( transa === 'N' ) { + // B := alpha * inv( A ) * B + if ( orderB === 'column-major' ) { + if ( orderA === 'column-major' && upper ) { + for ( j = 0; j < n; j++ ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] *= alpha; + } + } + for ( k = m - 1; k >= 0; k-- ) { + if ( B[ ( j * LDB ) + k ] !== 0 ) { + if ( nounit ) { + B[ ( j * LDB ) + k ] /= A[ ( k * LDA ) + k ]; + } + for ( i = 0; i < k; i++ ) { + B[ ( j * LDB ) + i ] -= B[ ( j * LDB ) + k ] * A[ ( k * LDA ) + i ]; + } + } + } + } + return B; + } + if ( orderA === 'row-major' && lower ) { + for ( j = 0; j < n; j++ ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] *= alpha; + } + } + for ( k = m - 1; k >= 0; k-- ) { + if ( B[ ( j * LDB ) + k ] !== 0 ) { + if ( nounit ) { + B[ ( j * LDB ) + k ] /= A[ ( k * LDA ) + k ]; + } + for ( i = 0; i < k; i++ ) { + B[ ( j * LDB ) + i ] -= B[ ( j * LDB ) + k ] * A[ ( i * LDA ) + k ]; + } + } + } + } + return B; + } + if ( orderA === 'column-major' && lower ) { + for ( j = 0; j < n; j++ ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] *= alpha; + } + } + for ( k = 0; k < m; k++ ) { + if ( B[ ( j * LDB ) + k ] !== 0 ) { + if ( nounit ) { + B[ ( j * LDB ) + k ] /= A[ ( k * LDA ) + k ]; + } + for ( i = k; i < m; i++ ) { + B[ ( j * LDB ) + i ] -= B[ ( j * LDB ) + k ] * A[ ( k * LDA ) + i ]; + } + } + } + } + return B; + } + // ( orderA === "row-major" && upper ) + for ( j = 0; j < n; j++ ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] *= alpha; + } + } + for ( k = 0; k < m; k++ ) { + if ( B[ ( j * LDB ) + k ] !== 0 ) { + if ( nounit ) { + B[ ( j * LDB ) + k ] /= A[ ( k * LDA ) + k ]; + } + for ( i = k + 1; i < m; i++ ) { + B[ ( j * LDB ) + i ] -= B[ ( j * LDB ) + k ] * A[ ( i * LDA ) + k ]; + } + } + } + } + return B; + } + // orderB === "row-major" + if ( orderA === 'column-major' && upper ) { + for ( j = 0; j < n; j++ ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] *= alpha; + } + } + for ( k = m - 1; k >= 0; k-- ) { + if ( B[ ( k * LDB ) + j ] !== 0 ) { + if ( nounit ) { + B[ ( k * LDB ) + j ] /= A[ ( k * LDA ) + k ]; + } + for ( i = 0; i < k; i++ ) { + B[ ( i * LDB ) + j ] -= B[ ( k * LDB ) + j ] * A[ ( k * LDA ) + i ]; + } + } + } + } + return B; + } + if ( orderA === 'row-major' && lower ) { + for ( j = 0; j < n; j++ ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] *= alpha; + } + } + for ( k = m - 1; k >= 0; k-- ) { + if ( B[ ( k * LDB ) + j ] !== 0 ) { + if ( nounit ) { + B[ ( k * LDB ) + j ] /= A[ ( k * LDA ) + k ]; + } + for ( i = 0; i < k; i++ ) { + B[ ( i * LDB ) + j ] -= B[ ( k * LDB ) + j ] * A[ ( i * LDA ) + k ]; + } + } + } + } + return B; + } + if ( orderA === 'column-major' && lower ) { + for ( j = 0; j < n; j++ ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] *= alpha; + } + } + for ( k = 0; k < m; k++ ) { + if ( B[ ( k * LDB ) + j ] !== 0 ) { + if ( nounit ) { + B[ ( k * LDB ) + j ] /= A[ ( k * LDA ) + k ]; + } + for ( i = k; i < m; i++ ) { + B[ ( i * LDB ) + j ] -= B[ ( k * LDB ) + j ] * A[ ( k * LDA ) + i ]; + } + } + } + } + return B; + } + // ( orderA === "row-major" && upper ) + for ( j = 0; j < n; j++ ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] *= alpha; + } + } + for ( k = 0; k < m; k++ ) { + if ( B[ ( k * LDB ) + j ] !== 0 ) { + if ( nounit ) { + B[ ( k * LDB ) + j ] /= A[ ( k * LDA ) + k ]; + } + for ( i = k + 1; i < m; i++ ) { + B[ ( i * LDB ) + j ] -= B[ ( k * LDB ) + j ] * A[ ( i * LDA ) + k ]; + } + } + } + } + return B; + } + // B := alpha * inv( A**T ) * B + if ( orderB === 'column-major' ) { + if ( orderA === 'column-major' && upper ) { + for ( j = 0; j < n; j++ ) { + for ( i = 0; i < m; i++ ) { + tmp = alpha * B[ ( j * LDB ) + i ]; + for ( k = 0; k < i - 1; k++ ) { + tmp -= A[ ( i * LDA ) + k ] * B[ ( j * LDB ) + k ]; + } + if ( nounit ) { + tmp /= A[ ( i * LDA ) + i ]; + } + B[ ( j * LDB ) + i ] = tmp; + } + } + return B; + } + if ( orderA === 'row-major' && lower ) { + for ( j = 0; j < n; j++ ) { + for ( i = 0; i < m; i++ ) { + tmp = alpha * B[ ( j * LDB ) + i ]; + for ( k = 0; k < i - 1; k++ ) { + tmp -= A[ ( k * LDA ) + i ] * B[ ( j * LDB ) + k ]; + } + if ( nounit ) { + tmp /= A[ ( i * LDA ) + i ]; + } + B[ ( j * LDB ) + i ] = tmp; + } + } + return B; + } + if ( orderA === 'column-major' && lower ) { + for ( j = 0; j < n; j++ ) { + for ( i = m - 1; i >= 0; i-- ) { + tmp = alpha * B[ ( j * LDB ) + i ]; + for ( k = i; k < m; k++ ) { + tmp -= A[ ( i * LDA ) + k ] * B[ ( j * LDB ) + k ]; + } + if ( nounit ) { + tmp /= A[ ( i * LDA ) + i ]; + } + B[ ( j * LDB ) + i ] = tmp; + } + } + return B; + } + // ( orderA === "row-major" && upper ) + for ( j = 0; j < n; j++ ) { + for ( i = 0; i < m; i++ ) { + tmp = alpha * B[ ( j * LDB ) + i ]; + for ( k = i; k < m; k++ ) { + tmp -= A[ ( k * LDA ) + i ] * B[ ( j * LDB ) + k ]; + } + if ( nounit ) { + tmp /= A[ ( i * LDA ) + i ]; + } + B[ ( j * LDB ) + i ] = tmp; + } + } + return B; + } + } + // !lside + if ( transa === 'N' ) { + // B := alpha * B * inv( A ) + if ( orderB === 'column-major' ) { + if ( orderA === 'column-major' && upper ) { + for ( j = 0; j < n; j++ ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] *= alpha; + } + } + for ( k = 0; k < j - 1; k++ ) { + if ( A[ ( j * LDA ) + k ] !== 0 ) { + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] -= A[ ( j * LDA ) + k ] * B[ ( k * LDB ) + i ]; + } + } + } + if ( nounit ) { + tmp = 1.0 / A[ ( j * LDA ) + j ]; + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] *= tmp; + } + } + } + return B; + } + if ( orderA === 'row-major' && lower ) { + for ( j = 0; j < n; j++ ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] *= alpha; + } + } + for ( k = 0; k < j - 1; k++ ) { + if ( A[ ( k * LDA ) + j ] !== 0 ) { + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] -= A[ ( k * LDA ) + j ] * B[ ( k * LDB ) + i ]; + } + } + } + if ( nounit ) { + tmp = 1.0 / A[ ( j * LDA ) + j ]; + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] *= tmp; + } + } + } + return B; + } + if ( orderA === 'column-major' && lower ) { + for ( j = n - 1; j >= 0; j-- ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] *= alpha; + } + } + for ( k = j; k < n; k++ ) { + if ( A[ ( j * LDA ) + k ] !== 0 ) { + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] -= A[ ( j * LDA ) + k ] * B[ ( k * LDB ) + i ]; + } + } + } + if ( nounit ) { + tmp = 1.0 / A[ ( j * LDA ) + j ]; + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] *= tmp; + } + } + } + return B; + } + // ( orderA === "row-major" && upper ) + for ( j = n - 1; j >= 0; j-- ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] *= alpha; + } + } + for ( k = j; k < n; k++ ) { + if ( A[ ( k * LDA ) + j ] !== 0 ) { + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] -= A[ ( k * LDA ) + j ] * B[ ( k * LDB ) + i ]; + } + } + } + if ( nounit ) { + tmp = 1.0 / A[ ( j * LDA ) + j ]; + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] *= tmp; + } + } + } + return B; + } + // orderB === "row-major" + if ( orderA === 'column-major' && upper ) { + for ( j = 0; j < n; j++ ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] *= alpha; + } + } + for ( k = 0; k < j - 1; k++ ) { + if ( A[ ( j * LDA ) + k ] !== 0 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] -= A[ ( j * LDA ) + k ] * B[ ( i * LDB ) + k ]; + } + } + } + if ( nounit ) { + tmp = 1.0 / A[ ( j * LDA ) + j ]; + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] *= tmp; + } + } + } + return B; + } + if ( orderA === 'row-major' && lower ) { + for ( j = 0; j < n; j++ ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] *= alpha; + } + } + for ( k = 0; k < j - 1; k++ ) { + if ( A[ ( k * LDA ) + j ] !== 0 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] -= A[ ( k * LDA ) + j ] * B[ ( i * LDB ) + k ]; + } + } + } + if ( nounit ) { + tmp = 1.0 / A[ ( j * LDA ) + j ]; + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] *= tmp; + } + } + } + return B; + } + if ( orderA === 'column-major' && lower ) { + for ( j = n - 1; j >= 0; j-- ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] *= alpha; + } + } + for ( k = j; k < n; k++ ) { + if ( A[ ( j * LDA ) + k ] !== 0 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] -= A[ ( j * LDA ) + k ] * B[ ( i * LDB ) + k ]; + } + } + } + if ( nounit ) { + tmp = 1.0 / A[ ( j * LDA ) + j ]; + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] *= tmp; + } + } + } + return B; + } + // ( orderA === "row-major" && upper ) + for ( j = n - 1; j >= 0; j-- ) { + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] *= alpha; + } + } + for ( k = j; k < n; k++ ) { + if ( A[ ( k * LDA ) + j ] !== 0 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] -= A[ ( k * LDA ) + j ] * B[ ( i * LDB ) + k ]; + } + } + } + if ( nounit ) { + tmp = 1.0 / A[ ( j * LDA ) + j ]; + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] *= tmp; + } + } + } + return B; + } + // B := alpha * B * inv( A**T ) + if ( orderB === 'column-major' ) { + if ( orderA === 'column-major' && upper ) { + for ( k = n - 1; k >= 0; k-- ) { + if ( nounit ) { + tmp = 1.0 / A[ ( k * LDA ) + k ]; + for ( i = 0; i < m; i++ ) { + B[ ( k * LDB ) + i ] *= tmp; + } + } + for ( j = 0; j < k - 1; j++ ) { + if ( A[ ( k * LDA ) + j ] !== 0 ) { + tmp = A[ ( k * LDA ) + j ]; + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] -= tmp * B[ ( k * LDB ) + i ]; + } + } + } + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( k * LDB ) + i ] *= alpha; + } + } + } + return B; + } + if ( orderA === 'row-major' && lower ) { + for ( k = n - 1; k >= 0; k-- ) { + if ( nounit ) { + tmp = 1.0 / A[ ( k * LDA ) + k ]; + for ( i = 0; i < m; i++ ) { + B[ ( k * LDB ) + i ] *= tmp; + } + } + for ( j = 0; j < k - 1; j++ ) { + if ( A[ ( j * LDA ) + k ] !== 0 ) { + tmp = A[ ( j * LDA ) + k ]; + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] -= tmp * B[ ( k * LDB ) + i ]; + } + } + } + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( k * LDB ) + i ] *= alpha; + } + } + } + return B; + } + if ( orderA === 'column-major' && lower ) { + for ( k = 0; k < n; k++ ) { + if ( nounit ) { + tmp = 1.0 / A[ ( k * LDA ) + k ]; + for ( i = 0; i < m; i++ ) { + B[ ( k * LDB ) + i ] *= tmp; + } + } + for ( j = k; j < n; j++ ) { + if ( A[ ( k * LDA ) + j ] !== 0 ) { + tmp = A[ ( k * LDA ) + j ]; + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] -= tmp * B[ ( k * LDB ) + i ]; + } + } + } + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( k * LDB ) + i ] *= alpha; + } + } + } + return B; + } + // ( orderA === "row-major" && upper ) + for ( k = 0; k < n; k++ ) { + if ( nounit ) { + tmp = 1.0 / A[ ( k * LDA ) + k ]; + for ( i = 0; i < m; i++ ) { + B[ ( k * LDB ) + i ] *= tmp; + } + } + for ( j = k; j < n; j++ ) { + if ( A[ ( j * LDA ) + k ] !== 0 ) { + tmp = A[ ( j * LDA ) + k ]; + for ( i = 0; i < m; i++ ) { + B[ ( j * LDB ) + i ] -= tmp * B[ ( k * LDB ) + i ]; + } + } + } + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( k * LDB ) + i ] *= alpha; + } + } + } + return B; + } + // orderB === "row-major" + if ( orderA === 'column-major' && upper ) { + for ( k = n - 1; k >= 0; k-- ) { + if ( nounit ) { + tmp = 1.0 / A[ ( k * LDA ) + k ]; + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + k ] *= tmp; + } + } + for ( j = 0; j < k - 1; j++ ) { + if ( A[ ( k * LDA ) + j ] !== 0 ) { + tmp = A[ ( k * LDA ) + j ]; + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] -= tmp * B[ ( i * LDB ) + k ]; + } + } + } + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + k ] *= alpha; + } + } + } + return B; + } + if ( orderA === 'row-major' && lower ) { + for ( k = n - 1; k >= 0; k-- ) { + if ( nounit ) { + tmp = 1.0 / A[ ( k * LDA ) + k ]; + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + k ] *= tmp; + } + } + for ( j = 0; j < k - 1; j++ ) { + if ( A[ ( j * LDA ) + k ] !== 0 ) { + tmp = A[ ( j * LDA ) + k ]; + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] -= tmp * B[ ( i * LDB ) + k ]; + } + } + } + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + k ] *= alpha; + } + } + } + return B; + } + if ( orderA === 'column-major' && lower ) { + for ( k = 0; k < n; k++ ) { + if ( nounit ) { + tmp = 1.0 / A[ ( k * LDA ) + k ]; + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + k ] *= tmp; + } + } + for ( j = k; j < n; j++ ) { + if ( A[ ( k * LDA ) + j ] !== 0 ) { + tmp = A[ ( k * LDA ) + j ]; + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] -= tmp * B[ ( i * LDB ) + k ]; + } + } + } + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + k ] *= alpha; + } + } + } + return B; + } + // ( orderA === "row-major" && upper ) + for ( k = 0; k < n; k++ ) { + if ( nounit ) { + tmp = 1.0 / A[ ( k * LDA ) + k ]; + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + k ] *= tmp; + } + } + for ( j = k; j < n; j++ ) { + if ( A[ ( j * LDA ) + k ] !== 0 ) { + tmp = A[ ( j * LDA ) + k ]; + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + j ] -= tmp * B[ ( i * LDB ) + k ]; + } + } + } + if ( alpha !== 1 ) { + for ( i = 0; i < m; i++ ) { + B[ ( i * LDB ) + k ] *= alpha; + } + } + } + return B; +} + + +// EXPORTS // + +module.exports = dtrsm; diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js new file mode 100644 index 000000000000..c53599d96d8c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js @@ -0,0 +1,88 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var isOperationSide = require( '@stdlib/blas/base/assert/is-operation-side' ); +var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); +var isDiagonalType = require( '@stdlib/blas/base/assert/is-diagonal-type' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or +* non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +* +* @private +* @param {string} orderA - specifies the memory layout of `A`. +* @param {string} orderB - specifies the memory layout of `B`. +* @param {string} side - specifies whether `op( A )` appears on the left or right of `X`. +* @param {string} uplo - specifies whether the matrix `A` is an upper or lower triangular matrix. +* @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication. +* @param {string} diag - specifies whether or not `A` is unit triangular. +* @param {NonNegativeInteger} m - number of rows in `B`. +* @param {NonNegativeInteger} n - number of columns in `B`. +* @param {number} alpha - scalar alpha. +* @param {Float64Array} A - input matrix `A`. +* @param {NonNegativeInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Float64Array} B - input matrix `B`. +* @param {NonNegativeInteger} LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) +* @throws {TypeError} first argument must be a valid order. +* @throws {TypeError} second argument must be a valid order. +* @throws {TypeError} third argument must be a valid side. +* @throws {TypeError} fourth argument must specify whether the lower or upper triangular matrix is supplied. +* @throws {TypeError} fifth argument must specify correct transpose operation. +* @throws {TypeError} sixth argument must specify whether the matrix is unit triangular or not. +* @returns {Float64Array} matrix `B`. +* +* @example +* TODO: +*/ +function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) { + if ( !isLayout( orderA ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', orderA ) ); + } + if ( !isLayout( orderB ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be a valid order. Value: `%s`.', orderB ) ); + } + if ( !isOperationSide( side ) ) { + throw new TypeError( format( 'invalid argument. Third argument must be a valid side. Value: `%s`.', side ) ); + } + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( format( 'invalid argument. Fourth argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); + } + if ( !isTransposeOperation( transa ) ) { + throw new TypeError( format( 'invalid argument. Fifth argument must specify correct transpose operation. Value: `%s`.', transa ) ); + } + if ( !isDiagonalType( diag ) ) { + throw new TypeError( format( 'invalid argument. Sixth argument must specify whether the matrix is unit triangular or not. Value: `%s`.', diag ) ); + } + return base( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, 0, B, LDB, 0 ); +} + + +// EXPORTS // + +module.exports = dtrsm; diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js new file mode 100644 index 000000000000..eb6a89bf30c3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js @@ -0,0 +1,53 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +* +* @module @stdlib/blas/base/dtrsm +* +* @example +* TODO +*/ + +// 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 dtrsm; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dtrsm = main; +} else { + dtrsm = tmp; +} + + +// EXPORTS // + +module.exports = dtrsm; + +// exports: { "ndarray": "dtrsm.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/main.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/main.js new file mode 100644 index 000000000000..8a497b58f053 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dtrsm = require( './dtrsm.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dtrsm, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dtrsm; diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js new file mode 100644 index 000000000000..22502a9df368 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js @@ -0,0 +1,89 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var isOperationSide = require( '@stdlib/blas/base/assert/is-operation-side' ); +var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); +var isDiagonalType = require( '@stdlib/blas/base/assert/is-diagonal-type' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +* +* @private +* @param {string} orderA - specifies the memory layout of `A`. +* @param {string} orderB - specifies the memory layout of `B`. +* @param {string} side - specifies whether `op( A )` appears on the left or right of `X`. +* @param {string} uplo - specifies whether the matrix `A` is an upper or lower triangular matrix. +* @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication. +* @param {string} diag - specifies whether or not `A` is unit triangular. +* @param {NonNegativeInteger} m - number of rows in `B`. +* @param {NonNegativeInteger} n - number of columns in `B`. +* @param {number} alpha - scalar alpha. +* @param {Float64Array} A - input matrix `A`. +* @param {NonNegativeInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {NonNegativeInteger} offsetA - index offset for matrix `A`. +* @param {Float64Array} B - input matrix `B`. +* @param {NonNegativeInteger} LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) +* @param {NonNegativeInteger} offsetB - index offset for matrix `B`. +* @throws {TypeError} first argument must be a valid order. +* @throws {TypeError} second argument must be a valid order. +* @throws {TypeError} third argument must be a valid side. +* @throws {TypeError} fourth argument must specify whether the lower or upper triangular matrix is supplied. +* @throws {TypeError} fifth argument must specify correct transpose operation. +* @throws {TypeError} sixth argument must specify whether the matrix is unit triangular or not. +* @returns {Float64Array} matrix `B`. +* +* @example +* TODO: +*/ +function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ) { // eslint-disable-line max-len + if ( !isLayout( orderA ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', orderA ) ); + } + if ( !isLayout( orderB ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be a valid order. Value: `%s`.', orderB ) ); + } + if ( !isOperationSide( side ) ) { + throw new TypeError( format( 'invalid argument. Third argument must be a valid side. Value: `%s`.', side ) ); + } + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( format( 'invalid argument. Fourth argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); + } + if ( !isTransposeOperation( transa ) ) { + throw new TypeError( format( 'invalid argument. Fifth argument must specify correct transpose operation. Value: `%s`.', transa ) ); + } + if ( !isDiagonalType( diag ) ) { + throw new TypeError( format( 'invalid argument. Sixth argument must specify whether the matrix is unit triangular or not. Value: `%s`.', diag ) ); + } + return base( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = dtrsm; From 12708a57fbcd1c0183326110ce5db2b141ce8318 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Sat, 6 Jul 2024 13:14:33 +0530 Subject: [PATCH 02/33] chore: apply suggestions from code review --- .../@stdlib/blas/base/dtrsm/lib/base.js | 447 ++++-------------- .../@stdlib/blas/base/dtrsm/lib/dtrsm.js | 48 +- .../@stdlib/blas/base/dtrsm/lib/ndarray.js | 56 +-- 3 files changed, 134 insertions(+), 417 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js index 3724043a1be9..31169e6ad77f 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js @@ -24,30 +24,28 @@ * Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. * * @private -* @param {string} orderA - specifies the memory layout of `A`. -* @param {string} orderB - specifies the memory layout of `B`. -* @param {string} side - specifies whether `op( A )` appears on the left or right of `X`. -* @param {string} uplo - specifies whether the matrix `A` is an upper or lower triangular matrix. -* @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication. -* @param {string} diag - specifies whether or not `A` is unit triangular. -* @param {NonNegativeInteger} m - number of rows in `B`. -* @param {NonNegativeInteger} n - number of columns in `B`. -* @param {number} alpha - scalar alpha. -* @param {Float64Array} A - input matrix `A`. +* @param {string} order - specifies the memory layout of `A` and `B` +* @param {string} side - specifies whether `op( A )` appears on the left or right of `X` +* @param {string} uplo - specifies whether the matrix `A` is an upper or lower triangular matrix +* @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication +* @param {string} diag - specifies whether or not `A` is unit triangular +* @param {NonNegativeInteger} m - number of rows in `B` +* @param {NonNegativeInteger} n - number of columns in `B` +* @param {number} alpha - scalar alpha +* @param {Float64Array} A - input matrix `A` * @param {NonNegativeInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) -* @param {NonNegativeInteger} offsetA - index offset for matrix `A`. -* @param {Float64Array} B - input matrix `B`. +* @param {NonNegativeInteger} offsetA - index offset for matrix `A` +* @param {Float64Array} B - input matrix `B` * @param {NonNegativeInteger} LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) -* @param {NonNegativeInteger} offsetB - index offset for matrix `B`. -* @returns {Float64Array} matrix `B`. +* @param {NonNegativeInteger} offsetB - index offset for matrix `B` +* @returns {Float64Array} matrix `B` * * @example * TODO: */ -function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ) { // eslint-disable-line max-len +function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ) { // eslint-disable-line max-len var nounit; var lside; - var lower; var upper; var tmp; var i; @@ -66,7 +64,7 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, o return B; } if ( alpha === 0.0 ) { - if ( orderB === 'row-major' ) { + if ( order === 'row-major' ) { for ( j = 0; j < n; j++ ) { for ( i = 0; i < m; i++ ) { B[ ( i * LDB ) + j ] = 0.0; @@ -84,8 +82,8 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, o if ( lside ) { if ( transa === 'N' ) { // B := alpha * inv( A ) * B - if ( orderB === 'column-major' ) { - if ( orderA === 'column-major' && upper ) { + if ( upper ) { + if ( order === 'column-major' ) { for ( j = 0; j < n; j++ ) { if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { @@ -105,100 +103,19 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, o } return B; } - if ( orderA === 'row-major' && lower ) { - for ( j = 0; j < n; j++ ) { - if ( alpha !== 1 ) { - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= alpha; - } - } - for ( k = m - 1; k >= 0; k-- ) { - if ( B[ ( j * LDB ) + k ] !== 0 ) { - if ( nounit ) { - B[ ( j * LDB ) + k ] /= A[ ( k * LDA ) + k ]; - } - for ( i = 0; i < k; i++ ) { - B[ ( j * LDB ) + i ] -= B[ ( j * LDB ) + k ] * A[ ( i * LDA ) + k ]; - } - } - } - } - return B; - } - if ( orderA === 'column-major' && lower ) { - for ( j = 0; j < n; j++ ) { - if ( alpha !== 1 ) { - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= alpha; - } - } - for ( k = 0; k < m; k++ ) { - if ( B[ ( j * LDB ) + k ] !== 0 ) { - if ( nounit ) { - B[ ( j * LDB ) + k ] /= A[ ( k * LDA ) + k ]; - } - for ( i = k; i < m; i++ ) { - B[ ( j * LDB ) + i ] -= B[ ( j * LDB ) + k ] * A[ ( k * LDA ) + i ]; - } - } - } - } - return B; - } - // ( orderA === "row-major" && upper ) - for ( j = 0; j < n; j++ ) { - if ( alpha !== 1 ) { - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= alpha; - } - } - for ( k = 0; k < m; k++ ) { - if ( B[ ( j * LDB ) + k ] !== 0 ) { - if ( nounit ) { - B[ ( j * LDB ) + k ] /= A[ ( k * LDA ) + k ]; - } - for ( i = k + 1; i < m; i++ ) { - B[ ( j * LDB ) + i ] -= B[ ( j * LDB ) + k ] * A[ ( i * LDA ) + k ]; - } - } - } - } - return B; - } - // orderB === "row-major" - if ( orderA === 'column-major' && upper ) { + // order === "row-major" for ( j = 0; j < n; j++ ) { if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { B[ ( i * LDB ) + j ] *= alpha; } } - for ( k = m - 1; k >= 0; k-- ) { - if ( B[ ( k * LDB ) + j ] !== 0 ) { - if ( nounit ) { - B[ ( k * LDB ) + j ] /= A[ ( k * LDA ) + k ]; - } - for ( i = 0; i < k; i++ ) { - B[ ( i * LDB ) + j ] -= B[ ( k * LDB ) + j ] * A[ ( k * LDA ) + i ]; - } - } - } - } - return B; - } - if ( orderA === 'row-major' && lower ) { - for ( j = 0; j < n; j++ ) { - if ( alpha !== 1 ) { - for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] *= alpha; - } - } - for ( k = m - 1; k >= 0; k-- ) { + for ( k = 0; k < m; k++ ) { if ( B[ ( k * LDB ) + j ] !== 0 ) { if ( nounit ) { B[ ( k * LDB ) + j ] /= A[ ( k * LDA ) + k ]; } - for ( i = 0; i < k; i++ ) { + for ( i = k + 1; i < m; i++ ) { B[ ( i * LDB ) + j ] -= B[ ( k * LDB ) + j ] * A[ ( i * LDA ) + k ]; } } @@ -206,39 +123,40 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, o } return B; } - if ( orderA === 'column-major' && lower ) { + // lower + if ( order === 'column-major' ) { for ( j = 0; j < n; j++ ) { if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] *= alpha; + B[ ( j * LDB ) + i ] *= alpha; } } for ( k = 0; k < m; k++ ) { - if ( B[ ( k * LDB ) + j ] !== 0 ) { + if ( B[ ( j * LDB ) + k ] !== 0 ) { if ( nounit ) { - B[ ( k * LDB ) + j ] /= A[ ( k * LDA ) + k ]; + B[ ( j * LDB ) + k ] /= A[ ( k * LDA ) + k ]; } for ( i = k; i < m; i++ ) { - B[ ( i * LDB ) + j ] -= B[ ( k * LDB ) + j ] * A[ ( k * LDA ) + i ]; + B[ ( j * LDB ) + i ] -= B[ ( j * LDB ) + k ] * A[ ( k * LDA ) + i ]; } } } } return B; } - // ( orderA === "row-major" && upper ) + // order === "row-major" for ( j = 0; j < n; j++ ) { if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { B[ ( i * LDB ) + j ] *= alpha; } } - for ( k = 0; k < m; k++ ) { + for ( k = m - 1; k >= 0; k-- ) { if ( B[ ( k * LDB ) + j ] !== 0 ) { if ( nounit ) { B[ ( k * LDB ) + j ] /= A[ ( k * LDA ) + k ]; } - for ( i = k + 1; i < m; i++ ) { + for ( i = 0; i < k - 1; i++ ) { B[ ( i * LDB ) + j ] -= B[ ( k * LDB ) + j ] * A[ ( i * LDA ) + k ]; } } @@ -247,8 +165,8 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, o return B; } // B := alpha * inv( A**T ) * B - if ( orderB === 'column-major' ) { - if ( orderA === 'column-major' && upper ) { + if ( upper ) { + if ( order === 'column-major' ) { for ( j = 0; j < n; j++ ) { for ( i = 0; i < m; i++ ) { tmp = alpha * B[ ( j * LDB ) + i ]; @@ -263,42 +181,28 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, o } return B; } - if ( orderA === 'row-major' && lower ) { - for ( j = 0; j < n; j++ ) { - for ( i = 0; i < m; i++ ) { - tmp = alpha * B[ ( j * LDB ) + i ]; - for ( k = 0; k < i - 1; k++ ) { - tmp -= A[ ( k * LDA ) + i ] * B[ ( j * LDB ) + k ]; - } - if ( nounit ) { - tmp /= A[ ( i * LDA ) + i ]; - } - B[ ( j * LDB ) + i ] = tmp; + // order === "row-major" + for ( j = 0; j < n; j++ ) { + for ( i = m - 1; i >= 0; i-- ) { + tmp = alpha * B[ ( i * LDB ) + j ]; + for ( k = i; k < m; k++ ) { + tmp -= A[ ( k * LDA ) + i ] * B[ ( k * LDB ) + j ]; } - } - return B; - } - if ( orderA === 'column-major' && lower ) { - for ( j = 0; j < n; j++ ) { - for ( i = m - 1; i >= 0; i-- ) { - tmp = alpha * B[ ( j * LDB ) + i ]; - for ( k = i; k < m; k++ ) { - tmp -= A[ ( i * LDA ) + k ] * B[ ( j * LDB ) + k ]; - } - if ( nounit ) { - tmp /= A[ ( i * LDA ) + i ]; - } - B[ ( j * LDB ) + i ] = tmp; + if ( nounit ) { + tmp /= A[ ( i * LDA ) + i ]; } + B[ ( i * LDB ) + j ] = tmp; } - return B; } - // ( orderA === "row-major" && upper ) + return B; + } + // lower + if ( order === 'column-major' ) { for ( j = 0; j < n; j++ ) { - for ( i = 0; i < m; i++ ) { + for ( i = m - 1; i >= 0; i-- ) { tmp = alpha * B[ ( j * LDB ) + i ]; for ( k = i; k < m; k++ ) { - tmp -= A[ ( k * LDA ) + i ] * B[ ( j * LDB ) + k ]; + tmp -= A[ ( i * LDA ) + k ] * B[ ( j * LDB ) + k ]; } if ( nounit ) { tmp /= A[ ( i * LDA ) + i ]; @@ -308,12 +212,26 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, o } return B; } + // order === "row-major" + for ( j = 0; j < n; j++ ) { + for ( i = 0; i < m; i++ ) { + tmp = alpha * B[ ( i * LDB ) + j ]; + for ( k = 1; k < i - 1; k++ ) { + tmp -= A[ ( k * LDA ) + i ] * B[ ( k * LDB ) + j ]; + } + if ( nounit ) { + tmp /= A[ ( i * LDA ) + i ]; + } + B[ ( i * LDB ) + j ] = tmp; + } + } + return B; } // !lside if ( transa === 'N' ) { // B := alpha * B * inv( A ) - if ( orderB === 'column-major' ) { - if ( orderA === 'column-major' && upper ) { + if ( upper ) { + if ( order === 'column-major' ) { for ( j = 0; j < n; j++ ) { if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { @@ -321,53 +239,7 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, o } } for ( k = 0; k < j - 1; k++ ) { - if ( A[ ( j * LDA ) + k ] !== 0 ) { - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] -= A[ ( j * LDA ) + k ] * B[ ( k * LDB ) + i ]; - } - } - } - if ( nounit ) { - tmp = 1.0 / A[ ( j * LDA ) + j ]; - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= tmp; - } - } - } - return B; - } - if ( orderA === 'row-major' && lower ) { - for ( j = 0; j < n; j++ ) { - if ( alpha !== 1 ) { - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= alpha; - } - } - for ( k = 0; k < j - 1; k++ ) { - if ( A[ ( k * LDA ) + j ] !== 0 ) { - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] -= A[ ( k * LDA ) + j ] * B[ ( k * LDB ) + i ]; - } - } - } - if ( nounit ) { - tmp = 1.0 / A[ ( j * LDA ) + j ]; - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= tmp; - } - } - } - return B; - } - if ( orderA === 'column-major' && lower ) { - for ( j = n - 1; j >= 0; j-- ) { - if ( alpha !== 1 ) { - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= alpha; - } - } - for ( k = j; k < n; k++ ) { - if ( A[ ( j * LDA ) + k ] !== 0 ) { + if ( A[ ( j * LDA ) + k ] !== 0.0 ) { for ( i = 0; i < m; i++ ) { B[ ( j * LDB ) + i ] -= A[ ( j * LDA ) + k ] * B[ ( k * LDB ) + i ]; } @@ -382,62 +254,15 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, o } return B; } - // ( orderA === "row-major" && upper ) + // order === "row-major" for ( j = n - 1; j >= 0; j-- ) { - if ( alpha !== 1 ) { - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= alpha; - } - } - for ( k = j; k < n; k++ ) { - if ( A[ ( k * LDA ) + j ] !== 0 ) { - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] -= A[ ( k * LDA ) + j ] * B[ ( k * LDB ) + i ]; - } - } - } - if ( nounit ) { - tmp = 1.0 / A[ ( j * LDA ) + j ]; - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= tmp; - } - } - } - return B; - } - // orderB === "row-major" - if ( orderA === 'column-major' && upper ) { - for ( j = 0; j < n; j++ ) { - if ( alpha !== 1 ) { - for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] *= alpha; - } - } - for ( k = 0; k < j - 1; k++ ) { - if ( A[ ( j * LDA ) + k ] !== 0 ) { - for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] -= A[ ( j * LDA ) + k ] * B[ ( i * LDB ) + k ]; - } - } - } - if ( nounit ) { - tmp = 1.0 / A[ ( j * LDA ) + j ]; - for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] *= tmp; - } - } - } - return B; - } - if ( orderA === 'row-major' && lower ) { - for ( j = 0; j < n; j++ ) { if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { B[ ( i * LDB ) + j ] *= alpha; } } - for ( k = 0; k < j - 1; k++ ) { - if ( A[ ( k * LDA ) + j ] !== 0 ) { + for ( k = j; k < n; k++ ) { + if ( A[ ( k * LDA) + j ] !== 0.0 ) { for ( i = 0; i < m; i++ ) { B[ ( i * LDB ) + j ] -= A[ ( k * LDA ) + j ] * B[ ( i * LDB ) + k ]; } @@ -450,40 +275,40 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, o } } } - return B; } - if ( orderA === 'column-major' && lower ) { + // lower + if ( order === 'column-major' ) { for ( j = n - 1; j >= 0; j-- ) { if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] *= alpha; + B[ ( j * LDB ) + i ] *= alpha; } } for ( k = j; k < n; k++ ) { if ( A[ ( j * LDA ) + k ] !== 0 ) { for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] -= A[ ( j * LDA ) + k ] * B[ ( i * LDB ) + k ]; + B[ ( j * LDB ) + i ] -= A[ ( j * LDA ) + k ] * B[ ( k * LDB ) + i ]; } } } if ( nounit ) { tmp = 1.0 / A[ ( j * LDA ) + j ]; for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] *= tmp; + B[ ( j * LDB ) + i ] *= tmp; } } } return B; } - // ( orderA === "row-major" && upper ) - for ( j = n - 1; j >= 0; j-- ) { - if ( alpha !== 1 ) { + // order === "row-major" + for ( j = 0; j < n; j++ ) { + if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { B[ ( i * LDB ) + j ] *= alpha; } } - for ( k = j; k < n; k++ ) { - if ( A[ ( k * LDA ) + j ] !== 0 ) { + for ( k = 0; k < j - 1; k++ ) { + if ( A[ ( k * LDA ) + j ] !== 0.0 ) { for ( i = 0; i < m; i++ ) { B[ ( i * LDB ) + j ] -= A[ ( k * LDA ) + j ] * B[ ( i * LDB ) + k ]; } @@ -499,32 +324,8 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, o return B; } // B := alpha * B * inv( A**T ) - if ( orderB === 'column-major' ) { - if ( orderA === 'column-major' && upper ) { - for ( k = n - 1; k >= 0; k-- ) { - if ( nounit ) { - tmp = 1.0 / A[ ( k * LDA ) + k ]; - for ( i = 0; i < m; i++ ) { - B[ ( k * LDB ) + i ] *= tmp; - } - } - for ( j = 0; j < k - 1; j++ ) { - if ( A[ ( k * LDA ) + j ] !== 0 ) { - tmp = A[ ( k * LDA ) + j ]; - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] -= tmp * B[ ( k * LDB ) + i ]; - } - } - } - if ( alpha !== 1 ) { - for ( i = 0; i < m; i++ ) { - B[ ( k * LDB ) + i ] *= alpha; - } - } - } - return B; - } - if ( orderA === 'row-major' && lower ) { + if ( upper ) { + if ( order === 'column-major' ) { for ( k = n - 1; k >= 0; k-- ) { if ( nounit ) { tmp = 1.0 / A[ ( k * LDA ) + k ]; @@ -533,30 +334,6 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, o } } for ( j = 0; j < k - 1; j++ ) { - if ( A[ ( j * LDA ) + k ] !== 0 ) { - tmp = A[ ( j * LDA ) + k ]; - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] -= tmp * B[ ( k * LDB ) + i ]; - } - } - } - if ( alpha !== 1 ) { - for ( i = 0; i < m; i++ ) { - B[ ( k * LDB ) + i ] *= alpha; - } - } - } - return B; - } - if ( orderA === 'column-major' && lower ) { - for ( k = 0; k < n; k++ ) { - if ( nounit ) { - tmp = 1.0 / A[ ( k * LDA ) + k ]; - for ( i = 0; i < m; i++ ) { - B[ ( k * LDB ) + i ] *= tmp; - } - } - for ( j = k; j < n; j++ ) { if ( A[ ( k * LDA ) + j ] !== 0 ) { tmp = A[ ( k * LDA ) + j ]; for ( i = 0; i < m; i++ ) { @@ -572,64 +349,15 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, o } return B; } - // ( orderA === "row-major" && upper ) + // order === "row-major" for ( k = 0; k < n; k++ ) { - if ( nounit ) { - tmp = 1.0 / A[ ( k * LDA ) + k ]; - for ( i = 0; i < m; i++ ) { - B[ ( k * LDB ) + i ] *= tmp; - } - } - for ( j = k; j < n; j++ ) { - if ( A[ ( j * LDA ) + k ] !== 0 ) { - tmp = A[ ( j * LDA ) + k ]; - for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] -= tmp * B[ ( k * LDB ) + i ]; - } - } - } - if ( alpha !== 1 ) { - for ( i = 0; i < m; i++ ) { - B[ ( k * LDB ) + i ] *= alpha; - } - } - } - return B; - } - // orderB === "row-major" - if ( orderA === 'column-major' && upper ) { - for ( k = n - 1; k >= 0; k-- ) { if ( nounit ) { tmp = 1.0 / A[ ( k * LDA ) + k ]; for ( i = 0; i < m; i++ ) { B[ ( i * LDB ) + k ] *= tmp; } } - for ( j = 0; j < k - 1; j++ ) { - if ( A[ ( k * LDA ) + j ] !== 0 ) { - tmp = A[ ( k * LDA ) + j ]; - for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] -= tmp * B[ ( i * LDB ) + k ]; - } - } - } - if ( alpha !== 1 ) { - for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + k ] *= alpha; - } - } - } - return B; - } - if ( orderA === 'row-major' && lower ) { - for ( k = n - 1; k >= 0; k-- ) { - if ( nounit ) { - tmp = 1.0 / A[ ( k * LDA ) + k ]; - for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + k ] *= tmp; - } - } - for ( j = 0; j < k - 1; j++ ) { + for ( j = k; j < n; j++ ) { if ( A[ ( j * LDA ) + k ] !== 0 ) { tmp = A[ ( j * LDA ) + k ]; for ( i = 0; i < m; i++ ) { @@ -645,39 +373,40 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, o } return B; } - if ( orderA === 'column-major' && lower ) { + // lower + if ( order === 'column-major' ) { for ( k = 0; k < n; k++ ) { if ( nounit ) { tmp = 1.0 / A[ ( k * LDA ) + k ]; for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + k ] *= tmp; + B[ ( k * LDB ) + i ] *= tmp; } } for ( j = k; j < n; j++ ) { if ( A[ ( k * LDA ) + j ] !== 0 ) { tmp = A[ ( k * LDA ) + j ]; for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] -= tmp * B[ ( i * LDB ) + k ]; + B[ ( j * LDB ) + i ] -= tmp * B[ ( k * LDB ) + i ]; } } } if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + k ] *= alpha; + B[ ( k * LDB ) + i ] *= alpha; } } } return B; } - // ( orderA === "row-major" && upper ) - for ( k = 0; k < n; k++ ) { + // order === "row-major" + for ( k = n - 1; k >= 0; k-- ) { if ( nounit ) { tmp = 1.0 / A[ ( k * LDA ) + k ]; for ( i = 0; i < m; i++ ) { B[ ( i * LDB ) + k ] *= tmp; } } - for ( j = k; j < n; j++ ) { + for ( j = 0; j < k - 1; j++ ) { if ( A[ ( j * LDA ) + k ] !== 0 ) { tmp = A[ ( j * LDA ) + k ]; for ( i = 0; i < m; i++ ) { diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js index c53599d96d8c..06b4f87da660 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js @@ -35,49 +35,43 @@ var base = require( './base.js' ); * Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or * non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. * -* @private -* @param {string} orderA - specifies the memory layout of `A`. -* @param {string} orderB - specifies the memory layout of `B`. -* @param {string} side - specifies whether `op( A )` appears on the left or right of `X`. -* @param {string} uplo - specifies whether the matrix `A` is an upper or lower triangular matrix. -* @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication. -* @param {string} diag - specifies whether or not `A` is unit triangular. -* @param {NonNegativeInteger} m - number of rows in `B`. -* @param {NonNegativeInteger} n - number of columns in `B`. -* @param {number} alpha - scalar alpha. -* @param {Float64Array} A - input matrix `A`. +* @param {string} order - specifies the memory layout of `A` and `B` +* @param {string} side - specifies whether `op( A )` appears on the left or right of `X` +* @param {string} uplo - specifies whether the matrix `A` is an upper or lower triangular matrix +* @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication +* @param {string} diag - specifies whether or not `A` is unit triangular +* @param {NonNegativeInteger} m - number of rows in `B` +* @param {NonNegativeInteger} n - number of columns in `B` +* @param {number} alpha - scalar alpha +* @param {Float64Array} A - input matrix `A` * @param {NonNegativeInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) -* @param {Float64Array} B - input matrix `B`. +* @param {Float64Array} B - input matrix `B` * @param {NonNegativeInteger} LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) -* @throws {TypeError} first argument must be a valid order. -* @throws {TypeError} second argument must be a valid order. -* @throws {TypeError} third argument must be a valid side. -* @throws {TypeError} fourth argument must specify whether the lower or upper triangular matrix is supplied. -* @throws {TypeError} fifth argument must specify correct transpose operation. -* @throws {TypeError} sixth argument must specify whether the matrix is unit triangular or not. -* @returns {Float64Array} matrix `B`. +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must be a valid side +* @throws {TypeError} third argument must specify whether the lower or upper triangular matrix is supplied +* @throws {TypeError} fourth argument must specify correct transpose operation +* @throws {TypeError} fifth argument must specify whether the matrix is unit triangular or not +* @returns {Float64Array} matrix `B` * * @example * TODO: */ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) { - if ( !isLayout( orderA ) ) { + if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', orderA ) ); } - if ( !isLayout( orderB ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be a valid order. Value: `%s`.', orderB ) ); - } if ( !isOperationSide( side ) ) { - throw new TypeError( format( 'invalid argument. Third argument must be a valid side. Value: `%s`.', side ) ); + throw new TypeError( format( 'invalid argument. Second argument must be a valid side. Value: `%s`.', side ) ); } if ( !isMatrixTriangle( uplo ) ) { - throw new TypeError( format( 'invalid argument. Fourth argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); + throw new TypeError( format( 'invalid argument. Thirds argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); } if ( !isTransposeOperation( transa ) ) { - throw new TypeError( format( 'invalid argument. Fifth argument must specify correct transpose operation. Value: `%s`.', transa ) ); + throw new TypeError( format( 'invalid argument. Fourth argument must specify correct transpose operation. Value: `%s`.', transa ) ); } if ( !isDiagonalType( diag ) ) { - throw new TypeError( format( 'invalid argument. Sixth argument must specify whether the matrix is unit triangular or not. Value: `%s`.', diag ) ); + throw new TypeError( format( 'invalid argument. Fifth argument must specify whether the matrix is unit triangular or not. Value: `%s`.', diag ) ); } return base( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, 0, B, LDB, 0 ); } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js index 22502a9df368..c60a14e022f8 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js @@ -34,53 +34,47 @@ var base = require( './base.js' ); /** * Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. * -* @private -* @param {string} orderA - specifies the memory layout of `A`. -* @param {string} orderB - specifies the memory layout of `B`. -* @param {string} side - specifies whether `op( A )` appears on the left or right of `X`. -* @param {string} uplo - specifies whether the matrix `A` is an upper or lower triangular matrix. -* @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication. -* @param {string} diag - specifies whether or not `A` is unit triangular. -* @param {NonNegativeInteger} m - number of rows in `B`. -* @param {NonNegativeInteger} n - number of columns in `B`. -* @param {number} alpha - scalar alpha. -* @param {Float64Array} A - input matrix `A`. +* @param {string} order - specifies the memory layout of `A` and `B` +* @param {string} side - specifies whether `op( A )` appears on the left or right of `X` +* @param {string} uplo - specifies whether the matrix `A` is an upper or lower triangular matrix +* @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication +* @param {string} diag - specifies whether or not `A` is unit triangular +* @param {NonNegativeInteger} m - number of rows in `B` +* @param {NonNegativeInteger} n - number of columns in `B` +* @param {number} alpha - scalar alpha +* @param {Float64Array} A - input matrix `A` * @param {NonNegativeInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) -* @param {NonNegativeInteger} offsetA - index offset for matrix `A`. -* @param {Float64Array} B - input matrix `B`. +* @param {NonNegativeInteger} offsetA - index offset for matrix `A` +* @param {Float64Array} B - input matrix `B` * @param {NonNegativeInteger} LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) -* @param {NonNegativeInteger} offsetB - index offset for matrix `B`. -* @throws {TypeError} first argument must be a valid order. -* @throws {TypeError} second argument must be a valid order. -* @throws {TypeError} third argument must be a valid side. -* @throws {TypeError} fourth argument must specify whether the lower or upper triangular matrix is supplied. -* @throws {TypeError} fifth argument must specify correct transpose operation. -* @throws {TypeError} sixth argument must specify whether the matrix is unit triangular or not. -* @returns {Float64Array} matrix `B`. +* @param {NonNegativeInteger} offsetB - index offset for matrix `B` +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must be a valid side +* @throws {TypeError} third argument must specify whether the lower or upper triangular matrix is supplied. +* @throws {TypeError} fourth argument must specify correct transpose operation +* @throws {TypeError} fifth argument must specify whether the matrix is unit triangular or not +* @returns {Float64Array} matrix `B` * * @example * TODO: */ -function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ) { // eslint-disable-line max-len - if ( !isLayout( orderA ) ) { +function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ) { // eslint-disable-line max-len + if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', orderA ) ); } - if ( !isLayout( orderB ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be a valid order. Value: `%s`.', orderB ) ); - } if ( !isOperationSide( side ) ) { - throw new TypeError( format( 'invalid argument. Third argument must be a valid side. Value: `%s`.', side ) ); + throw new TypeError( format( 'invalid argument. Second argument must be a valid side. Value: `%s`.', side ) ); } if ( !isMatrixTriangle( uplo ) ) { - throw new TypeError( format( 'invalid argument. Fourth argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); + throw new TypeError( format( 'invalid argument. Thirds argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); } if ( !isTransposeOperation( transa ) ) { - throw new TypeError( format( 'invalid argument. Fifth argument must specify correct transpose operation. Value: `%s`.', transa ) ); + throw new TypeError( format( 'invalid argument. Fourth argument must specify correct transpose operation. Value: `%s`.', transa ) ); } if ( !isDiagonalType( diag ) ) { - throw new TypeError( format( 'invalid argument. Sixth argument must specify whether the matrix is unit triangular or not. Value: `%s`.', diag ) ); + throw new TypeError( format( 'invalid argument. Fifth argument must specify whether the matrix is unit triangular or not. Value: `%s`.', diag ) ); } - return base( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ); // eslint-disable-line max-len + return base( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ); // eslint-disable-line max-len } From 4b951ba295c5893124a352cf7c2d4d4230ee11b5 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Sat, 6 Jul 2024 13:23:51 +0530 Subject: [PATCH 03/33] enh: support offsetA and offsetB --- .../@stdlib/blas/base/dtrsm/lib/base.js | 160 +++++++++--------- 1 file changed, 78 insertions(+), 82 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js index 31169e6ad77f..41c6c96f9153 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js @@ -56,10 +56,6 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B nounit = diag === 'N'; upper = uplo === 'U'; - // TODO: remove it - offsetB = offsetA; - offsetA = offsetB; - if ( m === 0 || n === 0 ) { return B; } @@ -67,14 +63,14 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( order === 'row-major' ) { for ( j = 0; j < n; j++ ) { for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] = 0.0; + B[ offsetB + ( i * LDB ) + j ] = 0.0; } } return B; } for ( j = 0; j < n; j++ ) { for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] = 0.0; + B[ offsetB + ( j * LDB ) + i ] = 0.0; } } return B; @@ -87,16 +83,16 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( j = 0; j < n; j++ ) { if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= alpha; + B[ offsetB + ( j * LDB ) + i ] *= alpha; } } for ( k = m - 1; k >= 0; k-- ) { - if ( B[ ( j * LDB ) + k ] !== 0 ) { + if ( B[ offsetB + ( j * LDB ) + k ] !== 0 ) { if ( nounit ) { - B[ ( j * LDB ) + k ] /= A[ ( k * LDA ) + k ]; + B[ offsetB + ( j * LDB ) + k ] /= A[ offsetA + ( k * LDA ) + k ]; } for ( i = 0; i < k; i++ ) { - B[ ( j * LDB ) + i ] -= B[ ( j * LDB ) + k ] * A[ ( k * LDA ) + i ]; + B[ offsetB + ( j * LDB ) + i ] -= B[ offsetB + ( j * LDB ) + k ] * A[ offsetA + ( k * LDA ) + i ]; } } } @@ -107,16 +103,16 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( j = 0; j < n; j++ ) { if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] *= alpha; + B[ offsetB + ( i * LDB ) + j ] *= alpha; } } for ( k = 0; k < m; k++ ) { - if ( B[ ( k * LDB ) + j ] !== 0 ) { + if ( B[ offsetB + ( k * LDB ) + j ] !== 0 ) { if ( nounit ) { - B[ ( k * LDB ) + j ] /= A[ ( k * LDA ) + k ]; + B[ offsetB + ( k * LDB ) + j ] /= A[ offsetA + ( k * LDA ) + k ]; } for ( i = k + 1; i < m; i++ ) { - B[ ( i * LDB ) + j ] -= B[ ( k * LDB ) + j ] * A[ ( i * LDA ) + k ]; + B[ offsetB + ( i * LDB ) + j ] -= B[ offsetB + ( k * LDB ) + j ] * A[ offsetA + ( i * LDA ) + k ]; } } } @@ -128,16 +124,16 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( j = 0; j < n; j++ ) { if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= alpha; + B[ offsetB + ( j * LDB ) + i ] *= alpha; } } for ( k = 0; k < m; k++ ) { - if ( B[ ( j * LDB ) + k ] !== 0 ) { + if ( B[ offsetB + ( j * LDB ) + k ] !== 0 ) { if ( nounit ) { - B[ ( j * LDB ) + k ] /= A[ ( k * LDA ) + k ]; + B[ offsetB + ( j * LDB ) + k ] /= A[ offsetA + ( k * LDA ) + k ]; } for ( i = k; i < m; i++ ) { - B[ ( j * LDB ) + i ] -= B[ ( j * LDB ) + k ] * A[ ( k * LDA ) + i ]; + B[ offsetB + ( j * LDB ) + i ] -= B[ offsetB + ( j * LDB ) + k ] * A[ offsetA + ( k * LDA ) + i ]; } } } @@ -148,16 +144,16 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( j = 0; j < n; j++ ) { if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] *= alpha; + B[ offsetB + ( i * LDB ) + j ] *= alpha; } } for ( k = m - 1; k >= 0; k-- ) { - if ( B[ ( k * LDB ) + j ] !== 0 ) { + if ( B[ offsetB + ( k * LDB ) + j ] !== 0 ) { if ( nounit ) { - B[ ( k * LDB ) + j ] /= A[ ( k * LDA ) + k ]; + B[ offsetB + ( k * LDB ) + j ] /= A[ offsetA + ( k * LDA ) + k ]; } for ( i = 0; i < k - 1; i++ ) { - B[ ( i * LDB ) + j ] -= B[ ( k * LDB ) + j ] * A[ ( i * LDA ) + k ]; + B[ offsetB + ( i * LDB ) + j ] -= B[ offsetB + ( k * LDB ) + j ] * A[ offsetA + ( i * LDA ) + k ]; } } } @@ -169,14 +165,14 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( order === 'column-major' ) { for ( j = 0; j < n; j++ ) { for ( i = 0; i < m; i++ ) { - tmp = alpha * B[ ( j * LDB ) + i ]; + tmp = alpha * B[ offsetB + ( j * LDB ) + i ]; for ( k = 0; k < i - 1; k++ ) { - tmp -= A[ ( i * LDA ) + k ] * B[ ( j * LDB ) + k ]; + tmp -= A[ offsetA + ( i * LDA ) + k ] * B[ offsetB + ( j * LDB ) + k ]; } if ( nounit ) { - tmp /= A[ ( i * LDA ) + i ]; + tmp /= A[ offsetA + ( i * LDA ) + i ]; } - B[ ( j * LDB ) + i ] = tmp; + B[ offsetB + ( j * LDB ) + i ] = tmp; } } return B; @@ -184,14 +180,14 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B // order === "row-major" for ( j = 0; j < n; j++ ) { for ( i = m - 1; i >= 0; i-- ) { - tmp = alpha * B[ ( i * LDB ) + j ]; + tmp = alpha * B[ offsetB + ( i * LDB ) + j ]; for ( k = i; k < m; k++ ) { - tmp -= A[ ( k * LDA ) + i ] * B[ ( k * LDB ) + j ]; + tmp -= A[ offsetA + ( k * LDA ) + i ] * B[ offsetB + ( k * LDB ) + j ]; } if ( nounit ) { - tmp /= A[ ( i * LDA ) + i ]; + tmp /= A[ offsetA + ( i * LDA ) + i ]; } - B[ ( i * LDB ) + j ] = tmp; + B[ offsetB + ( i * LDB ) + j ] = tmp; } } return B; @@ -200,14 +196,14 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( order === 'column-major' ) { for ( j = 0; j < n; j++ ) { for ( i = m - 1; i >= 0; i-- ) { - tmp = alpha * B[ ( j * LDB ) + i ]; + tmp = alpha * B[ offsetB + ( j * LDB ) + i ]; for ( k = i; k < m; k++ ) { - tmp -= A[ ( i * LDA ) + k ] * B[ ( j * LDB ) + k ]; + tmp -= A[ offsetA + ( i * LDA ) + k ] * B[ offsetB + ( j * LDB ) + k ]; } if ( nounit ) { - tmp /= A[ ( i * LDA ) + i ]; + tmp /= A[ offsetA + ( i * LDA ) + i ]; } - B[ ( j * LDB ) + i ] = tmp; + B[ offsetB + ( j * LDB ) + i ] = tmp; } } return B; @@ -215,14 +211,14 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B // order === "row-major" for ( j = 0; j < n; j++ ) { for ( i = 0; i < m; i++ ) { - tmp = alpha * B[ ( i * LDB ) + j ]; + tmp = alpha * B[ offsetB + ( i * LDB ) + j ]; for ( k = 1; k < i - 1; k++ ) { - tmp -= A[ ( k * LDA ) + i ] * B[ ( k * LDB ) + j ]; + tmp -= A[ offsetA + ( k * LDA ) + i ] * B[ offsetB + ( k * LDB ) + j ]; } if ( nounit ) { - tmp /= A[ ( i * LDA ) + i ]; + tmp /= A[ offsetA + ( i * LDA ) + i ]; } - B[ ( i * LDB ) + j ] = tmp; + B[ offsetB + ( i * LDB ) + j ] = tmp; } } return B; @@ -235,20 +231,20 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( j = 0; j < n; j++ ) { if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= alpha; + B[ offsetB + ( j * LDB ) + i ] *= alpha; } } for ( k = 0; k < j - 1; k++ ) { - if ( A[ ( j * LDA ) + k ] !== 0.0 ) { + if ( A[ offsetA + ( j * LDA ) + k ] !== 0.0 ) { for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] -= A[ ( j * LDA ) + k ] * B[ ( k * LDB ) + i ]; + B[ offsetB + ( j * LDB ) + i ] -= A[ offsetA + ( j * LDA ) + k ] * B[ offsetB + ( k * LDB ) + i ]; } } } if ( nounit ) { - tmp = 1.0 / A[ ( j * LDA ) + j ]; + tmp = 1.0 / A[ offsetA + ( j * LDA ) + j ]; for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= tmp; + B[ offsetB + ( j * LDB ) + i ] *= tmp; } } } @@ -258,20 +254,20 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( j = n - 1; j >= 0; j-- ) { if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] *= alpha; + B[ offsetB + ( i * LDB ) + j ] *= alpha; } } for ( k = j; k < n; k++ ) { - if ( A[ ( k * LDA) + j ] !== 0.0 ) { + if ( A[ offsetA + ( k * LDA) + j ] !== 0.0 ) { for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] -= A[ ( k * LDA ) + j ] * B[ ( i * LDB ) + k ]; + B[ offsetB + ( i * LDB ) + j ] -= A[ offsetA + ( k * LDA ) + j ] * B[ offsetB + ( i * LDB ) + k ]; } } } if ( nounit ) { - tmp = 1.0 / A[ ( j * LDA ) + j ]; + tmp = 1.0 / A[ offsetA + ( j * LDA ) + j ]; for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] *= tmp; + B[ offsetB + ( i * LDB ) + j ] *= tmp; } } } @@ -281,20 +277,20 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( j = n - 1; j >= 0; j-- ) { if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= alpha; + B[ offsetB + ( j * LDB ) + i ] *= alpha; } } for ( k = j; k < n; k++ ) { - if ( A[ ( j * LDA ) + k ] !== 0 ) { + if ( A[ offsetA + ( j * LDA ) + k ] !== 0 ) { for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] -= A[ ( j * LDA ) + k ] * B[ ( k * LDB ) + i ]; + B[ offsetB + ( j * LDB ) + i ] -= A[ offsetA + ( j * LDA ) + k ] * B[ offsetB + ( k * LDB ) + i ]; } } } if ( nounit ) { - tmp = 1.0 / A[ ( j * LDA ) + j ]; + tmp = 1.0 / A[ offsetA + ( j * LDA ) + j ]; for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] *= tmp; + B[ offsetB + ( j * LDB ) + i ] *= tmp; } } } @@ -304,20 +300,20 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( j = 0; j < n; j++ ) { if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] *= alpha; + B[ offsetB + ( i * LDB ) + j ] *= alpha; } } for ( k = 0; k < j - 1; k++ ) { - if ( A[ ( k * LDA ) + j ] !== 0.0 ) { + if ( A[ offsetA + ( k * LDA ) + j ] !== 0.0 ) { for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] -= A[ ( k * LDA ) + j ] * B[ ( i * LDB ) + k ]; + B[ offsetB + ( i * LDB ) + j ] -= A[ offsetA + ( k * LDA ) + j ] * B[ offsetB + ( i * LDB ) + k ]; } } } if ( nounit ) { - tmp = 1.0 / A[ ( j * LDA ) + j ]; + tmp = 1.0 / A[ offsetA + ( j * LDA ) + j ]; for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] *= tmp; + B[ offsetB + ( i * LDB ) + j ] *= tmp; } } } @@ -328,22 +324,22 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( order === 'column-major' ) { for ( k = n - 1; k >= 0; k-- ) { if ( nounit ) { - tmp = 1.0 / A[ ( k * LDA ) + k ]; + tmp = 1.0 / A[ offsetA + ( k * LDA ) + k ]; for ( i = 0; i < m; i++ ) { - B[ ( k * LDB ) + i ] *= tmp; + B[ offsetB + ( k * LDB ) + i ] *= tmp; } } for ( j = 0; j < k - 1; j++ ) { - if ( A[ ( k * LDA ) + j ] !== 0 ) { - tmp = A[ ( k * LDA ) + j ]; + if ( A[ offsetA + ( k * LDA ) + j ] !== 0 ) { + tmp = A[ offsetA + ( k * LDA ) + j ]; for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] -= tmp * B[ ( k * LDB ) + i ]; + B[ offsetB + ( j * LDB ) + i ] -= tmp * B[ offsetB + ( k * LDB ) + i ]; } } } if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { - B[ ( k * LDB ) + i ] *= alpha; + B[ offsetB + ( k * LDB ) + i ] *= alpha; } } } @@ -352,22 +348,22 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B // order === "row-major" for ( k = 0; k < n; k++ ) { if ( nounit ) { - tmp = 1.0 / A[ ( k * LDA ) + k ]; + tmp = 1.0 / A[ offsetA + ( k * LDA ) + k ]; for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + k ] *= tmp; + B[ offsetB + ( i * LDB ) + k ] *= tmp; } } for ( j = k; j < n; j++ ) { - if ( A[ ( j * LDA ) + k ] !== 0 ) { - tmp = A[ ( j * LDA ) + k ]; + if ( A[ offsetA + ( j * LDA ) + k ] !== 0 ) { + tmp = A[ offsetA + ( j * LDA ) + k ]; for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] -= tmp * B[ ( i * LDB ) + k ]; + B[ offsetB + ( i * LDB ) + j ] -= tmp * B[ offsetB + ( i * LDB ) + k ]; } } } if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + k ] *= alpha; + B[ offsetB + ( i * LDB ) + k ] *= alpha; } } } @@ -377,22 +373,22 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( order === 'column-major' ) { for ( k = 0; k < n; k++ ) { if ( nounit ) { - tmp = 1.0 / A[ ( k * LDA ) + k ]; + tmp = 1.0 / A[ offsetA + ( k * LDA ) + k ]; for ( i = 0; i < m; i++ ) { - B[ ( k * LDB ) + i ] *= tmp; + B[ offsetB + ( k * LDB ) + i ] *= tmp; } } for ( j = k; j < n; j++ ) { - if ( A[ ( k * LDA ) + j ] !== 0 ) { - tmp = A[ ( k * LDA ) + j ]; + if ( A[ offsetA + ( k * LDA ) + j ] !== 0 ) { + tmp = A[ offsetA + ( k * LDA ) + j ]; for ( i = 0; i < m; i++ ) { - B[ ( j * LDB ) + i ] -= tmp * B[ ( k * LDB ) + i ]; + B[ offsetB + ( j * LDB ) + i ] -= tmp * B[ offsetB + ( k * LDB ) + i ]; } } } if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { - B[ ( k * LDB ) + i ] *= alpha; + B[ offsetB + ( k * LDB ) + i ] *= alpha; } } } @@ -401,22 +397,22 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B // order === "row-major" for ( k = n - 1; k >= 0; k-- ) { if ( nounit ) { - tmp = 1.0 / A[ ( k * LDA ) + k ]; + tmp = 1.0 / A[ offsetA + ( k * LDA ) + k ]; for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + k ] *= tmp; + B[ offsetB + ( i * LDB ) + k ] *= tmp; } } for ( j = 0; j < k - 1; j++ ) { - if ( A[ ( j * LDA ) + k ] !== 0 ) { - tmp = A[ ( j * LDA ) + k ]; + if ( A[ offsetA + ( j * LDA ) + k ] !== 0 ) { + tmp = A[ offsetA + ( j * LDA ) + k ]; for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + j ] -= tmp * B[ ( i * LDB ) + k ]; + B[ offsetB + ( i * LDB ) + j ] -= tmp * B[ offsetB + ( i * LDB ) + k ]; } } } if ( alpha !== 1 ) { for ( i = 0; i < m; i++ ) { - B[ ( i * LDB ) + k ] *= alpha; + B[ offsetB + ( i * LDB ) + k ] *= alpha; } } } From 5d0646d2d2f81a6423eed002a3a93a76a9c070a3 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Mon, 8 Jul 2024 11:40:42 +0530 Subject: [PATCH 04/33] fix: incorrect base implementation --- .../@stdlib/blas/base/dtrsm/lib/base.js | 83 ++++++++++--------- .../@stdlib/blas/base/dtrsm/lib/dtrsm.js | 4 +- 2 files changed, 44 insertions(+), 43 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js index 41c6c96f9153..5a80ad54ea76 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js @@ -52,9 +52,9 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B var j; var k; - lside = side === 'L'; - nounit = diag === 'N'; - upper = uplo === 'U'; + lside = side === 'left'; + nounit = diag === 'non-unit'; + upper = uplo === 'upper'; if ( m === 0 || n === 0 ) { return B; @@ -76,12 +76,12 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B return B; } if ( lside ) { - if ( transa === 'N' ) { + if ( transa === 'none' ) { // B := alpha * inv( A ) * B if ( upper ) { if ( order === 'column-major' ) { for ( j = 0; j < n; j++ ) { - if ( alpha !== 1 ) { + if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( j * LDB ) + i ] *= alpha; } @@ -101,17 +101,17 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } // order === "row-major" for ( j = 0; j < n; j++ ) { - if ( alpha !== 1 ) { + if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( i * LDB ) + j ] *= alpha; } } - for ( k = 0; k < m; k++ ) { + for ( k = m - 1; k >= 0; k-- ) { if ( B[ offsetB + ( k * LDB ) + j ] !== 0 ) { if ( nounit ) { B[ offsetB + ( k * LDB ) + j ] /= A[ offsetA + ( k * LDA ) + k ]; } - for ( i = k + 1; i < m; i++ ) { + for ( i = 0; i < k; i++ ) { B[ offsetB + ( i * LDB ) + j ] -= B[ offsetB + ( k * LDB ) + j ] * A[ offsetA + ( i * LDA ) + k ]; } } @@ -122,7 +122,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B // lower if ( order === 'column-major' ) { for ( j = 0; j < n; j++ ) { - if ( alpha !== 1 ) { + if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( j * LDB ) + i ] *= alpha; } @@ -132,7 +132,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( nounit ) { B[ offsetB + ( j * LDB ) + k ] /= A[ offsetA + ( k * LDA ) + k ]; } - for ( i = k; i < m; i++ ) { + for ( i = k + 1; i < m; i++ ) { B[ offsetB + ( j * LDB ) + i ] -= B[ offsetB + ( j * LDB ) + k ] * A[ offsetA + ( k * LDA ) + i ]; } } @@ -142,17 +142,17 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } // order === "row-major" for ( j = 0; j < n; j++ ) { - if ( alpha !== 1 ) { + if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( i * LDB ) + j ] *= alpha; } } - for ( k = m - 1; k >= 0; k-- ) { + for ( k = 0; k < m; k++ ) { if ( B[ offsetB + ( k * LDB ) + j ] !== 0 ) { if ( nounit ) { B[ offsetB + ( k * LDB ) + j ] /= A[ offsetA + ( k * LDA ) + k ]; } - for ( i = 0; i < k - 1; i++ ) { + for ( i = k + 1; i < m; i++ ) { B[ offsetB + ( i * LDB ) + j ] -= B[ offsetB + ( k * LDB ) + j ] * A[ offsetA + ( i * LDA ) + k ]; } } @@ -166,7 +166,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( j = 0; j < n; j++ ) { for ( i = 0; i < m; i++ ) { tmp = alpha * B[ offsetB + ( j * LDB ) + i ]; - for ( k = 0; k < i - 1; k++ ) { + for ( k = 0; k <= i - 1; k++ ) { tmp -= A[ offsetA + ( i * LDA ) + k ] * B[ offsetB + ( j * LDB ) + k ]; } if ( nounit ) { @@ -179,9 +179,9 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } // order === "row-major" for ( j = 0; j < n; j++ ) { - for ( i = m - 1; i >= 0; i-- ) { + for ( i = 0; i < m; i++ ) { tmp = alpha * B[ offsetB + ( i * LDB ) + j ]; - for ( k = i; k < m; k++ ) { + for ( k = 0; k <= i - 1; k++ ) { tmp -= A[ offsetA + ( k * LDA ) + i ] * B[ offsetB + ( k * LDB ) + j ]; } if ( nounit ) { @@ -197,7 +197,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( j = 0; j < n; j++ ) { for ( i = m - 1; i >= 0; i-- ) { tmp = alpha * B[ offsetB + ( j * LDB ) + i ]; - for ( k = i; k < m; k++ ) { + for ( k = i + 1; k < m; k++ ) { tmp -= A[ offsetA + ( i * LDA ) + k ] * B[ offsetB + ( j * LDB ) + k ]; } if ( nounit ) { @@ -210,9 +210,9 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } // order === "row-major" for ( j = 0; j < n; j++ ) { - for ( i = 0; i < m; i++ ) { + for ( i = m - 1; i >= 0; i-- ) { tmp = alpha * B[ offsetB + ( i * LDB ) + j ]; - for ( k = 1; k < i - 1; k++ ) { + for ( k = i + 1; k < m; k++ ) { tmp -= A[ offsetA + ( k * LDA ) + i ] * B[ offsetB + ( k * LDB ) + j ]; } if ( nounit ) { @@ -224,17 +224,17 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B return B; } // !lside - if ( transa === 'N' ) { + if ( transa === 'none' ) { // B := alpha * B * inv( A ) if ( upper ) { if ( order === 'column-major' ) { for ( j = 0; j < n; j++ ) { - if ( alpha !== 1 ) { + if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( j * LDB ) + i ] *= alpha; } } - for ( k = 0; k < j - 1; k++ ) { + for ( k = 0; k <= j - 1; k++ ) { if ( A[ offsetA + ( j * LDA ) + k ] !== 0.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( j * LDB ) + i ] -= A[ offsetA + ( j * LDA ) + k ] * B[ offsetB + ( k * LDB ) + i ]; @@ -251,14 +251,14 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B return B; } // order === "row-major" - for ( j = n - 1; j >= 0; j-- ) { - if ( alpha !== 1 ) { + for ( j = 0; j < n; j++ ) { + if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( i * LDB ) + j ] *= alpha; } } - for ( k = j; k < n; k++ ) { - if ( A[ offsetA + ( k * LDA) + j ] !== 0.0 ) { + for ( k = 0; k <= j - 1; k++ ) { + if ( A[ offsetA + ( k * LDA ) + j ] !== 0.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( i * LDB ) + j ] -= A[ offsetA + ( k * LDA ) + j ] * B[ offsetB + ( i * LDB ) + k ]; } @@ -271,16 +271,17 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } } } + return B; } // lower if ( order === 'column-major' ) { for ( j = n - 1; j >= 0; j-- ) { - if ( alpha !== 1 ) { + if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( j * LDB ) + i ] *= alpha; } } - for ( k = j; k < n; k++ ) { + for ( k = j + 1; k < n; k++ ) { if ( A[ offsetA + ( j * LDA ) + k ] !== 0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( j * LDB ) + i ] -= A[ offsetA + ( j * LDA ) + k ] * B[ offsetB + ( k * LDB ) + i ]; @@ -297,14 +298,14 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B return B; } // order === "row-major" - for ( j = 0; j < n; j++ ) { + for ( j = n - 1; j >= 0; j-- ) { if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( i * LDB ) + j ] *= alpha; } } - for ( k = 0; k < j - 1; k++ ) { - if ( A[ offsetA + ( k * LDA ) + j ] !== 0.0 ) { + for ( k = j + 1; k < n; k++ ) { + if ( A[ offsetA + ( k * LDA ) + j ] !== 0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( i * LDB ) + j ] -= A[ offsetA + ( k * LDA ) + j ] * B[ offsetB + ( i * LDB ) + k ]; } @@ -329,7 +330,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B B[ offsetB + ( k * LDB ) + i ] *= tmp; } } - for ( j = 0; j < k - 1; j++ ) { + for ( j = 0; j <= k - 1; j++ ) { if ( A[ offsetA + ( k * LDA ) + j ] !== 0 ) { tmp = A[ offsetA + ( k * LDA ) + j ]; for ( i = 0; i < m; i++ ) { @@ -337,7 +338,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } } } - if ( alpha !== 1 ) { + if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( k * LDB ) + i ] *= alpha; } @@ -346,14 +347,14 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B return B; } // order === "row-major" - for ( k = 0; k < n; k++ ) { + for ( k = n - 1; k >= 0; k-- ) { if ( nounit ) { tmp = 1.0 / A[ offsetA + ( k * LDA ) + k ]; for ( i = 0; i < m; i++ ) { B[ offsetB + ( i * LDB ) + k ] *= tmp; } } - for ( j = k; j < n; j++ ) { + for ( j = 0; j <= k - 1; j++ ) { if ( A[ offsetA + ( j * LDA ) + k ] !== 0 ) { tmp = A[ offsetA + ( j * LDA ) + k ]; for ( i = 0; i < m; i++ ) { @@ -361,7 +362,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } } } - if ( alpha !== 1 ) { + if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( i * LDB ) + k ] *= alpha; } @@ -378,7 +379,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B B[ offsetB + ( k * LDB ) + i ] *= tmp; } } - for ( j = k; j < n; j++ ) { + for ( j = k + 1; j < n; j++ ) { if ( A[ offsetA + ( k * LDA ) + j ] !== 0 ) { tmp = A[ offsetA + ( k * LDA ) + j ]; for ( i = 0; i < m; i++ ) { @@ -386,7 +387,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } } } - if ( alpha !== 1 ) { + if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( k * LDB ) + i ] *= alpha; } @@ -395,14 +396,14 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B return B; } // order === "row-major" - for ( k = n - 1; k >= 0; k-- ) { + for ( k = 0; k < n; k++ ) { if ( nounit ) { tmp = 1.0 / A[ offsetA + ( k * LDA ) + k ]; for ( i = 0; i < m; i++ ) { B[ offsetB + ( i * LDB ) + k ] *= tmp; } } - for ( j = 0; j < k - 1; j++ ) { + for ( j = k + 1; j < n; j++ ) { if ( A[ offsetA + ( j * LDA ) + k ] !== 0 ) { tmp = A[ offsetA + ( j * LDA ) + k ]; for ( i = 0; i < m; i++ ) { @@ -410,7 +411,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } } } - if ( alpha !== 1 ) { + if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( i * LDB ) + k ] *= alpha; } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js index 06b4f87da660..13277a572503 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js @@ -57,7 +57,7 @@ var base = require( './base.js' ); * @example * TODO: */ -function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) { +function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) { if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', orderA ) ); } @@ -73,7 +73,7 @@ function dtrsm( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, B if ( !isDiagonalType( diag ) ) { throw new TypeError( format( 'invalid argument. Fifth argument must specify whether the matrix is unit triangular or not. Value: `%s`.', diag ) ); } - return base( orderA, orderB, side, uplo, transa, diag, m, n, alpha, A, LDA, 0, B, LDB, 0 ); + return base( order, side, uplo, transa, diag, m, n, alpha, A, LDA, 0, B, LDB, 0 ); } From 4fe27b2f6f08fe03c2f435f86c253f524ea56204 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Mon, 8 Jul 2024 11:40:49 +0530 Subject: [PATCH 05/33] chore: add examples --- .../@stdlib/blas/base/dtrsm/examples/index.js | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js b/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js new file mode 100644 index 000000000000..e31bfecd477f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js @@ -0,0 +1,134 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var Float64Array = require( '@stdlib/array/float64' ); +var dtrsm = require( './../lib' ); + +var A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); +var B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); + +var out = dtrsm( 'column-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ 30.0, 0.0, 6.0, 12.0 ] + +A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + +out = dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ 30.0, 6.0, 0.0, 12.0 ] + +A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + +out = dtrsm( 'column-major', 'left', 'lower', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ 30.0, -12.0, 0.0, 12.0 ] + +A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); + +out = dtrsm( 'row-major', 'left', 'lower', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ 30.0, 0.0, -12.0, 12.0 ] + +A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); + +out = dtrsm( 'column-major', 'left', 'upper', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ 30.0, -22.5, 42, -19.5 ] + +A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + +out = dtrsm( 'row-major', 'left', 'upper', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ 30.0, 42.0, -22.5, -19.5 ] + +A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + +out = dtrsm( 'column-major', 'left', 'lower', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ -1.5, 10.5, -36, 12 ] + +A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); + +out = dtrsm( 'row-major', 'left', 'lower', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ -1.5, -36, 10.5, 12 ] + +A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); + +out = dtrsm( 'column-major', 'right', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ 30, 0, -12, 12 ] + +A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + +out = dtrsm( 'row-major', 'right', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ 30, -12, 0, 12 ] + +A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + +out = dtrsm( 'column-major', 'right', 'lower', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ 30, 6, 0, 12 ] + +A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); + +out = dtrsm( 'row-major', 'right', 'lower', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ 30, 0, 6, 12 ] + +A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); + +out = dtrsm( 'column-major', 'right', 'upper', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ -1.5, -36, 10.5, 12 ] + +A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + +out = dtrsm( 'row-major', 'right', 'upper', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ -1.5, 10.5, -36, 12 ] + +A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + +out = dtrsm( 'column-major', 'right', 'lower', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ 30, 42, -22.5, -19.5 ] + +A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); + +out = dtrsm( 'row-major', 'right', 'lower', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( out ); +// => [ 30, -22.5, 42, -19.5 ] From 510cc178a2492909c0037005226191ccd301cc61 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Mon, 8 Jul 2024 12:20:39 +0530 Subject: [PATCH 06/33] chore: add readme --- .../@stdlib/blas/base/dtrsm/README.md | 248 ++++++++++++++++++ 1 file changed, 248 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/README.md diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md new file mode 100644 index 000000000000..6fa0548604a1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md @@ -0,0 +1,248 @@ + + +# dtrsm + +> Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. + +
+ +## Usage + +```javascript +var dtrsm = require( '@stdlib/blas/base/dtrsm' ); +``` + +#### dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) + +Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + +dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +// B => [ 30.0, 6.0, 0.0, 12.0 ] +``` + +The function has the following parameters: + +- **order**: storage layout of `A` and `B`. +- **side**: specifies whether `op( A )` appears on the left or right side of `X`. +- **uplo**: specifies whether the upper or lower triangular part of the matrix `A` is supplied. +- **transa**: specifies the form of `op( A )` to be used in the matrix multiplication. +- **diag**: specifies whether or not `A` is unit triangular. +- **m**: number of rows in `B`. +- **n**: number of columns in `B`. +- **alpha**: scalar constant. +- **A**: input matrix `A`. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +- **B**: input matrix `B`. +- **LDB**: stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + +dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +// B => [ 30.0, 6.0, 0.0, 12.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial arrays... +var A0 = new Float64Array( [ 0.0, 1.0, 3.0, 0.0, 4.0 ] ); +var B0 = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); + +// Create offset views... +var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 1st element +var B1 = new Float64Array( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); // start at 1st element + +out = dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A1, 2, B1, 2 ); +console.log( out ); +// B0 => [ 30.0, 6.0, 0.0, 12.0 ] +``` + +#### dtrsm.ndarray( ord, sid, ul, ta, diag, m, n, alp, A, LDA, oa, B, LDB, ob ) + +Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); +B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); + +dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 2, B, 2, 1 ); +// B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] +``` + +The function has the following additional parameters: + +- **oa**: starting index for `A`. +- **ob**: starting index for `B`. + +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' ); + +A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); +B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); + +dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 2, B, 2, 1 ); +// B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] +``` + +
+ + + +
+ +## Notes + +- `dtrsm()` corresponds to the [BLAS][blas] level 3 function [`dtrsm`][dtrsm]. + +
+ + + +
+ +## Examples + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var dtrsm = require( '@stdlib/blas/base/dtrsm' ); + +var A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); +var B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); + +dtrsm( 'row-major', 'left', 'lower', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +console.log( B ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + From 6569dc865a587b82ef93fc93e496ea75112ffe7c Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Mon, 8 Jul 2024 12:22:06 +0530 Subject: [PATCH 07/33] chore: add package.json --- .../@stdlib/blas/base/dtrsm/package.json | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/package.json diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/package.json b/lib/node_modules/@stdlib/blas/base/dtrsm/package.json new file mode 100644 index 000000000000..7a4bcccb6a32 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/blas/base/dtrsm", + "version": "0.0.0", + "description": "Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "level 3", + "dtrsm", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "float64", + "double", + "float64array" + ] +} From bc4f4c25afb5ecd0b75e82bf4b059d3c8b9ae55c Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Mon, 8 Jul 2024 12:22:45 +0530 Subject: [PATCH 08/33] fix: incorrect readme example --- lib/node_modules/@stdlib/blas/base/dtrsm/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md index 6fa0548604a1..0e41359805ec 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md @@ -86,7 +86,7 @@ var B1 = new Float64Array( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); // start at 1st out = dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A1, 2, B1, 2 ); console.log( out ); -// B0 => [ 30.0, 6.0, 0.0, 12.0 ] +// B0 => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] ``` #### dtrsm.ndarray( ord, sid, ul, ta, diag, m, n, alp, A, LDA, oa, B, LDB, ob ) From d121f15804eced26bf1f50d93fd7023ddbdb3fda Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Mon, 8 Jul 2024 12:38:14 +0530 Subject: [PATCH 09/33] chore: add repl.txt --- .../@stdlib/blas/base/dtrsm/docs/repl.txt | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt new file mode 100644 index 000000000000..87ea8ab9148e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt @@ -0,0 +1,161 @@ + +{{alias}}( ord, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) + Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` + where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, + or non-unit, upper or lower triangular matrix and `op( A )` is one of + `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `M` or `N` are equal to `0`, the function returns `B` unchanged. + + Parameters + ---------- + ord: string + Row-major (C-style) or column-major (Fortran-style) order. Must be + either 'row-major' or 'column-major'. + + side: string + Specifies whether `op( A )` appears on the left or right side of `X`. + Must be either 'left' or 'right'. + + uplo: string + Specifies whether the upper or lower triangular matrix of `A` is + supplied. Must be either 'upper' or 'lower'. + + transa: string + Specifies the form of `op( A )` to be used in the matrix multiplication. + + diag: string + Specifies whether `A` is unit triangular. Must be either 'unit' or + 'non-unit'. + + m: integer + Number of rows in `B`. + + n: integer + Number of columns in `B`. + + alpha: number + Scalar constant. + + A: Float64Array + Triangular matrix `A`. + + LDA: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + B: Float64Array + Triangular matrix `B`. + + LDB: integer + Stride of the first dimension of `B` (a.k.a., leading dimension of the + matrix `B`). + + Returns + ------- + B: Float64Array + Output matrix. + + Examples + -------- + // Standard usage: + > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 3.0, 0.0, 4.0 ] ); + > var B = new {{alias:@stdlib/array/float64}}( [ 5.0, 7.0, 0.0, 8.0 ] ); + > {{alias}}( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ) + [ 30.0, 6.0, 0.0, 12.0 ] + + // Using typed array views: + > var A0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 3.0, 0.0, 4.0 ] ); + > var B0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); + > var A1 = new {{alias:@stdlib/array/float64}}( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); + > var B1 = new {{alias:@stdlib/array/float64}}( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); + > {{alias}}( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A1, 2, B1, 2 ); + > B0 + [ 0.0, 30.0, 6.0, 0.0, 12.0 ] + + +{{alias}}.ndarray( ord, side, ul, ta, diag, m, n, α, A, LDA, oa, B, LDB, ob ) + Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` + using alternative indexing semantics where `alpha` is a scalar, `X` and + `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower + triangular matrix and `op( A )` is one of `op( A) = A` or + `op( A ) = A**T`. The matrix `X` is overwritten on `B`. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameters support indexing semantics based on starting + indices. + + Parameters + ---------- + ord: string + Row-major (C-style) or column-major (Fortran-style) order. Must be + either 'row-major' or 'column-major'. + + side: string + Specifies whether `op( A )` appears on the left or right side of `X`. + Must be either 'left' or 'right'. + + ul: string + Specifies whether the upper or lower triangular matrix of `A` is + supplied. Must be either 'upper' or 'lower'. + + ta: string + Specifies the form of `op( A )` to be used in the matrix multiplication. + + diag: string + Specifies whether `A` is unit triangular. Must be either 'unit' or + 'non-unit'. + + m: integer + Number of rows in `B`. + + n: integer + Number of columns in `B`. + + α: number + Scalar constant. + + A: Float64Array + Triangular matrix `A`. + + LDA: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + oa: integer + Index offset for `A`. + + B: Float64Array + Triangular matrix `B`. + + LDB: integer + Stride of the first dimension of `B` (a.k.a., leading dimension of the + matrix `B`). + + ob: integer + Index offset for `B`. + + Returns + ------- + B: Float64Array + Output matrix. + + Examples + -------- + // Standard usage: + > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 3.0, 0.0, 4.0 ] ); + > var B = new {{alias:@stdlib/array/float64}}( [ 5.0, 7.0, 0.0, 8.0 ] ); + > {{alias}}.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ) + [ 30.0, 6.0, 0.0, 12.0 ] + + // Advanced indexing: + > var A = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); + > var B = new {{alias:@stdlib/array/float64}}( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); + > {{alias}}.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 2, B, 2, 1 ) + [ 0.0, 30.0, 6.0, 0.0, 12.0 ] + + See Also + -------- From 6b3562f48c42999d50cdfd784e83e89e5cef80b8 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Mon, 8 Jul 2024 13:02:42 +0530 Subject: [PATCH 10/33] chore: add docs/types --- .../blas/base/dtrsm/docs/types/index.d.ts | 128 +++++ .../blas/base/dtrsm/docs/types/test.ts | 440 ++++++++++++++++++ 2 files changed, 568 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts new file mode 100644 index 000000000000..1be253bf698b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts @@ -0,0 +1,128 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Layout, MatrixTriangle, DiagonalType, OperationSide, TransposeOperation } from '@stdlib/types/blas'; + +/** +* Interface describing `dtrsm`. +*/ +interface Routine { + /** + * Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. + * + * @param order - specifies the memory layout of `A` and `B` + * @param side - specifies whether `op( A )` appears on the left or right of `X` + * @param uplo - specifies whether the matrix `A` is an upper or lower triangular matrix + * @param transa - specifies the form of `op( A )` to be used in matrix multiplication + * @param diag - specifies whether or not `A` is unit triangular + * @param m - number of rows in `B` + * @param n - number of columns in `B` + * @param alpha - scalar alpha + * @param A - input matrix `A` + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param B - input matrix `B` + * @param LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) + * @returns `B` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + * var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + * + * dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); + * // B => [ 30.0, 6.0, 0.0, 12.0 ] + */ + ( order: Layout, side: OperationSide, uplo: MatrixTriangle, transa: TransposeOperation, diag: DiagonalType, m: number, n: number, alpha: number, A: Float64Array, LDA: number, B: Float64Array, LDB: number ): Float64Array; + + /** + * Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. + * + * @param order - specifies the memory layout of `A` and `B` + * @param side - specifies whether `op( A )` appears on the left or right of `X` + * @param uplo - specifies whether the matrix `A` is an upper or lower triangular matrix + * @param transa - specifies the form of `op( A )` to be used in matrix multiplication + * @param diag - specifies whether or not `A` is unit triangular + * @param m - number of rows in `B` + * @param n - number of columns in `B` + * @param alpha - scalar alpha + * @param A - input matrix `A` + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param offsetA - index offset for matrix `A` + * @param B - input matrix `B` + * @param LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) + * @param offsetB - index offset for matrix `B` + * @returns `B` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + * var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + * + * dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); + * // B => [ 30.0, 6.0, 0.0, 12.0 ] + */ + ndarray( order: Layout, side: OperationSide, uplo: MatrixTriangle, transa: TransposeOperation, diag: DiagonalType, m: number, n: number, alpha: number, A: Float64Array, LDA: number, offsetA: number, B: Float64Array, LDB: number, offsetB: number ): Float64Array; +} + +/** +* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +* +* @param order - specifies the memory layout of `A` and `B` +* @param side - specifies whether `op( A )` appears on the left or right of `X` +* @param uplo - specifies whether the matrix `A` is an upper or lower triangular matrix +* @param transa - specifies the form of `op( A )` to be used in matrix multiplication +* @param diag - specifies whether or not `A` is unit triangular +* @param m - number of rows in `B` +* @param n - number of columns in `B` +* @param alpha - scalar alpha +* @param A - input matrix `A` +* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param B - input matrix `B` +* @param LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) +* @returns `B` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +* var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); +* +* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +* // B => [ 30.0, 6.0, 0.0, 12.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +* var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); +* +* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); +* // B => [ 30.0, 6.0, 0.0, 12.0 ] +*/ +declare var dtrsm: Routine; + + +// EXPORTS // + +export = dtrsm; diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts new file mode 100644 index 000000000000..fea44907f46d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts @@ -0,0 +1,440 @@ +/* +* @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 dtrsm = require( './index' ); + + +// TESTS // + +// The function returns a Float64Array... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $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, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm( 10, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( true, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( false, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( null, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( [], 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( {}, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( ( x: number ): number => x, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $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, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm( 'row-major', 10, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', true, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', false, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', null, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', [], 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', {}, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', ( x: number ): number => x, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a string... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm( 'row-major', 'left', 10, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', true, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', false, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', null, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', [], 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', {}, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', ( x: number ): number => x, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a string... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm( 'row-major', 'left', 'upper', 10, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', true, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', false, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', null, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', [], 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', {}, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', ( x: number ): number => x, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a string... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm( 'row-major', 'left', 'upper', 'none', 10, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', true, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', false, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', null, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', [], 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', {}, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', ( x: number ): number => x, 2, 2, 6.0, A, 2, B, 2 ); // $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, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', '2', 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', true, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', false, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', null, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', [], 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', {}, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', ( x: number ): number => x, 2, 6.0, A, 2, B, 2 ); // $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, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, '2', 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, true, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, false, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, null, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, [], 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, {}, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, ( x: number ): number => x, 6.0, A, 2, B, 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, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, '6.0', A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, true, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, false, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, null, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, [], A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, {}, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, ( x: number ): number => x, A, 2, B, 2 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a Float64Array... +{ + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, true, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, false, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, null, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, [], B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, {}, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, ( x: number ): number => x, B, 2 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, '2', B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, true, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, false, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, null, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, [], B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, {}, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, ( x: number ): number => x, B, 2 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eleventh argument which is not a Float64Array... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 2, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, true, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, false, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, null, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, [], 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, {}, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, ( x: number ): number => x, 2 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a twelfth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, '2' ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, true ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, false ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, null ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, [] ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, {} ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, ( 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, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm(); // $ExpectError + dtrsm( 'row-major' ); // $ExpectError + dtrsm( 'row-major', 'left' ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper' ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none' ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit' ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Float64Array... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 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, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 10, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( true, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( false, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( null, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( [], 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( {}, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( ( x: number ): number => x, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 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, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 10, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', true, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', false, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', null, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', [], 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', {}, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', ( x: number ): number => x, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a string... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 10, 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', true, 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', false, 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', null, 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', [], 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', {}, 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', ( x: number ): number => x, 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a string... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 'upper', 10, 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', true, 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', false, 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', null, 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', [], 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', {}, 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', ( x: number ): number => x, 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a string... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 10, 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', true, 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', false, 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', null, 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', [], 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', {}, 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', ( x: number ): number => x, 2, 2, 6.0, A, 2, 0, B, 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, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', '2', 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', true, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', false, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', null, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', [], 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', {}, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', ( x: number ): number => x, 2, 6.0, A, 2, 0, B, 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, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, '2', 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, true, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, false, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, null, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, [], 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, {}, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, ( x: number ): number => x, 6.0, A, 2, 0, B, 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, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, '6.0', A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, true, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, false, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, null, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, [], A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, {}, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, ( x: number ): number => x, A, 2, 0, B, 2, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a Float64Array... +{ + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, 2, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, true, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, false, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, null, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, [], 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, {}, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, ( x: number ): number => x, 2, 0, B, 2, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, '2', 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, true, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, false, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, null, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, [], 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, {}, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, ( x: number ): number => x, 0, B, 2, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eleventh argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, '2', B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, true, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, false, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, null, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, [], B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, {}, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, ( x: number ): number => x, B, 2, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a twelfth argument which is not a Float64Array... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, 2, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, true, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, false, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, null, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, [], 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, {}, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, ( x: number ): number => x, 2, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a thirteenth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, '2', 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, true, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, false, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, null, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, [], 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, {}, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourteenth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, '2' ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, true ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, false ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, null ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, [] ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, {} ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, ( 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, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray(); // $ExpectError + dtrsm.ndarray( 'row-major' ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left' ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper' ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none' ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit' ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0, 10 ); // $ExpectError +} From 2f00ec3a1a12acb2793839b2e764c433493efb3d Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Mon, 8 Jul 2024 13:17:48 +0530 Subject: [PATCH 11/33] chore: add benchmark --- .../blas/base/dtrsm/benchmark/benchmark.js | 104 ++++++++++++++++++ .../base/dtrsm/benchmark/benchmark.ndarray.js | 104 ++++++++++++++++++ 2 files changed, 208 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.js new file mode 100644 index 000000000000..d10bc18dcc5d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.js @@ -0,0 +1,104 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var 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 dtrsm = require( './../lib/dtrsm.js' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A; + var B; + + A = uniform( N*N, 1.0, 10.0, { + 'dtype': 'float64' + }); + B = uniform( N*N, 1.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 = dtrsm( 'column-major', 'left', 'upper', 'none', 'non-unit', N, N, 1.0, A, N, B, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':order=column-major,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..a300270c8195 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js @@ -0,0 +1,104 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var 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 dtrsm = require( './../lib/ndarray.js' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A; + var B; + + A = uniform( N*N, 1.0, 10.0, { + 'dtype': 'float64' + }); + B = uniform( N*N, 1.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 = dtrsm( 'column-major', 'left', 'upper', 'none', 'non-unit', N, N, 1.0, A, N, 0, B, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order=column-major,size='+(N*N), f ); + } +} + +main(); From 78d49ac7cf630b82351e071616b3f75d6cde7c55 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Mon, 8 Jul 2024 14:05:20 +0530 Subject: [PATCH 12/33] test: add and register --- .../fixtures/column_major_llnthreethree.json | 15 + .../test/fixtures/column_major_llntwotwo.json | 15 + .../test/fixtures/column_major_llutwotwo.json | 15 + .../fixtures/column_major_lunntwotwo.json | 15 + .../test/fixtures/column_major_luutwotwo.json | 15 + .../column_major_ndarray_llntwotwo.json | 17 + .../fixtures/column_major_rlunntwotwo.json | 15 + .../fixtures/column_major_runntwotwo.json | 15 + .../fixtures/row_major_llnthreethree.json | 15 + .../test/fixtures/row_major_llntwotwo.json | 15 + .../test/fixtures/row_major_llutwotwo.json | 15 + .../test/fixtures/row_major_lunntwotwo.json | 15 + .../test/fixtures/row_major_luutwotwo.json | 15 + .../fixtures/row_major_ndarray_llntwotwo.json | 17 + .../test/fixtures/row_major_rlunntwotwo.json | 15 + .../test/fixtures/row_major_runntwotwo.json | 15 + .../blas/base/dtrsm/test/test.dtrsm.js | 458 ++++++++++++++++++ .../@stdlib/blas/base/dtrsm/test/test.js | 82 ++++ .../blas/base/dtrsm/test/test.ndarray.js | 230 +++++++++ 19 files changed, 1014 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llnthreethree.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llntwotwo.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llutwotwo.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_lunntwotwo.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_luutwotwo.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_ndarray_llntwotwo.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_rlunntwotwo.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_runntwotwo.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llnthreethree.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llntwotwo.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llutwotwo.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_lunntwotwo.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_luutwotwo.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_ndarray_llntwotwo.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_rlunntwotwo.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_runntwotwo.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/test.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llnthreethree.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llnthreethree.json new file mode 100644 index 000000000000..f18c03da2655 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llnthreethree.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "side": "left", + "uplo": "lower", + "transa": "none", + "diag": "non-unit", + "m": 3, + "n": 3, + "alpha": 6.0, + "a": [ 1.0, 2.0, 3.0, 0.0, 5.0, 6.0, 0.0, 0.0, 9.0 ], + "lda": 3, + "b": [ 10.0, 11.0, 12.0, 0.0, 14.0, 15.0, 0.0, 0.0, 18.0 ], + "ldb": 3, + "expected": [ 60, -10.8, -4.8, 0, 16.8, -1.20, 0, 0, 12 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llntwotwo.json new file mode 100644 index 000000000000..9c14a6ee9d2e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llntwotwo.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "side": "left", + "uplo": "lower", + "transa": "none", + "diag": "non-unit", + "m": 2, + "n": 2, + "alpha": 6.0, + "a": [ 1.0, 3.0, 0.0, 4.0 ], + "lda": 2, + "b": [ 5.0, 7.0, 0.0, 8.0 ], + "ldb": 2, + "expected": [ 30.0, -12.0, 0.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llutwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llutwotwo.json new file mode 100644 index 000000000000..502c83e8d0e7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llutwotwo.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "side": "left", + "uplo": "lower", + "transa": "transpose", + "diag": "non-unit", + "m": 2, + "n": 2, + "alpha": 6.0, + "a": [ 1.0, 3.0, 0.0, 4.0 ], + "lda": 2, + "b": [ 5.0, 7.0, 0.0, 8.0 ], + "ldb": 2, + "expected": [ -1.5, 10.5, -36, 12 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_lunntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_lunntwotwo.json new file mode 100644 index 000000000000..bf4c5004e630 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_lunntwotwo.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "side": "left", + "uplo": "upper", + "transa": "none", + "diag": "non-unit", + "m": 2, + "n": 2, + "alpha": 6.0, + "a": [ 1.0, 0.0, 3.0, 4.0 ], + "lda": 2, + "b": [ 5.0, 0.0, 7.0, 8.0 ], + "ldb": 2, + "expected": [ 30.0, 0.0, 6.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_luutwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_luutwotwo.json new file mode 100644 index 000000000000..a521b020d715 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_luutwotwo.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "side": "left", + "uplo": "upper", + "transa": "transpose", + "diag": "non-unit", + "m": 2, + "n": 2, + "alpha": 6.0, + "a": [ 1.0, 0.0, 3.0, 4.0 ], + "lda": 2, + "b": [ 5.0, 0.0, 7.0, 8.0 ], + "ldb": 2, + "expected": [ 30.0, -22.5, 42, -19.5 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_ndarray_llntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_ndarray_llntwotwo.json new file mode 100644 index 000000000000..be057598ee6a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_ndarray_llntwotwo.json @@ -0,0 +1,17 @@ +{ + "order": "column-major", + "side": "left", + "uplo": "lower", + "transa": "none", + "diag": "non-unit", + "m": 2, + "n": 2, + "alpha": 6.0, + "a": [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ], + "lda": 2, + "b": [ 0.0, 0.0, 0.0, 5.0, 7.0, 0.0, 8.0 ], + "ldb": 2, + "expected": [ 0.0, 0.0, 0.0, 30.0, -12.0, 0.0, 12.0 ], + "offsetA": 2, + "offsetB": 3 +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_rlunntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_rlunntwotwo.json new file mode 100644 index 000000000000..d08baed06a35 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_rlunntwotwo.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "side": "right", + "uplo": "lower", + "transa": "none", + "diag": "non-unit", + "m": 2, + "n": 2, + "alpha": 6.0, + "a": [ 1.0, 3.0, 0.0, 4.0 ], + "lda": 2, + "b": [ 5.0, 7.0, 0.0, 8.0 ], + "ldb": 2, + "expected": [ 30, 6, 0, 12 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_runntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_runntwotwo.json new file mode 100644 index 000000000000..07e0203d49bb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_runntwotwo.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "side": "right", + "uplo": "upper", + "transa": "none", + "diag": "non-unit", + "m": 2, + "n": 2, + "alpha": 6.0, + "a": [ 1.0, 0.0, 3.0, 4.0 ], + "lda": 2, + "b": [ 5.0, 0.0, 7.0, 8.0 ], + "ldb": 2, + "expected": [ 30, 0, -12, 12 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llnthreethree.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llnthreethree.json new file mode 100644 index 000000000000..2ea9b36bef09 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llnthreethree.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "side": "left", + "uplo": "lower", + "transa": "none", + "diag": "non-unit", + "m": 3, + "n": 3, + "alpha": 6.0, + "a": [ 1.0, 0.0, 0.0, 2.0, 5.0, 0.0, 3.0, 6.0, 9.0 ], + "lda": 3, + "b": [ 10.0, 0.0, 0.0, 11.0, 14.0, 0.0, 12.0, 15.0, 18.0 ], + "ldb": 3, + "expected": [ 60, 0.0, 0.0, -10.8, 16.8, 0.0, -4.8, -1.20, 12 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llntwotwo.json new file mode 100644 index 000000000000..ab0bd985080a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llntwotwo.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "side": "left", + "uplo": "lower", + "transa": "none", + "diag": "non-unit", + "m": 2, + "n": 2, + "alpha": 6.0, + "a": [ 1.0, 0.0, 3.0, 4.0 ], + "lda": 2, + "b": [ 5.0, 0.0, 7.0, 8.0 ], + "ldb": 2, + "expected": [ 30.0, 0.0, -12.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llutwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llutwotwo.json new file mode 100644 index 000000000000..eaf52eb1a5df --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llutwotwo.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "side": "left", + "uplo": "lower", + "transa": "transpose", + "diag": "non-unit", + "m": 2, + "n": 2, + "alpha": 6.0, + "a": [ 1.0, 0.0, 3.0, 4.0 ], + "lda": 2, + "b": [ 5.0, 0.0, 7.0, 8.0 ], + "ldb": 2, + "expected": [ -1.5, -36, 10.5, 12 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_lunntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_lunntwotwo.json new file mode 100644 index 000000000000..29e9d2747590 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_lunntwotwo.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "side": "left", + "uplo": "upper", + "transa": "none", + "diag": "non-unit", + "m": 2, + "n": 2, + "alpha": 6.0, + "a": [ 1.0, 3.0, 0.0, 4.0 ], + "lda": 2, + "b": [ 5.0, 7.0, 0.0, 8.0 ], + "ldb": 2, + "expected": [ 30.0, 6.0, 0.0, 12.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_luutwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_luutwotwo.json new file mode 100644 index 000000000000..a07c277b7182 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_luutwotwo.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "side": "left", + "uplo": "upper", + "transa": "transpose", + "diag": "non-unit", + "m": 2, + "n": 2, + "alpha": 6.0, + "a": [ 1.0, 3.0, 0.0, 4.0 ], + "lda": 2, + "b": [ 5.0, 7.0, 0.0, 8.0 ], + "ldb": 2, + "expected": [ 30.0, 42.0, -22.5, -19.5 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_ndarray_llntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_ndarray_llntwotwo.json new file mode 100644 index 000000000000..da966fca9e2d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_ndarray_llntwotwo.json @@ -0,0 +1,17 @@ +{ + "order": "column-major", + "side": "right", + "uplo": "lower", + "transa": "none", + "diag": "non-unit", + "m": 2, + "n": 2, + "alpha": 6.0, + "a": [ 0.0, 1.0, 3.0, 0.0, 4.0 ], + "lda": 2, + "b": [ 0.0, 0.0, 0.0, 0.0, 5.0, 7.0, 0.0, 8.0 ], + "ldb": 2, + "expected": [ 0.0, 0.0, 0.0, 0.0, 30, 6, 0, 12 ], + "offsetA": 1, + "offsetB": 4 +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_rlunntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_rlunntwotwo.json new file mode 100644 index 000000000000..5d361b8f3a90 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_rlunntwotwo.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "side": "right", + "uplo": "lower", + "transa": "none", + "diag": "non-unit", + "m": 2, + "n": 2, + "alpha": 6.0, + "a": [ 1.0, 0.0, 3.0, 4.0 ], + "lda": 2, + "b": [ 5.0, 0.0, 7.0, 8.0 ], + "ldb": 2, + "expected": [ 30, 0, 6, 12 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_runntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_runntwotwo.json new file mode 100644 index 000000000000..3f1cdad02d02 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_runntwotwo.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "side": "right", + "uplo": "upper", + "transa": "none", + "diag": "non-unit", + "m": 2, + "n": 2, + "alpha": 6.0, + "a": [ 1.0, 3.0, 0.0, 4.0 ], + "lda": 2, + "b": [ 5.0, 7.0, 0.0, 8.0 ], + "ldb": 2, + "expected": [ 30, -12, 0, 12 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js new file mode 100644 index 000000000000..fe9ec209eb31 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js @@ -0,0 +1,458 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var dtrsm = require( './../lib/dtrsm.js' ); + + +// FIXTURES // + +var cllntwotwo = require( './fixtures/column_major_llntwotwo.json' ); +var cllutwotwo = require( './fixtures/column_major_llutwotwo.json' ); +var clunntwotwo = require( './fixtures/column_major_lunntwotwo.json' ); +var cluutwotwo = require( './fixtures/column_major_luutwotwo.json' ); +var crlunntwotwo = require( './fixtures/column_major_rlunntwotwo.json' ); +var crunntwotwo = require( './fixtures/column_major_runntwotwo.json' ); +var cllnthreethree = require( './fixtures/column_major_llnthreethree.json' ); + +var rllntwotwo = require( './fixtures/row_major_llntwotwo.json' ); +var rllutwotwo = require( './fixtures/row_major_llutwotwo.json' ); +var rlunntwotwo = require( './fixtures/row_major_lunntwotwo.json' ); +var rluutwotwo = require( './fixtures/row_major_luutwotwo.json' ); +var rrlunntwotwo = require( './fixtures/row_major_rlunntwotwo.json' ); +var rrunntwotwo = require( './fixtures/row_major_runntwotwo.json' ); +var rllnthreethree = require( './fixtures/row_major_llnthreethree.json' ); + + +// FUNCTIONS // + +/** +* Tests for element-wise approximate equality. +* +* @private +* @param {Object} t - test object +* @param {Collection} actual - actual values +* @param {Collection} expected - expected values +* @param {number} rtol - relative tolerance +*/ +function isApprox( t, actual, expected, rtol ) { + var delta; + var tol; + var i; + + t.strictEqual( actual.length, expected.length, 'returns expected value' ); + for ( i = 0; i < expected.length; i++ ) { + if ( actual[ i ] === expected[ i ] ) { + t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' ); + } else { + delta = abs( actual[ i ] - expected[ i ] ); + tol = rtol * EPS * abs( expected[ i ] ); + t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' ); + } + } +} + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dtrsm, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 12', function test( t ) { + t.strictEqual( dtrsm.length, 12, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dtrsm( value, clunntwotwo.side, clunntwotwo.uplo, clunntwotwo.transa, clunntwotwo.diag, clunntwotwo.m, clunntwotwo.n, clunntwotwo.alpha, new Float64Array( clunntwotwo.a ), clunntwotwo.lda, new Float64Array( clunntwotwo.b ), clunntwotwo.ldb ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dtrsm( clunntwotwo.order, value, clunntwotwo.uplo, clunntwotwo.transa, clunntwotwo.diag, clunntwotwo.m, clunntwotwo.n, clunntwotwo.alpha, new Float64Array( clunntwotwo.a ), clunntwotwo.lda, new Float64Array( clunntwotwo.b ), clunntwotwo.ldb ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dtrsm( clunntwotwo.order, clunntwotwo.side, value, clunntwotwo.transa, clunntwotwo.diag, clunntwotwo.m, clunntwotwo.n, clunntwotwo.alpha, new Float64Array( clunntwotwo.a ), clunntwotwo.lda, new Float64Array( clunntwotwo.b ), clunntwotwo.ldb ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourth argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dtrsm( clunntwotwo.order, clunntwotwo.side, clunntwotwo.uplo, value, clunntwotwo.diag, clunntwotwo.m, clunntwotwo.n, clunntwotwo.alpha, new Float64Array( clunntwotwo.a ), clunntwotwo.lda, new Float64Array( clunntwotwo.b ), clunntwotwo.ldb ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dtrsm( clunntwotwo.order, clunntwotwo.side, clunntwotwo.uplo, clunntwotwo.transa, value, clunntwotwo.m, clunntwotwo.n, clunntwotwo.alpha, new Float64Array( clunntwotwo.a ), clunntwotwo.lda, new Float64Array( clunntwotwo.b ), clunntwotwo.ldb ); + }; + } +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( cllntwotwo.a ); + B = new Float64Array( cllntwotwo.b ); + + expected = new Float64Array( cllntwotwo.expected ); + + out = dtrsm( cllntwotwo.order, cllntwotwo.side, cllntwotwo.uplo, cllntwotwo.transa, cllntwotwo.diag, cllntwotwo.m, cllntwotwo.n, cllntwotwo.alpha, A, cllntwotwo.lda, B, cllntwotwo.ldb ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( cllutwotwo.a ); + B = new Float64Array( cllutwotwo.b ); + + expected = new Float64Array( cllutwotwo.expected ); + + out = dtrsm( cllutwotwo.order, cllutwotwo.side, cllutwotwo.uplo, cllutwotwo.transa, cllutwotwo.diag, cllutwotwo.m, cllutwotwo.n, cllutwotwo.alpha, A, cllutwotwo.lda, B, cllutwotwo.ldb ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( clunntwotwo.a ); + B = new Float64Array( clunntwotwo.b ); + + expected = new Float64Array( clunntwotwo.expected ); + + out = dtrsm( clunntwotwo.order, clunntwotwo.side, clunntwotwo.uplo, clunntwotwo.transa, clunntwotwo.diag, clunntwotwo.m, clunntwotwo.n, clunntwotwo.alpha, A, clunntwotwo.lda, B, clunntwotwo.ldb ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( cluutwotwo.a ); + B = new Float64Array( cluutwotwo.b ); + + expected = new Float64Array( cluutwotwo.expected ); + + out = dtrsm( cluutwotwo.order, cluutwotwo.side, cluutwotwo.uplo, cluutwotwo.transa, cluutwotwo.diag, cluutwotwo.m, cluutwotwo.n, cluutwotwo.alpha, A, cluutwotwo.lda, B, cluutwotwo.ldb ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( crlunntwotwo.a ); + B = new Float64Array( crlunntwotwo.b ); + + expected = new Float64Array( crlunntwotwo.expected ); + + out = dtrsm( crlunntwotwo.order, crlunntwotwo.side, crlunntwotwo.uplo, crlunntwotwo.transa, crlunntwotwo.diag, crlunntwotwo.m, crlunntwotwo.n, crlunntwotwo.alpha, A, crlunntwotwo.lda, B, crlunntwotwo.ldb ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( crunntwotwo.a ); + B = new Float64Array( crunntwotwo.b ); + + expected = new Float64Array( crunntwotwo.expected ); + + out = dtrsm( crunntwotwo.order, crunntwotwo.side, crunntwotwo.uplo, crunntwotwo.transa, crunntwotwo.diag, crunntwotwo.m, crunntwotwo.n, crunntwotwo.alpha, A, crunntwotwo.lda, B, crunntwotwo.ldb ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( rllntwotwo.a ); + B = new Float64Array( rllntwotwo.b ); + + expected = new Float64Array( rllntwotwo.expected ); + + out = dtrsm( rllntwotwo.order, rllntwotwo.side, rllntwotwo.uplo, rllntwotwo.transa, rllntwotwo.diag, rllntwotwo.m, rllntwotwo.n, rllntwotwo.alpha, A, rllntwotwo.lda, B, rllntwotwo.ldb ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( rllutwotwo.a ); + B = new Float64Array( rllutwotwo.b ); + + expected = new Float64Array( rllutwotwo.expected ); + + out = dtrsm( rllutwotwo.order, rllutwotwo.side, rllutwotwo.uplo, rllutwotwo.transa, rllutwotwo.diag, rllutwotwo.m, rllutwotwo.n, rllutwotwo.alpha, A, rllutwotwo.lda, B, rllutwotwo.ldb ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( rlunntwotwo.a ); + B = new Float64Array( rlunntwotwo.b ); + + expected = new Float64Array( rlunntwotwo.expected ); + + out = dtrsm( rlunntwotwo.order, rlunntwotwo.side, rlunntwotwo.uplo, rlunntwotwo.transa, rlunntwotwo.diag, rlunntwotwo.m, rlunntwotwo.n, rlunntwotwo.alpha, A, rlunntwotwo.lda, B, rlunntwotwo.ldb ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( rluutwotwo.a ); + B = new Float64Array( rluutwotwo.b ); + + expected = new Float64Array( rluutwotwo.expected ); + + out = dtrsm( rluutwotwo.order, rluutwotwo.side, rluutwotwo.uplo, rluutwotwo.transa, rluutwotwo.diag, rluutwotwo.m, rluutwotwo.n, rluutwotwo.alpha, A, rluutwotwo.lda, B, rluutwotwo.ldb ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( rrlunntwotwo.a ); + B = new Float64Array( rrlunntwotwo.b ); + + expected = new Float64Array( rrlunntwotwo.expected ); + + out = dtrsm( rrlunntwotwo.order, rrlunntwotwo.side, rrlunntwotwo.uplo, rrlunntwotwo.transa, rrlunntwotwo.diag, rrlunntwotwo.m, rrlunntwotwo.n, rrlunntwotwo.alpha, A, rrlunntwotwo.lda, B, rrlunntwotwo.ldb ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( rrunntwotwo.a ); + B = new Float64Array( rrunntwotwo.b ); + + expected = new Float64Array( rrunntwotwo.expected ); + + out = dtrsm( rrunntwotwo.order, rrunntwotwo.side, rrunntwotwo.uplo, rrunntwotwo.transa, rrunntwotwo.diag, rrunntwotwo.m, rrunntwotwo.n, rrunntwotwo.alpha, A, rrunntwotwo.lda, B, rrunntwotwo.ldb ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( cllnthreethree.a ); + B = new Float64Array( cllnthreethree.b ); + + expected = new Float64Array( cllnthreethree.expected ); + + out = dtrsm( cllnthreethree.order, cllnthreethree.side, cllnthreethree.uplo, cllnthreethree.transa, cllnthreethree.diag, cllnthreethree.m, cllnthreethree.n, cllnthreethree.alpha, A, cllnthreethree.lda, B, cllnthreethree.ldb ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 10.0 ); + + t.end(); +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( rllnthreethree.a ); + B = new Float64Array( rllnthreethree.b ); + + expected = new Float64Array( rllnthreethree.expected ); + + out = dtrsm( rllnthreethree.order, rllnthreethree.side, rllnthreethree.uplo, rllnthreethree.transa, rllnthreethree.diag, rllnthreethree.m, rllnthreethree.n, rllnthreethree.alpha, A, rllnthreethree.lda, B, rllnthreethree.ldb ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 10.0 ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.js new file mode 100644 index 000000000000..9e9b3fb18708 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var dtrsm = 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 dtrsm, '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 dtrsm.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 dtrsm = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dtrsm, 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 dtrsm; + var main; + + main = require( './../lib/dtrsm.js' ); + + dtrsm = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dtrsm, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js new file mode 100644 index 000000000000..6453749492b4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js @@ -0,0 +1,230 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var dtrsm = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var cndllntwotwo = require( './fixtures/column_major_ndarray_llntwotwo.json' ); + +var rndllntwotwo = require( './fixtures/row_major_ndarray_llntwotwo.json' ); + + +// FUNCTIONS // + +/** +* Tests for element-wise approximate equality. +* +* @private +* @param {Object} t - test object +* @param {Collection} actual - actual values +* @param {Collection} expected - expected values +* @param {number} rtol - relative tolerance +*/ +function isApprox( t, actual, expected, rtol ) { + var delta; + var tol; + var i; + + t.strictEqual( actual.length, expected.length, 'returns expected value' ); + for ( i = 0; i < expected.length; i++ ) { + if ( actual[ i ] === expected[ i ] ) { + t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' ); + } else { + delta = abs( actual[ i ] - expected[ i ] ); + tol = rtol * EPS * abs( expected[ i ] ); + t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' ); + } + } +} + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dtrsm, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 14', function test( t ) { + t.strictEqual( dtrsm.length, 14, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dtrsm( value, cndllntwotwo.side, cndllntwotwo.uplo, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), cndllntwotwo.ldb, cndllntwotwo.offsetB ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dtrsm( cndllntwotwo.order, value, cndllntwotwo.uplo, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), cndllntwotwo.ldb, cndllntwotwo.offsetB ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dtrsm( cndllntwotwo.order, cndllntwotwo.side, value, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), cndllntwotwo.ldb, cndllntwotwo.offsetB ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourth argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dtrsm( cndllntwotwo.order, cndllntwotwo.side, cndllntwotwo.uplo, value, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), cndllntwotwo.ldb, cndllntwotwo.offsetB ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dtrsm( cndllntwotwo.order, cndllntwotwo.side, cndllntwotwo.uplo, cndllntwotwo.transa, value, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), cndllntwotwo.ldb, cndllntwotwo.offsetB ); + }; + } +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( cndllntwotwo.a ); + B = new Float64Array( cndllntwotwo.b ); + + expected = new Float64Array( cndllntwotwo.expected ); + + out = dtrsm( cndllntwotwo.order, cndllntwotwo.side, cndllntwotwo.uplo, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, A, cndllntwotwo.lda, cndllntwotwo.offsetA, B, cndllntwotwo.ldb, cndllntwotwo.offsetB ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( rndllntwotwo.a ); + B = new Float64Array( rndllntwotwo.b ); + + expected = new Float64Array( rndllntwotwo.expected ); + + out = dtrsm( rndllntwotwo.order, rndllntwotwo.side, rndllntwotwo.uplo, rndllntwotwo.transa, rndllntwotwo.diag, rndllntwotwo.m, rndllntwotwo.n, rndllntwotwo.alpha, A, rndllntwotwo.lda, rndllntwotwo.offsetA, B, rndllntwotwo.ldb, rndllntwotwo.offsetB ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); From 9ad1e43144c96e1f7ce9b2334047ff9c74edaad3 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Mon, 8 Jul 2024 14:07:08 +0530 Subject: [PATCH 13/33] enh: files in lib/ --- lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js | 8 +++++++- lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js | 10 ++++++++-- .../@stdlib/blas/base/dtrsm/lib/ndarray.js | 10 ++++++++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js index 5a80ad54ea76..0e6bc102acec 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js @@ -41,7 +41,13 @@ * @returns {Float64Array} matrix `B` * * @example -* TODO: +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +* var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); +* +* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); +* // B => [ 30.0, 6.0, 0.0, 12.0 ] */ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ) { // eslint-disable-line max-len var nounit; diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js index 13277a572503..a54aa48d7a96 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js @@ -55,11 +55,17 @@ var base = require( './base.js' ); * @returns {Float64Array} matrix `B` * * @example -* TODO: +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +* var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); +* +* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +* // B => [ 30.0, 6.0, 0.0, 12.0 ] */ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) { if ( !isLayout( order ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', orderA ) ); + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } if ( !isOperationSide( side ) ) { throw new TypeError( format( 'invalid argument. Second argument must be a valid side. Value: `%s`.', side ) ); diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js index c60a14e022f8..62fd070eec71 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js @@ -56,11 +56,17 @@ var base = require( './base.js' ); * @returns {Float64Array} matrix `B` * * @example -* TODO: +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); +* var B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); +* +* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 2, B, 2, 1 ); +* // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] */ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ) { // eslint-disable-line max-len if ( !isLayout( order ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', orderA ) ); + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } if ( !isOperationSide( side ) ) { throw new TypeError( format( 'invalid argument. Second argument must be a valid side. Value: `%s`.', side ) ); From 851ed8044036c8ff14b76ee170012f71094e4815 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Mon, 8 Jul 2024 14:39:57 +0530 Subject: [PATCH 14/33] fix: incorrect description of ndarray api in readme --- lib/node_modules/@stdlib/blas/base/dtrsm/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md index 0e41359805ec..d52a3e47ef0b 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md @@ -89,9 +89,9 @@ console.log( out ); // B0 => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] ``` -#### dtrsm.ndarray( ord, sid, ul, ta, diag, m, n, alp, A, LDA, oa, B, LDB, ob ) +#### dtrsm.ndarray( ord, side, ul, ta, diag, m, n, α, A, LDA, oa, B, LDB, ob ) -Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` using alternative indexing semantics where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. ```javascript var Float64Array = require( '@stdlib/array/float64' ); From 93204fd3a96b57a651dae454a0a52f3dcfc596ed Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Tue, 9 Jul 2024 10:29:44 +0530 Subject: [PATCH 15/33] refactor: base implementation --- .../@stdlib/blas/base/dtrsm/lib/base.js | 251 +++--------------- 1 file changed, 38 insertions(+), 213 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js index 0e6bc102acec..b15e364e2bb5 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js @@ -49,7 +49,7 @@ * dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); * // B => [ 30.0, 6.0, 0.0, 12.0 ] */ -function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ) { // eslint-disable-line max-len +function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ) { // eslint-disable-line max-len, max-params var nounit; var lside; var upper; @@ -65,15 +65,12 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( m === 0 || n === 0 ) { return B; } + if ( order === 'row-major' ) { + lside = !lside; + upper = !upper; + order = 'column-major'; + } if ( alpha === 0.0 ) { - if ( order === 'row-major' ) { - for ( j = 0; j < n; j++ ) { - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + j ] = 0.0; - } - } - return B; - } for ( j = 0; j < n; j++ ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( j * LDB ) + i ] = 0.0; @@ -85,60 +82,18 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( transa === 'none' ) { // B := alpha * inv( A ) * B if ( upper ) { - if ( order === 'column-major' ) { - for ( j = 0; j < n; j++ ) { - if ( alpha !== 1.0 ) { - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] *= alpha; - } - } - for ( k = m - 1; k >= 0; k-- ) { - if ( B[ offsetB + ( j * LDB ) + k ] !== 0 ) { - if ( nounit ) { - B[ offsetB + ( j * LDB ) + k ] /= A[ offsetA + ( k * LDA ) + k ]; - } - for ( i = 0; i < k; i++ ) { - B[ offsetB + ( j * LDB ) + i ] -= B[ offsetB + ( j * LDB ) + k ] * A[ offsetA + ( k * LDA ) + i ]; - } - } - } - } - return B; - } - // order === "row-major" - for ( j = 0; j < n; j++ ) { - if ( alpha !== 1.0 ) { - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + j ] *= alpha; - } - } - for ( k = m - 1; k >= 0; k-- ) { - if ( B[ offsetB + ( k * LDB ) + j ] !== 0 ) { - if ( nounit ) { - B[ offsetB + ( k * LDB ) + j ] /= A[ offsetA + ( k * LDA ) + k ]; - } - for ( i = 0; i < k; i++ ) { - B[ offsetB + ( i * LDB ) + j ] -= B[ offsetB + ( k * LDB ) + j ] * A[ offsetA + ( i * LDA ) + k ]; - } - } - } - } - return B; - } - // lower - if ( order === 'column-major' ) { for ( j = 0; j < n; j++ ) { if ( alpha !== 1.0 ) { - for ( i = 0; i < m; i++ ) { + for ( i = 0; i < m; i++ ) { // eslint-disable-line max-depth B[ offsetB + ( j * LDB ) + i ] *= alpha; } } - for ( k = 0; k < m; k++ ) { - if ( B[ offsetB + ( j * LDB ) + k ] !== 0 ) { - if ( nounit ) { + for ( k = m - 1; k >= 0; k-- ) { + if ( B[ offsetB + ( j * LDB ) + k ] !== 0 ) { // eslint-disable-line max-depth + if ( nounit ) { // eslint-disable-line max-depth B[ offsetB + ( j * LDB ) + k ] /= A[ offsetA + ( k * LDA ) + k ]; } - for ( i = k + 1; i < m; i++ ) { + for ( i = 0; i < k; i++ ) { // eslint-disable-line max-depth B[ offsetB + ( j * LDB ) + i ] -= B[ offsetB + ( j * LDB ) + k ] * A[ offsetA + ( k * LDA ) + i ]; } } @@ -146,20 +101,20 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } return B; } - // order === "row-major" + // lower for ( j = 0; j < n; j++ ) { if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + j ] *= alpha; + B[ offsetB + ( j * LDB ) + i ] *= alpha; } } for ( k = 0; k < m; k++ ) { - if ( B[ offsetB + ( k * LDB ) + j ] !== 0 ) { - if ( nounit ) { - B[ offsetB + ( k * LDB ) + j ] /= A[ offsetA + ( k * LDA ) + k ]; + if ( B[ offsetB + ( j * LDB ) + k ] !== 0 ) { + if ( nounit ) { // eslint-disable-line max-depth + B[ offsetB + ( j * LDB ) + k ] /= A[ offsetA + ( k * LDA ) + k ]; } - for ( i = k + 1; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + j ] -= B[ offsetB + ( k * LDB ) + j ] * A[ offsetA + ( i * LDA ) + k ]; + for ( i = k + 1; i < m; i++ ) { // eslint-disable-line max-depth + B[ offsetB + ( j * LDB ) + i ] -= B[ offsetB + ( j * LDB ) + k ] * A[ offsetA + ( k * LDA ) + i ]; } } } @@ -168,42 +123,10 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } // B := alpha * inv( A**T ) * B if ( upper ) { - if ( order === 'column-major' ) { - for ( j = 0; j < n; j++ ) { - for ( i = 0; i < m; i++ ) { - tmp = alpha * B[ offsetB + ( j * LDB ) + i ]; - for ( k = 0; k <= i - 1; k++ ) { - tmp -= A[ offsetA + ( i * LDA ) + k ] * B[ offsetB + ( j * LDB ) + k ]; - } - if ( nounit ) { - tmp /= A[ offsetA + ( i * LDA ) + i ]; - } - B[ offsetB + ( j * LDB ) + i ] = tmp; - } - } - return B; - } - // order === "row-major" for ( j = 0; j < n; j++ ) { for ( i = 0; i < m; i++ ) { - tmp = alpha * B[ offsetB + ( i * LDB ) + j ]; - for ( k = 0; k <= i - 1; k++ ) { - tmp -= A[ offsetA + ( k * LDA ) + i ] * B[ offsetB + ( k * LDB ) + j ]; - } - if ( nounit ) { - tmp /= A[ offsetA + ( i * LDA ) + i ]; - } - B[ offsetB + ( i * LDB ) + j ] = tmp; - } - } - return B; - } - // lower - if ( order === 'column-major' ) { - for ( j = 0; j < n; j++ ) { - for ( i = m - 1; i >= 0; i-- ) { tmp = alpha * B[ offsetB + ( j * LDB ) + i ]; - for ( k = i + 1; k < m; k++ ) { + for ( k = 0; k <= i - 1; k++ ) { tmp -= A[ offsetA + ( i * LDA ) + k ] * B[ offsetB + ( j * LDB ) + k ]; } if ( nounit ) { @@ -214,17 +137,17 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } return B; } - // order === "row-major" + // lower for ( j = 0; j < n; j++ ) { for ( i = m - 1; i >= 0; i-- ) { - tmp = alpha * B[ offsetB + ( i * LDB ) + j ]; + tmp = alpha * B[ offsetB + ( j * LDB ) + i ]; for ( k = i + 1; k < m; k++ ) { - tmp -= A[ offsetA + ( k * LDA ) + i ] * B[ offsetB + ( k * LDB ) + j ]; + tmp -= A[ offsetA + ( i * LDA ) + k ] * B[ offsetB + ( j * LDB ) + k ]; } if ( nounit ) { tmp /= A[ offsetA + ( i * LDA ) + i ]; } - B[ offsetB + ( i * LDB ) + j ] = tmp; + B[ offsetB + ( j * LDB ) + i ] = tmp; } } return B; @@ -233,63 +156,15 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( transa === 'none' ) { // B := alpha * B * inv( A ) if ( upper ) { - if ( order === 'column-major' ) { - for ( j = 0; j < n; j++ ) { - if ( alpha !== 1.0 ) { - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] *= alpha; - } - } - for ( k = 0; k <= j - 1; k++ ) { - if ( A[ offsetA + ( j * LDA ) + k ] !== 0.0 ) { - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] -= A[ offsetA + ( j * LDA ) + k ] * B[ offsetB + ( k * LDB ) + i ]; - } - } - } - if ( nounit ) { - tmp = 1.0 / A[ offsetA + ( j * LDA ) + j ]; - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] *= tmp; - } - } - } - return B; - } - // order === "row-major" for ( j = 0; j < n; j++ ) { - if ( alpha !== 1.0 ) { - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + j ] *= alpha; - } - } - for ( k = 0; k <= j - 1; k++ ) { - if ( A[ offsetA + ( k * LDA ) + j ] !== 0.0 ) { - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + j ] -= A[ offsetA + ( k * LDA ) + j ] * B[ offsetB + ( i * LDB ) + k ]; - } - } - } - if ( nounit ) { - tmp = 1.0 / A[ offsetA + ( j * LDA ) + j ]; - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + j ] *= tmp; - } - } - } - return B; - } - // lower - if ( order === 'column-major' ) { - for ( j = n - 1; j >= 0; j-- ) { if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { B[ offsetB + ( j * LDB ) + i ] *= alpha; } } - for ( k = j + 1; k < n; k++ ) { - if ( A[ offsetA + ( j * LDA ) + k ] !== 0 ) { - for ( i = 0; i < m; i++ ) { + for ( k = 0; k <= j - 1; k++ ) { + if ( A[ offsetA + ( j * LDA ) + k ] !== 0.0 ) { + for ( i = 0; i < m; i++ ) { // eslint-disable-line max-depth B[ offsetB + ( j * LDB ) + i ] -= A[ offsetA + ( j * LDA ) + k ] * B[ offsetB + ( k * LDB ) + i ]; } } @@ -303,24 +178,24 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } return B; } - // order === "row-major" + // lower for ( j = n - 1; j >= 0; j-- ) { if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + j ] *= alpha; + B[ offsetB + ( j * LDB ) + i ] *= alpha; } } for ( k = j + 1; k < n; k++ ) { - if ( A[ offsetA + ( k * LDA ) + j ] !== 0 ) { + if ( A[ offsetA + ( j * LDA ) + k ] !== 0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + j ] -= A[ offsetA + ( k * LDA ) + j ] * B[ offsetB + ( i * LDB ) + k ]; + B[ offsetB + ( j * LDB ) + i ] -= A[ offsetA + ( j * LDA ) + k ] * B[ offsetB + ( k * LDB ) + i ]; } } } if ( nounit ) { tmp = 1.0 / A[ offsetA + ( j * LDA ) + j ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + j ] *= tmp; + B[ offsetB + ( j * LDB ) + i ] *= tmp; } } } @@ -328,64 +203,14 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } // B := alpha * B * inv( A**T ) if ( upper ) { - if ( order === 'column-major' ) { - for ( k = n - 1; k >= 0; k-- ) { - if ( nounit ) { - tmp = 1.0 / A[ offsetA + ( k * LDA ) + k ]; - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( k * LDB ) + i ] *= tmp; - } - } - for ( j = 0; j <= k - 1; j++ ) { - if ( A[ offsetA + ( k * LDA ) + j ] !== 0 ) { - tmp = A[ offsetA + ( k * LDA ) + j ]; - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] -= tmp * B[ offsetB + ( k * LDB ) + i ]; - } - } - } - if ( alpha !== 1.0 ) { - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( k * LDB ) + i ] *= alpha; - } - } - } - return B; - } - // order === "row-major" for ( k = n - 1; k >= 0; k-- ) { - if ( nounit ) { - tmp = 1.0 / A[ offsetA + ( k * LDA ) + k ]; - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + k ] *= tmp; - } - } - for ( j = 0; j <= k - 1; j++ ) { - if ( A[ offsetA + ( j * LDA ) + k ] !== 0 ) { - tmp = A[ offsetA + ( j * LDA ) + k ]; - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + j ] -= tmp * B[ offsetB + ( i * LDB ) + k ]; - } - } - } - if ( alpha !== 1.0 ) { - for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + k ] *= alpha; - } - } - } - return B; - } - // lower - if ( order === 'column-major' ) { - for ( k = 0; k < n; k++ ) { if ( nounit ) { tmp = 1.0 / A[ offsetA + ( k * LDA ) + k ]; for ( i = 0; i < m; i++ ) { B[ offsetB + ( k * LDB ) + i ] *= tmp; } } - for ( j = k + 1; j < n; j++ ) { + for ( j = 0; j <= k - 1; j++ ) { if ( A[ offsetA + ( k * LDA ) + j ] !== 0 ) { tmp = A[ offsetA + ( k * LDA ) + j ]; for ( i = 0; i < m; i++ ) { @@ -401,25 +226,25 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } return B; } - // order === "row-major" + // lower for ( k = 0; k < n; k++ ) { if ( nounit ) { tmp = 1.0 / A[ offsetA + ( k * LDA ) + k ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + k ] *= tmp; + B[ offsetB + ( k * LDB ) + i ] *= tmp; } } for ( j = k + 1; j < n; j++ ) { - if ( A[ offsetA + ( j * LDA ) + k ] !== 0 ) { - tmp = A[ offsetA + ( j * LDA ) + k ]; + if ( A[ offsetA + ( k * LDA ) + j ] !== 0 ) { + tmp = A[ offsetA + ( k * LDA ) + j ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + j ] -= tmp * B[ offsetB + ( i * LDB ) + k ]; + B[ offsetB + ( j * LDB ) + i ] -= tmp * B[ offsetB + ( k * LDB ) + i ]; } } } if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( i * LDB ) + k ] *= alpha; + B[ offsetB + ( k * LDB ) + i ] *= alpha; } } } From 86d36cadbc6c7ccb621e2eb567b12a2f4a53e21c Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Tue, 9 Jul 2024 10:30:42 +0530 Subject: [PATCH 16/33] fix: lint warnings in base.js --- lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js index b15e364e2bb5..fb79ab2ef7da 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js @@ -101,7 +101,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } return B; } - // lower + // Lower for ( j = 0; j < n; j++ ) { if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { @@ -137,7 +137,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } return B; } - // lower + // Lower for ( j = 0; j < n; j++ ) { for ( i = m - 1; i >= 0; i-- ) { tmp = alpha * B[ offsetB + ( j * LDB ) + i ]; @@ -152,7 +152,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } return B; } - // !lside + // Right if ( transa === 'none' ) { // B := alpha * B * inv( A ) if ( upper ) { @@ -178,7 +178,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } return B; } - // lower + // Lower for ( j = n - 1; j >= 0; j-- ) { if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { @@ -226,7 +226,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } return B; } - // lower + // Lower for ( k = 0; k < n; k++ ) { if ( nounit ) { tmp = 1.0 / A[ offsetA + ( k * LDA ) + k ]; From df96605a60091e81d543d12eab294d6ad91e5312 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Tue, 9 Jul 2024 11:11:18 +0530 Subject: [PATCH 17/33] chore: apply code review --- .../@stdlib/blas/base/dtrsm/README.md | 13 +++--- .../blas/base/dtrsm/docs/types/index.d.ts | 28 ++++++------ .../@stdlib/blas/base/dtrsm/examples/index.js | 7 +++ .../@stdlib/blas/base/dtrsm/lib/base.js | 44 +++++++++---------- .../@stdlib/blas/base/dtrsm/lib/dtrsm.js | 15 +++---- .../@stdlib/blas/base/dtrsm/lib/index.js | 21 ++++++++- .../@stdlib/blas/base/dtrsm/lib/ndarray.js | 16 +++---- .../@stdlib/blas/base/dtrsm/package.json | 2 +- 8 files changed, 84 insertions(+), 62 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md index d52a3e47ef0b..6d1236eb9f2a 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md @@ -20,7 +20,7 @@ limitations under the License. # dtrsm -> Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +> Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`.
@@ -32,7 +32,7 @@ var dtrsm = require( '@stdlib/blas/base/dtrsm' ); #### dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) -Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. ```javascript var Float64Array = require( '@stdlib/array/float64' ); @@ -55,9 +55,9 @@ The function has the following parameters: - **n**: number of columns in `B`. - **alpha**: scalar constant. - **A**: input matrix `A`. -- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). - **B**: input matrix `B`. -- **LDB**: stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) +- **LDB**: stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`). ```javascript var Float64Array = require( '@stdlib/array/float64' ); @@ -84,14 +84,13 @@ var B0 = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 1st element var B1 = new Float64Array( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); // start at 1st element -out = dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A1, 2, B1, 2 ); -console.log( out ); +dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A1, 2, B1, 2 ); // B0 => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] ``` #### dtrsm.ndarray( ord, side, ul, ta, diag, m, n, α, A, LDA, oa, B, LDB, ob ) -Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` using alternative indexing semantics where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` using alternative indexing semantics where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. ```javascript var Float64Array = require( '@stdlib/array/float64' ); diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts index 1be253bf698b..cbb639a2d91c 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts @@ -27,16 +27,16 @@ import { Layout, MatrixTriangle, DiagonalType, OperationSide, TransposeOperation */ interface Routine { /** - * Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. + * Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. * - * @param order - specifies the memory layout of `A` and `B` + * @param order - storage layout of `A` and `B` * @param side - specifies whether `op( A )` appears on the left or right of `X` - * @param uplo - specifies whether the matrix `A` is an upper or lower triangular matrix + * @param uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied * @param transa - specifies the form of `op( A )` to be used in matrix multiplication * @param diag - specifies whether or not `A` is unit triangular * @param m - number of rows in `B` * @param n - number of columns in `B` - * @param alpha - scalar alpha + * @param alpha - scalar constant * @param A - input matrix `A` * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) * @param B - input matrix `B` @@ -55,22 +55,22 @@ interface Routine { ( order: Layout, side: OperationSide, uplo: MatrixTriangle, transa: TransposeOperation, diag: DiagonalType, m: number, n: number, alpha: number, A: Float64Array, LDA: number, B: Float64Array, LDB: number ): Float64Array; /** - * Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. + * Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. * - * @param order - specifies the memory layout of `A` and `B` + * @param order - storage layout of `A` and `B` * @param side - specifies whether `op( A )` appears on the left or right of `X` - * @param uplo - specifies whether the matrix `A` is an upper or lower triangular matrix + * @param uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied * @param transa - specifies the form of `op( A )` to be used in matrix multiplication * @param diag - specifies whether or not `A` is unit triangular * @param m - number of rows in `B` * @param n - number of columns in `B` - * @param alpha - scalar alpha + * @param alpha - scalar constant * @param A - input matrix `A` * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) - * @param offsetA - index offset for matrix `A` + * @param offsetA - starting `A` index * @param B - input matrix `B` * @param LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) - * @param offsetB - index offset for matrix `B` + * @param offsetB - starting `B` index * @returns `B` * * @example @@ -86,16 +86,16 @@ interface Routine { } /** -* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. * -* @param order - specifies the memory layout of `A` and `B` +* @param order - storage layout of `A` and `B` * @param side - specifies whether `op( A )` appears on the left or right of `X` -* @param uplo - specifies whether the matrix `A` is an upper or lower triangular matrix +* @param uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied * @param transa - specifies the form of `op( A )` to be used in matrix multiplication * @param diag - specifies whether or not `A` is unit triangular * @param m - number of rows in `B` * @param n - number of columns in `B` -* @param alpha - scalar alpha +* @param alpha - scalar constant * @param A - input matrix `A` * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) * @param B - input matrix `B` diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js b/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js index e31bfecd477f..44f041f69948 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js @@ -132,3 +132,10 @@ B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); out = dtrsm( 'row-major', 'right', 'lower', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); console.log( out ); // => [ 30, -22.5, 42, -19.5 ] + +A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); +B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); + +out = dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 2, B, 2, 1 ); +console.log( out ); +// => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js index b15e364e2bb5..f22449546b0f 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js @@ -21,24 +21,24 @@ // MAIN // /** -* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. * * @private -* @param {string} order - specifies the memory layout of `A` and `B` +* @param {string} order - storage layout of `A` and `B` * @param {string} side - specifies whether `op( A )` appears on the left or right of `X` -* @param {string} uplo - specifies whether the matrix `A` is an upper or lower triangular matrix +* @param {string} uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied * @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication * @param {string} diag - specifies whether or not `A` is unit triangular * @param {NonNegativeInteger} m - number of rows in `B` * @param {NonNegativeInteger} n - number of columns in `B` -* @param {number} alpha - scalar alpha +* @param {number} alpha - scalar constant * @param {Float64Array} A - input matrix `A` * @param {NonNegativeInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) -* @param {NonNegativeInteger} offsetA - index offset for matrix `A` +* @param {NonNegativeInteger} offsetA - starting `A` index * @param {Float64Array} B - input matrix `B` * @param {NonNegativeInteger} LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) -* @param {NonNegativeInteger} offsetB - index offset for matrix `B` -* @returns {Float64Array} matrix `B` +* @param {NonNegativeInteger} offsetB - starting `B` index +* @returns {Float64Array} `B` * * @example * var Float64Array = require( '@stdlib/array/float64' ); @@ -91,17 +91,17 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( k = m - 1; k >= 0; k-- ) { if ( B[ offsetB + ( j * LDB ) + k ] !== 0 ) { // eslint-disable-line max-depth if ( nounit ) { // eslint-disable-line max-depth - B[ offsetB + ( j * LDB ) + k ] /= A[ offsetA + ( k * LDA ) + k ]; + B[ offsetB + ( j * LDB ) + k ] /= A[ offsetA + ( k * LDA ) + k ]; // eslint-disable-line max-len } for ( i = 0; i < k; i++ ) { // eslint-disable-line max-depth - B[ offsetB + ( j * LDB ) + i ] -= B[ offsetB + ( j * LDB ) + k ] * A[ offsetA + ( k * LDA ) + i ]; + B[ offsetB + ( j * LDB ) + i ] -= B[ offsetB + ( j * LDB ) + k ] * A[ offsetA + ( k * LDA ) + i ]; // eslint-disable-line max-len } } } } return B; } - // lower + // Lower for ( j = 0; j < n; j++ ) { if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { @@ -111,10 +111,10 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( k = 0; k < m; k++ ) { if ( B[ offsetB + ( j * LDB ) + k ] !== 0 ) { if ( nounit ) { // eslint-disable-line max-depth - B[ offsetB + ( j * LDB ) + k ] /= A[ offsetA + ( k * LDA ) + k ]; + B[ offsetB + ( j * LDB ) + k ] /= A[ offsetA + ( k * LDA ) + k ]; // eslint-disable-line max-len } for ( i = k + 1; i < m; i++ ) { // eslint-disable-line max-depth - B[ offsetB + ( j * LDB ) + i ] -= B[ offsetB + ( j * LDB ) + k ] * A[ offsetA + ( k * LDA ) + i ]; + B[ offsetB + ( j * LDB ) + i ] -= B[ offsetB + ( j * LDB ) + k ] * A[ offsetA + ( k * LDA ) + i ]; // eslint-disable-line max-len } } } @@ -127,7 +127,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( i = 0; i < m; i++ ) { tmp = alpha * B[ offsetB + ( j * LDB ) + i ]; for ( k = 0; k <= i - 1; k++ ) { - tmp -= A[ offsetA + ( i * LDA ) + k ] * B[ offsetB + ( j * LDB ) + k ]; + tmp -= A[ offsetA + ( i * LDA ) + k ] * B[ offsetB + ( j * LDB ) + k ]; // eslint-disable-line max-len } if ( nounit ) { tmp /= A[ offsetA + ( i * LDA ) + i ]; @@ -137,12 +137,12 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } return B; } - // lower + // Lower for ( j = 0; j < n; j++ ) { for ( i = m - 1; i >= 0; i-- ) { tmp = alpha * B[ offsetB + ( j * LDB ) + i ]; for ( k = i + 1; k < m; k++ ) { - tmp -= A[ offsetA + ( i * LDA ) + k ] * B[ offsetB + ( j * LDB ) + k ]; + tmp -= A[ offsetA + ( i * LDA ) + k ] * B[ offsetB + ( j * LDB ) + k ]; // eslint-disable-line max-len } if ( nounit ) { tmp /= A[ offsetA + ( i * LDA ) + i ]; @@ -152,7 +152,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } return B; } - // !lside + // Right if ( transa === 'none' ) { // B := alpha * B * inv( A ) if ( upper ) { @@ -165,7 +165,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( k = 0; k <= j - 1; k++ ) { if ( A[ offsetA + ( j * LDA ) + k ] !== 0.0 ) { for ( i = 0; i < m; i++ ) { // eslint-disable-line max-depth - B[ offsetB + ( j * LDB ) + i ] -= A[ offsetA + ( j * LDA ) + k ] * B[ offsetB + ( k * LDB ) + i ]; + B[ offsetB + ( j * LDB ) + i ] -= A[ offsetA + ( j * LDA ) + k ] * B[ offsetB + ( k * LDB ) + i ]; // eslint-disable-line max-len } } } @@ -178,7 +178,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } return B; } - // lower + // Lower for ( j = n - 1; j >= 0; j-- ) { if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { @@ -188,7 +188,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( k = j + 1; k < n; k++ ) { if ( A[ offsetA + ( j * LDA ) + k ] !== 0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] -= A[ offsetA + ( j * LDA ) + k ] * B[ offsetB + ( k * LDB ) + i ]; + B[ offsetB + ( j * LDB ) + i ] -= A[ offsetA + ( j * LDA ) + k ] * B[ offsetB + ( k * LDB ) + i ]; // eslint-disable-line max-len } } } @@ -214,7 +214,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( A[ offsetA + ( k * LDA ) + j ] !== 0 ) { tmp = A[ offsetA + ( k * LDA ) + j ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] -= tmp * B[ offsetB + ( k * LDB ) + i ]; + B[ offsetB + ( j * LDB ) + i ] -= tmp * B[ offsetB + ( k * LDB ) + i ]; // eslint-disable-line max-len } } } @@ -226,7 +226,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B } return B; } - // lower + // Lower for ( k = 0; k < n; k++ ) { if ( nounit ) { tmp = 1.0 / A[ offsetA + ( k * LDA ) + k ]; @@ -238,7 +238,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( A[ offsetA + ( k * LDA ) + j ] !== 0 ) { tmp = A[ offsetA + ( k * LDA ) + j ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] -= tmp * B[ offsetB + ( k * LDB ) + i ]; + B[ offsetB + ( j * LDB ) + i ] -= tmp * B[ offsetB + ( k * LDB ) + i ]; // eslint-disable-line max-len } } } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js index a54aa48d7a96..c89aaafc111c 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js @@ -32,17 +32,16 @@ var base = require( './base.js' ); // MAIN // /** -* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or -* non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. * -* @param {string} order - specifies the memory layout of `A` and `B` +* @param {string} order - storage layout of `A` and `B` * @param {string} side - specifies whether `op( A )` appears on the left or right of `X` -* @param {string} uplo - specifies whether the matrix `A` is an upper or lower triangular matrix +* @param {string} uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied * @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication * @param {string} diag - specifies whether or not `A` is unit triangular * @param {NonNegativeInteger} m - number of rows in `B` * @param {NonNegativeInteger} n - number of columns in `B` -* @param {number} alpha - scalar alpha +* @param {number} alpha - scalar constant * @param {Float64Array} A - input matrix `A` * @param {NonNegativeInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) * @param {Float64Array} B - input matrix `B` @@ -52,7 +51,7 @@ var base = require( './base.js' ); * @throws {TypeError} third argument must specify whether the lower or upper triangular matrix is supplied * @throws {TypeError} fourth argument must specify correct transpose operation * @throws {TypeError} fifth argument must specify whether the matrix is unit triangular or not -* @returns {Float64Array} matrix `B` +* @returns {Float64Array} `B` * * @example * var Float64Array = require( '@stdlib/array/float64' ); @@ -63,7 +62,7 @@ var base = require( './base.js' ); * dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); * // B => [ 30.0, 6.0, 0.0, 12.0 ] */ -function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) { +function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) { // eslint-disable-line max-params if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } @@ -79,7 +78,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) { if ( !isDiagonalType( diag ) ) { throw new TypeError( format( 'invalid argument. Fifth argument must specify whether the matrix is unit triangular or not. Value: `%s`.', diag ) ); } - return base( order, side, uplo, transa, diag, m, n, alpha, A, LDA, 0, B, LDB, 0 ); + return base( order, side, uplo, transa, diag, m, n, alpha, A, LDA, 0, B, LDB, 0 ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js index eb6a89bf30c3..3b181106930a 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js @@ -19,12 +19,29 @@ 'use strict'; /** -* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +* Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. * * @module @stdlib/blas/base/dtrsm * * @example -* TODO +* var Float64Array = require( '@stdlib/array/float64' ); +* var dtrsm = require( '@stdlib/blas/base/dtrsm' ); +* +* var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +* var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); +* +* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +* // B => [ 30.0, 6.0, 0.0, 12.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dtrsm = require( '@stdlib/blas/base/dtrsm' ); +* +* var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); +* var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); +* +* dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); +* // B => [ 30.0, 6.0, 0.0, 12.0 ] */ // MODULES // diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js index 62fd070eec71..4d73711eb886 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js @@ -32,28 +32,28 @@ var base = require( './base.js' ); // MAIN // /** -* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. * -* @param {string} order - specifies the memory layout of `A` and `B` +* @param {string} order - storage layout of `A` and `B` * @param {string} side - specifies whether `op( A )` appears on the left or right of `X` -* @param {string} uplo - specifies whether the matrix `A` is an upper or lower triangular matrix +* @param {string} uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied * @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication * @param {string} diag - specifies whether or not `A` is unit triangular * @param {NonNegativeInteger} m - number of rows in `B` * @param {NonNegativeInteger} n - number of columns in `B` -* @param {number} alpha - scalar alpha +* @param {number} alpha - scalar constant * @param {Float64Array} A - input matrix `A` * @param {NonNegativeInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) -* @param {NonNegativeInteger} offsetA - index offset for matrix `A` +* @param {NonNegativeInteger} offsetA - starting `A` index * @param {Float64Array} B - input matrix `B` * @param {NonNegativeInteger} LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) -* @param {NonNegativeInteger} offsetB - index offset for matrix `B` +* @param {NonNegativeInteger} offsetB - starting `B` index * @throws {TypeError} first argument must be a valid order * @throws {TypeError} second argument must be a valid side * @throws {TypeError} third argument must specify whether the lower or upper triangular matrix is supplied. * @throws {TypeError} fourth argument must specify correct transpose operation * @throws {TypeError} fifth argument must specify whether the matrix is unit triangular or not -* @returns {Float64Array} matrix `B` +* @returns {Float64Array} `B` * * @example * var Float64Array = require( '@stdlib/array/float64' ); @@ -64,7 +64,7 @@ var base = require( './base.js' ); * dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 2, B, 2, 1 ); * // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] */ -function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ) { // eslint-disable-line max-len +function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ) { // eslint-disable-line max-len, max-params if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/package.json b/lib/node_modules/@stdlib/blas/base/dtrsm/package.json index 7a4bcccb6a32..afb7ba012d9a 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/package.json +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/dtrsm", "version": "0.0.0", - "description": "Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`.", + "description": "Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", From 8b7a99793c2649de216802d0d3bb45fa749a4c23 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Tue, 9 Jul 2024 11:31:03 +0530 Subject: [PATCH 18/33] fix: lint error in repl.txt part 1 --- .../@stdlib/blas/base/dtrsm/docs/repl.txt | 44 ++++++++++++++----- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt index 87ea8ab9148e..0d9d5ce18a1e 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt @@ -2,8 +2,8 @@ {{alias}}( ord, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, - or non-unit, upper or lower triangular matrix and `op( A )` is one of - `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. + or non-unit, upper or lower triangular matrix and `op( A )` is one of + `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. Indexing is relative to the first index. To introduce an offset, use typed array views. @@ -25,7 +25,8 @@ supplied. Must be either 'upper' or 'lower'. transa: string - Specifies the form of `op( A )` to be used in the matrix multiplication. + Specifies the form of `op( A )` to be used in the matrix + multiplication. diag: string Specifies whether `A` is unit triangular. Must be either 'unit' or @@ -64,7 +65,12 @@ // Standard usage: > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 3.0, 0.0, 4.0 ] ); > var B = new {{alias:@stdlib/array/float64}}( [ 5.0, 7.0, 0.0, 8.0 ] ); - > {{alias}}( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ) + > var ord = 'row-major'; + > var sd = 'left'; + > var ul = 'upper'; + > var ta = 'none'; + > var dg = 'non-unit'; + > {{alias}}( ord, sd, ul, ta, dg, 2, 2, 6.0, A, 2, B, 2 ) [ 30.0, 6.0, 0.0, 12.0 ] // Using typed array views: @@ -72,7 +78,12 @@ > var B0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); > var A1 = new {{alias:@stdlib/array/float64}}( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); > var B1 = new {{alias:@stdlib/array/float64}}( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); - > {{alias}}( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A1, 2, B1, 2 ); + > var ord = 'row-major'; + > var sd = 'left'; + > var ul = 'upper'; + > var ta = 'none'; + > var dg = 'non-unit'; + > {{alias}}( ord, sd, ul, ta, dg, 2, 2, 6.0, A1, 2, B1, 2 ); > B0 [ 0.0, 30.0, 6.0, 0.0, 12.0 ] @@ -80,9 +91,9 @@ {{alias}}.ndarray( ord, side, ul, ta, diag, m, n, α, A, LDA, oa, B, LDB, ob ) Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` using alternative indexing semantics where `alpha` is a scalar, `X` and - `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower - triangular matrix and `op( A )` is one of `op( A) = A` or - `op( A ) = A**T`. The matrix `X` is overwritten on `B`. + `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower + triangular matrix and `op( A )` is one of `op( A ) = A` or + `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. While typed array views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting @@ -103,7 +114,8 @@ supplied. Must be either 'upper' or 'lower'. ta: string - Specifies the form of `op( A )` to be used in the matrix multiplication. + Specifies the form of `op( A )` to be used in the matrix + multiplication. diag: string Specifies whether `A` is unit triangular. Must be either 'unit' or @@ -148,13 +160,23 @@ // Standard usage: > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 3.0, 0.0, 4.0 ] ); > var B = new {{alias:@stdlib/array/float64}}( [ 5.0, 7.0, 0.0, 8.0 ] ); - > {{alias}}.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ) + > var ord = 'row-major'; + > var sd = 'left'; + > var ul = 'upper'; + > var ta = 'none'; + > var dg = 'non-unit'; + > {{alias}}.ndarray( ord, sd, ul, ta, dg, 2, 2, 6.0, A, 2, 0, B, 2, 0 ) [ 30.0, 6.0, 0.0, 12.0 ] // Advanced indexing: > var A = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); > var B = new {{alias:@stdlib/array/float64}}( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); - > {{alias}}.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 2, B, 2, 1 ) + > var ord = 'row-major'; + > var sd = 'left'; + > var ul = 'upper'; + > var ta = 'none'; + > var dg = 'non-unit'; + > {{alias}}.ndarray( ord, sd, ul, ta, dg, 2, 2, 6.0, A, 2, 2, B, 2, 1 ) [ 0.0, 30.0, 6.0, 0.0, 12.0 ] See Also From 6ceef427eea8a7973a164749aa13ca389fdf0e5a Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Wed, 24 Jul 2024 19:03:18 +0530 Subject: [PATCH 19/33] refactor: base implementation and consequent changes --- .../@stdlib/blas/base/dtrsm/README.md | 14 +- .../base/dtrsm/benchmark/benchmark.ndarray.js | 2 +- .../blas/base/dtrsm/docs/types/index.d.ts | 28 +- .../blas/base/dtrsm/docs/types/test.ts | 314 +++++++++++------- .../@stdlib/blas/base/dtrsm/examples/index.js | 112 ------- .../@stdlib/blas/base/dtrsm/lib/base.js | 104 +++--- .../@stdlib/blas/base/dtrsm/lib/dtrsm.js | 17 +- .../@stdlib/blas/base/dtrsm/lib/index.js | 12 +- .../@stdlib/blas/base/dtrsm/lib/ndarray.js | 16 +- .../fixtures/row_major_ndarray_llntwotwo.json | 6 +- .../blas/base/dtrsm/test/test.dtrsm.js | 28 +- .../blas/base/dtrsm/test/test.ndarray.js | 22 +- 12 files changed, 328 insertions(+), 347 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md index 6d1236eb9f2a..adf0370ce56d 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md @@ -81,14 +81,14 @@ var A0 = new Float64Array( [ 0.0, 1.0, 3.0, 0.0, 4.0 ] ); var B0 = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); // Create offset views... -var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 1st element -var B1 = new Float64Array( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); // start at 1st element +var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var B1 = new Float64Array( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A1, 2, B1, 2 ); // B0 => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] ``` -#### dtrsm.ndarray( ord, side, ul, ta, diag, m, n, α, A, LDA, oa, B, LDB, ob ) +#### dtrsm.ndarray( o, s, ul, t, d, m, n, α, A, sa1, sa2, oa, B, sb1, sb2, ob ) Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` using alternative indexing semantics where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. @@ -98,13 +98,17 @@ var Float64Array = require( '@stdlib/array/float64' ); A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); -dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 2, B, 2, 1 ); +dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] ``` The function has the following additional parameters: +- **sa1**: stride of the first dimension of `A`. +- **sa2**: stride of the second dimension of `A`. - **oa**: starting index for `A`. +- **sb1**: stride of the first dimension of `B`. +- **sb2**: stride of the second dimension of `B`. - **ob**: starting index for `B`. 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, @@ -115,7 +119,7 @@ var Float64Array = require( '@stdlib/array/float64' ); A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); -dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 2, B, 2, 1 ); +dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] ``` diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js index a300270c8195..b34804626974 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js @@ -62,7 +62,7 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - z = dtrsm( 'column-major', 'left', 'upper', 'none', 'non-unit', N, N, 1.0, A, N, 0, B, N, 0 ); + z = dtrsm( 'column-major', 'left', 'upper', 'none', 'non-unit', N, N, 1.0, A, 1, N, 0, B, 1, N, 0 ); if ( isnan( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts index cbb639a2d91c..a56c0b038cbf 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts @@ -66,23 +66,25 @@ interface Routine { * @param n - number of columns in `B` * @param alpha - scalar constant * @param A - input matrix `A` - * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) - * @param offsetA - starting `A` index + * @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 B - input matrix `B` - * @param LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) - * @param offsetB - starting `B` index + * @param strideB1 - stride of the first dimension of `B` + * @param strideB2 - stride of the second dimension of `B` + * @param offsetB - starting index for `B` * @returns `B` * * @example * var Float64Array = require( '@stdlib/array/float64' ); * - * var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); - * var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + * var A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); + * var B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); * - * dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); - * // B => [ 30.0, 6.0, 0.0, 12.0 ] + * dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); + * // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] */ - ndarray( order: Layout, side: OperationSide, uplo: MatrixTriangle, transa: TransposeOperation, diag: DiagonalType, m: number, n: number, alpha: number, A: Float64Array, LDA: number, offsetA: number, B: Float64Array, LDB: number, offsetB: number ): Float64Array; + ndarray( order: Layout, side: OperationSide, uplo: MatrixTriangle, transa: TransposeOperation, diag: DiagonalType, m: number, n: number, alpha: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number, B: Float64Array, strideB1: number, strideB2: number, offsetB: number ): Float64Array; } /** @@ -114,11 +116,11 @@ interface Routine { * @example * var Float64Array = require( '@stdlib/array/float64' ); * -* var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); -* var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); +* var A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); +* var B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); -* // B => [ 30.0, 6.0, 0.0, 12.0 ] +* dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); +* // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] */ declare var dtrsm: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts index fea44907f46d..51cdd79fbf4e 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts @@ -34,10 +34,11 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 10, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 5, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( true, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( false, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( null, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( void 0, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( [], 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( {}, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( ( x: number ): number => x, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError @@ -48,10 +49,11 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 10, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 5, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', true, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', false, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', null, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', void 0, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', [], 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', {}, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', ( x: number ): number => x, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError @@ -62,10 +64,11 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 10, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 5, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', true, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', false, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', null, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', void 0, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', [], 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', {}, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', ( x: number ): number => x, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError @@ -76,10 +79,11 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 10, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 5, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', true, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', false, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', null, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', void 0, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', [], 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', {}, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', ( x: number ): number => x, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError @@ -90,10 +94,11 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 10, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 5, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', true, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', false, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', null, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', void 0, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', [], 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', {}, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', ( x: number ): number => x, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError @@ -104,10 +109,11 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', '2', 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', '5', 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', true, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', false, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', null, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', void 0, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', [], 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', {}, 2, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', ( x: number ): number => x, 2, 6.0, A, 2, B, 2 ); // $ExpectError @@ -118,10 +124,11 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, '2', 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, '5', 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, true, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, false, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, null, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, void 0, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, [], 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, {}, 6.0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, ( x: number ): number => x, 6.0, A, 2, B, 2 ); // $ExpectError @@ -132,10 +139,11 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, '6.0', A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, '5', A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, true, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, false, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, null, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, void 0, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, [], A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, {}, A, 2, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, ( x: number ): number => x, A, 2, B, 2 ); // $ExpectError @@ -145,13 +153,15 @@ import dtrsm = require( './index' ); { const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, true, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, false, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, null, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, [], B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, {}, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, ( x: number ): number => x, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, '5', 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, 5, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, true, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, false, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, null, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, void 0, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, [], 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, {}, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, ( x: number ): number => x, 2, B, 2 ); // $ExpectError } // The compiler throws an error if the function is provided a tenth argument which is not a number... @@ -159,10 +169,11 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, '2', B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, '5', B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, true, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, false, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, null, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, void 0, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, [], B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, {}, B, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, ( x: number ): number => x, B, 2 ); // $ExpectError @@ -172,10 +183,12 @@ import dtrsm = require( './index' ); { const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 2, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, '5', 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 5, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, true, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, false, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, null, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, void 0, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, [], 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, {}, 2 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, ( x: number ): number => x, 2 ); // $ExpectError @@ -186,10 +199,11 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, '2' ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, '5' ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, true ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, false ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, null ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, void 0 ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, [] ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, {} ); // $ExpectError dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, ( x: number ): number => x ); // $ExpectError @@ -220,7 +234,7 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectType Float64Array + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectType Float64Array } // The compiler throws an error if the function is provided a first argument which is not a string... @@ -228,13 +242,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 10, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( true, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( false, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( null, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( [], 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( {}, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( ( x: number ): number => x, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 5, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( true, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( false, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( null, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( void 0, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( [], 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( {}, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( ( x: number ): number => x, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a string... @@ -242,13 +257,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 10, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', true, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', false, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', null, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', [], 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', {}, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', ( x: number ): number => x, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 5, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', true, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', false, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', null, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', void 0, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', [], 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', {}, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', ( x: number ): number => x, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a third argument which is not a string... @@ -256,13 +272,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 10, 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', true, 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', false, 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', null, 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', [], 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', {}, 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', ( x: number ): number => x, 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 5, 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', true, 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', false, 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', null, 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', void 0, 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', [], 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', {}, 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', ( x: number ): number => x, 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a fourth argument which is not a string... @@ -270,13 +287,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 10, 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', true, 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', false, 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', null, 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', [], 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', {}, 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', ( x: number ): number => x, 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 5, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', true, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', false, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', null, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', void 0, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', [], 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', {}, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', ( x: number ): number => x, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a fifth argument which is not a string... @@ -284,13 +302,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 10, 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', true, 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', false, 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', null, 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', [], 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', {}, 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', ( x: number ): number => x, 2, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 5, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', true, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', false, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', null, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', void 0, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', [], 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', {}, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', ( x: number ): number => x, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a sixth argument which is not a number... @@ -298,13 +317,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', '2', 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', true, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', false, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', null, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', [], 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', {}, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', ( x: number ): number => x, 2, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', '5', 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', true, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', false, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', null, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', void 0, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', [], 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', {}, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', ( x: number ): number => x, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a seventh argument which is not a number... @@ -312,13 +332,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, '2', 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, true, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, false, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, null, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, [], 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, {}, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, ( x: number ): number => x, 6.0, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, '5', 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, true, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, false, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, null, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, void 0, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, [], 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, {}, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, ( x: number ): number => x, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided an eighth argument which is not a number... @@ -326,26 +347,29 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, '6.0', A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, true, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, false, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, null, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, [], A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, {}, A, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, ( x: number ): number => x, A, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, '5', A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, true, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, false, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, null, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, void 0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, [], A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, {}, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, ( x: number ): number => x, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a ninth argument which is not a Float64Array... { const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, 2, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, true, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, false, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, null, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, [], 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, {}, 2, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, ( x: number ): number => x, 2, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, '5', 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, 5, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, true, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, false, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, null, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, void 0, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, [], 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, {}, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, ( x: number ): number => x, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a tenth argument which is not a number... @@ -353,54 +377,59 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, '2', 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, true, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, false, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, null, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, [], 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, {}, 0, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, ( x: number ): number => x, 0, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, '5', 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, true, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, false, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, null, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, void 0, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, [], 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, {}, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, ( x: number ): number => x, 1, 0, B, 2, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a eleventh argument which is not a number... +// The compiler throws an error if the function is provided an eleventh argument which is not a number... { const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, '2', B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, true, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, false, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, null, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, [], B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, {}, B, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, ( x: number ): number => x, B, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, '5', 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, true, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, false, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, null, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, void 0, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, [], 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, {}, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, ( x: number ): number => x, 0, B, 2, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a twelfth argument which is not a Float64Array... +// The compiler throws an error if the function is provided a twelfth argument which is not a number... { const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, 2, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, true, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, false, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, null, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, [], 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, {}, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, ( x: number ): number => x, 2, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, '5', B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, true, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, false, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, null, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, void 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, [], B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, {}, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, ( x: number ): number => x, B, 2, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a thirteenth argument which is not a number... +// The compiler throws an error if the function is provided a thirteenth argument which is not a Float64Array... { const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); - const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, '2', 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, true, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, false, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, null, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, [], 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, {}, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, ( x: number ): number => x, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, '5', 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, 5, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, true, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, false, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, null, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, void 0, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, [], 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, {}, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, ( x: number ): number => x, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a fourteenth argument which is not a number... @@ -408,16 +437,47 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, '2' ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, true ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, false ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, null ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, [] ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, {} ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, ( x: number ): number => x ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, '5', 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, true, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, false, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, null, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, void 0, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, [], 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, {}, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, ( x: number ): number => x, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided an unsupported number of arguments... +// The compiler throws an error if the function is provided a fifteenth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, '5', 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, true, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, false, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, null, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, void 0, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, [], 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, {}, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixteenth argument which is not a number... +{ + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); + + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, '5' ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, true ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, false ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, null ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, void 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, [] ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, {} ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, ( 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, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); @@ -433,8 +493,10 @@ import dtrsm = require( './index' ); dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0 ); // $ExpectError dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A ); // $ExpectError dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0, 10 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0, 10 ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js b/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js index 44f041f69948..da5ee7fb7c83 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js @@ -27,115 +27,3 @@ var B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); var out = dtrsm( 'column-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); console.log( out ); // => [ 30.0, 0.0, 6.0, 12.0 ] - -A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - -out = dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ 30.0, 6.0, 0.0, 12.0 ] - -A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - -out = dtrsm( 'column-major', 'left', 'lower', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ 30.0, -12.0, 0.0, 12.0 ] - -A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); - -out = dtrsm( 'row-major', 'left', 'lower', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ 30.0, 0.0, -12.0, 12.0 ] - -A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); - -out = dtrsm( 'column-major', 'left', 'upper', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ 30.0, -22.5, 42, -19.5 ] - -A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - -out = dtrsm( 'row-major', 'left', 'upper', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ 30.0, 42.0, -22.5, -19.5 ] - -A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - -out = dtrsm( 'column-major', 'left', 'lower', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ -1.5, 10.5, -36, 12 ] - -A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); - -out = dtrsm( 'row-major', 'left', 'lower', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ -1.5, -36, 10.5, 12 ] - -A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); - -out = dtrsm( 'column-major', 'right', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ 30, 0, -12, 12 ] - -A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - -out = dtrsm( 'row-major', 'right', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ 30, -12, 0, 12 ] - -A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - -out = dtrsm( 'column-major', 'right', 'lower', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ 30, 6, 0, 12 ] - -A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); - -out = dtrsm( 'row-major', 'right', 'lower', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ 30, 0, 6, 12 ] - -A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); - -out = dtrsm( 'column-major', 'right', 'upper', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ -1.5, -36, 10.5, 12 ] - -A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - -out = dtrsm( 'row-major', 'right', 'upper', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ -1.5, 10.5, -36, 12 ] - -A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - -out = dtrsm( 'column-major', 'right', 'lower', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ 30, 42, -22.5, -19.5 ] - -A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); - -out = dtrsm( 'row-major', 'right', 'lower', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -console.log( out ); -// => [ 30, -22.5, 42, -19.5 ] - -A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); -B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); - -out = dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 2, B, 2, 1 ); -console.log( out ); -// => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js index f22449546b0f..1e5a4627e9d4 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js @@ -16,6 +16,8 @@ * limitations under the License. */ +/* eslint-disable max-len, max-statements */ + 'use strict'; // MAIN // @@ -33,11 +35,13 @@ * @param {NonNegativeInteger} n - number of columns in `B` * @param {number} alpha - scalar constant * @param {Float64Array} A - input matrix `A` -* @param {NonNegativeInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) -* @param {NonNegativeInteger} offsetA - starting `A` index +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` * @param {Float64Array} B - input matrix `B` -* @param {NonNegativeInteger} LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) -* @param {NonNegativeInteger} offsetB - starting `B` index +* @param {integer} strideB1 - stride of the first dimension of `B` +* @param {integer} strideB2 - stride of the second dimension of `B` +* @param {NonNegativeInteger} offsetB - starting index for `B` * @returns {Float64Array} `B` * * @example @@ -46,10 +50,10 @@ * var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); +* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); * // B => [ 30.0, 6.0, 0.0, 12.0 ] */ -function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ) { // eslint-disable-line max-len, max-params +function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ) { // eslint-disable-line max-params var nounit; var lside; var upper; @@ -68,12 +72,18 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( order === 'row-major' ) { lside = !lside; upper = !upper; - order = 'column-major'; + tmp = strideA1; + strideA1 = strideA2; + strideA2 = tmp; + tmp = strideB1; + strideB1 = strideB2; + strideB2 = tmp; } + if ( alpha === 0.0 ) { for ( j = 0; j < n; j++ ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] = 0.0; + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] = 0.0; } } return B; @@ -85,16 +95,16 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( j = 0; j < n; j++ ) { if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { // eslint-disable-line max-depth - B[ offsetB + ( j * LDB ) + i ] *= alpha; + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] *= alpha; } } for ( k = m - 1; k >= 0; k-- ) { - if ( B[ offsetB + ( j * LDB ) + k ] !== 0 ) { // eslint-disable-line max-depth + if ( B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] !== 0.0 ) { // eslint-disable-line max-depth if ( nounit ) { // eslint-disable-line max-depth - B[ offsetB + ( j * LDB ) + k ] /= A[ offsetA + ( k * LDA ) + k ]; // eslint-disable-line max-len + B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] /= A[ offsetA + ( k * strideA2 ) + ( k * strideA1 ) ]; } - for ( i = 0; i < k; i++ ) { // eslint-disable-line max-depth - B[ offsetB + ( j * LDB ) + i ] -= B[ offsetB + ( j * LDB ) + k ] * A[ offsetA + ( k * LDA ) + i ]; // eslint-disable-line max-len + for ( i = 0; i <= k - 1; i++ ) { // eslint-disable-line max-depth + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] * A[ offsetA + ( k * strideA2 ) + ( i * strideA1 ) ]; } } } @@ -105,16 +115,16 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( j = 0; j < n; j++ ) { if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] *= alpha; + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] *= alpha; } } for ( k = 0; k < m; k++ ) { - if ( B[ offsetB + ( j * LDB ) + k ] !== 0 ) { + if ( B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] !== 0.0 ) { if ( nounit ) { // eslint-disable-line max-depth - B[ offsetB + ( j * LDB ) + k ] /= A[ offsetA + ( k * LDA ) + k ]; // eslint-disable-line max-len + B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] /= A[ offsetA + ( k * strideA2 ) + ( k * strideA1 ) ]; } for ( i = k + 1; i < m; i++ ) { // eslint-disable-line max-depth - B[ offsetB + ( j * LDB ) + i ] -= B[ offsetB + ( j * LDB ) + k ] * A[ offsetA + ( k * LDA ) + i ]; // eslint-disable-line max-len + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] * A[ offsetA + ( k * strideA2 ) + ( i * strideA1 ) ]; } } } @@ -125,14 +135,14 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( upper ) { for ( j = 0; j < n; j++ ) { for ( i = 0; i < m; i++ ) { - tmp = alpha * B[ offsetB + ( j * LDB ) + i ]; + tmp = alpha * B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ]; for ( k = 0; k <= i - 1; k++ ) { - tmp -= A[ offsetA + ( i * LDA ) + k ] * B[ offsetB + ( j * LDB ) + k ]; // eslint-disable-line max-len + tmp -= A[ offsetA + ( i * strideA2 ) + ( k * strideA1 ) ] * B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ]; } if ( nounit ) { - tmp /= A[ offsetA + ( i * LDA ) + i ]; + tmp /= A[ offsetA + ( i * strideA2 ) + ( i * strideA1 ) ]; } - B[ offsetB + ( j * LDB ) + i ] = tmp; + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] = tmp; } } return B; @@ -140,14 +150,14 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B // Lower for ( j = 0; j < n; j++ ) { for ( i = m - 1; i >= 0; i-- ) { - tmp = alpha * B[ offsetB + ( j * LDB ) + i ]; + tmp = alpha * B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ]; for ( k = i + 1; k < m; k++ ) { - tmp -= A[ offsetA + ( i * LDA ) + k ] * B[ offsetB + ( j * LDB ) + k ]; // eslint-disable-line max-len + tmp -= A[ offsetA + ( i * strideA2 ) + ( k * strideA1 ) ] * B[ offsetB + ( j * strideB2 ) + k ]; } if ( nounit ) { - tmp /= A[ offsetA + ( i * LDA ) + i ]; + tmp /= A[ offsetA + ( i * strideA2 ) + ( i * strideA1 ) ]; } - B[ offsetB + ( j * LDB ) + i ] = tmp; + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] = tmp; } } return B; @@ -159,20 +169,20 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( j = 0; j < n; j++ ) { if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] *= alpha; + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] *= alpha; } } for ( k = 0; k <= j - 1; k++ ) { - if ( A[ offsetA + ( j * LDA ) + k ] !== 0.0 ) { + if ( A[ offsetA + ( j * strideA2 ) + k ] !== 0.0 ) { for ( i = 0; i < m; i++ ) { // eslint-disable-line max-depth - B[ offsetB + ( j * LDB ) + i ] -= A[ offsetA + ( j * LDA ) + k ] * B[ offsetB + ( k * LDB ) + i ]; // eslint-disable-line max-len + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= A[ offsetA + ( j * strideA2 ) + ( k * strideA1 ) ] * B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ]; } } } if ( nounit ) { - tmp = 1.0 / A[ offsetA + ( j * LDA ) + j ]; + tmp = 1.0 / A[ offsetA + ( j * strideA2 ) + j ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] *= tmp; + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] *= tmp; } } } @@ -182,20 +192,20 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B for ( j = n - 1; j >= 0; j-- ) { if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] *= alpha; + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] *= alpha; } } for ( k = j + 1; k < n; k++ ) { - if ( A[ offsetA + ( j * LDA ) + k ] !== 0 ) { + if ( A[ offsetA + ( j * strideA2 ) + k ] !== 0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] -= A[ offsetA + ( j * LDA ) + k ] * B[ offsetB + ( k * LDB ) + i ]; // eslint-disable-line max-len + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= A[ offsetA + ( j * strideA2 ) + ( k * strideA1 ) ] * B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ]; } } } if ( nounit ) { - tmp = 1.0 / A[ offsetA + ( j * LDA ) + j ]; + tmp = 1.0 / A[ offsetA + ( j * strideA2 ) + ( j * strideA1 ) ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] *= tmp; + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] *= tmp; } } } @@ -205,22 +215,22 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( upper ) { for ( k = n - 1; k >= 0; k-- ) { if ( nounit ) { - tmp = 1.0 / A[ offsetA + ( k * LDA ) + k ]; + tmp = 1.0 / A[ offsetA + ( k * strideA2 ) + ( k * strideA1 ) ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( k * LDB ) + i ] *= tmp; + B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ] *= tmp; } } for ( j = 0; j <= k - 1; j++ ) { - if ( A[ offsetA + ( k * LDA ) + j ] !== 0 ) { - tmp = A[ offsetA + ( k * LDA ) + j ]; + if ( A[ offsetA + ( k * strideA2 ) + ( j * strideA1 ) ] !== 0 ) { + tmp = A[ offsetA + ( k * strideA2 ) + ( j * strideA1 ) ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] -= tmp * B[ offsetB + ( k * LDB ) + i ]; // eslint-disable-line max-len + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= tmp * B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ]; } } } if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( k * LDB ) + i ] *= alpha; + B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ] *= alpha; } } } @@ -229,22 +239,22 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B // Lower for ( k = 0; k < n; k++ ) { if ( nounit ) { - tmp = 1.0 / A[ offsetA + ( k * LDA ) + k ]; + tmp = 1.0 / A[ offsetA + ( k * strideA2 ) + ( k * strideA1 ) ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( k * LDB ) + i ] *= tmp; + B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ] *= tmp; } } for ( j = k + 1; j < n; j++ ) { - if ( A[ offsetA + ( k * LDA ) + j ] !== 0 ) { - tmp = A[ offsetA + ( k * LDA ) + j ]; + if ( A[ offsetA + ( k * strideA2 ) + j ] !== 0 ) { + tmp = A[ offsetA + ( k * strideA2 ) + ( j * strideA1 ) ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * LDB ) + i ] -= tmp * B[ offsetB + ( k * LDB ) + i ]; // eslint-disable-line max-len + B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= tmp * B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ]; } } } if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( k * LDB ) + i ] *= alpha; + B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ] *= alpha; } } } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js index c89aaafc111c..93853cb87625 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js @@ -63,6 +63,10 @@ var base = require( './base.js' ); * // B => [ 30.0, 6.0, 0.0, 12.0 ] */ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) { // eslint-disable-line max-params + var sa1; + var sa2; + var sb1; + var sb2; if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } @@ -78,7 +82,18 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) { if ( !isDiagonalType( diag ) ) { throw new TypeError( format( 'invalid argument. Fifth argument must specify whether the matrix is unit triangular or not. Value: `%s`.', diag ) ); } - return base( order, side, uplo, transa, diag, m, n, alpha, A, LDA, 0, B, LDB, 0 ); // eslint-disable-line max-len + if ( order === 'column-major' ) { + sa1 = 1; + sa2 = LDA; + sb1 = 1; + sb2 = LDB; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + sb1 = LDB; + sb2 = 1; + } + return base( order, side, uplo, transa, diag, m, n, alpha, A, sa1, sa2, 0, B, sb1, sb2, 0 ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js index 3b181106930a..05b24e8f76cb 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. +* BLAS routine to solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. * * @module @stdlib/blas/base/dtrsm * @@ -37,11 +37,11 @@ * var Float64Array = require( '@stdlib/array/float64' ); * var dtrsm = require( '@stdlib/blas/base/dtrsm' ); * -* var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); -* var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); +* var A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); +* var B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 0, B, 2, 0 ); -* // B => [ 30.0, 6.0, 0.0, 12.0 ] +* dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); +* // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] */ // MODULES // @@ -66,5 +66,3 @@ if ( isError( tmp ) ) { // EXPORTS // module.exports = dtrsm; - -// exports: { "ndarray": "dtrsm.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js index 4d73711eb886..cf15cba9cc27 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js @@ -43,11 +43,13 @@ var base = require( './base.js' ); * @param {NonNegativeInteger} n - number of columns in `B` * @param {number} alpha - scalar constant * @param {Float64Array} A - input matrix `A` -* @param {NonNegativeInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) -* @param {NonNegativeInteger} offsetA - starting `A` index +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` * @param {Float64Array} B - input matrix `B` -* @param {NonNegativeInteger} LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) -* @param {NonNegativeInteger} offsetB - starting `B` index +* @param {integer} strideB1 - stride of the first dimension of `B` +* @param {integer} strideB2 - stride of the second dimension of `B` +* @param {NonNegativeInteger} offsetB - starting index for `B` * @throws {TypeError} first argument must be a valid order * @throws {TypeError} second argument must be a valid side * @throws {TypeError} third argument must specify whether the lower or upper triangular matrix is supplied. @@ -61,10 +63,10 @@ var base = require( './base.js' ); * var A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 2, B, 2, 1 ); +* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); * // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] */ -function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ) { // eslint-disable-line max-len, max-params +function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ) { // eslint-disable-line max-len, max-params if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } @@ -80,7 +82,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B if ( !isDiagonalType( diag ) ) { throw new TypeError( format( 'invalid argument. Fifth argument must specify whether the matrix is unit triangular or not. Value: `%s`.', diag ) ); } - return base( order, side, uplo, transa, diag, m, n, alpha, A, LDA, offsetA, B, LDB, offsetB ); // eslint-disable-line max-len + return base( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_ndarray_llntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_ndarray_llntwotwo.json index da966fca9e2d..421069165c72 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_ndarray_llntwotwo.json +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_ndarray_llntwotwo.json @@ -1,7 +1,7 @@ { - "order": "column-major", - "side": "right", - "uplo": "lower", + "order": "row-major", + "side": "left", + "uplo": "upper", "transa": "none", "diag": "non-unit", "m": 2, diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js index fe9ec209eb31..28441462775b 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js @@ -205,7 +205,7 @@ tape( 'the function throws an error if provided an invalid fifth argument', func } }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { var expected; var out; var A; @@ -223,7 +223,7 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { var expected; var out; var A; @@ -241,7 +241,7 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { var expected; var out; var A; @@ -259,7 +259,7 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { var expected; var out; var A; @@ -277,7 +277,7 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { var expected; var out; var A; @@ -295,7 +295,7 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { var expected; var out; var A; @@ -313,7 +313,7 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { var expected; var out; var A; @@ -331,7 +331,7 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { var expected; var out; var A; @@ -349,7 +349,7 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { var expected; var out; var A; @@ -367,7 +367,7 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { var expected; var out; var A; @@ -385,7 +385,7 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { var expected; var out; var A; @@ -403,7 +403,7 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { var expected; var out; var A; @@ -421,7 +421,7 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { var expected; var out; var A; @@ -439,7 +439,7 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { var expected; var out; var A; diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js index 6453749492b4..1cd8d6f8291b 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js @@ -73,8 +73,8 @@ tape( 'main export is a function', function test( t ) { t.end(); }); -tape( 'the function has an arity of 14', function test( t ) { - t.strictEqual( dtrsm.length, 14, 'returns expected value' ); +tape( 'the function has an arity of 16', function test( t ) { + t.strictEqual( dtrsm.length, 16, 'returns expected value' ); t.end(); }); @@ -96,7 +96,7 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - dtrsm( value, cndllntwotwo.side, cndllntwotwo.uplo, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), cndllntwotwo.ldb, cndllntwotwo.offsetB ); + dtrsm( value, cndllntwotwo.side, cndllntwotwo.uplo, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), 1, cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), 1, 1, cndllntwotwo.ldb, cndllntwotwo.offsetB ); }; } }); @@ -119,7 +119,7 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - dtrsm( cndllntwotwo.order, value, cndllntwotwo.uplo, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), cndllntwotwo.ldb, cndllntwotwo.offsetB ); + dtrsm( cndllntwotwo.order, value, cndllntwotwo.uplo, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), 1, cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), 1, cndllntwotwo.ldb, cndllntwotwo.offsetB ); }; } }); @@ -142,7 +142,7 @@ tape( 'the function throws an error if provided an invalid third argument', func function badValue( value ) { return function badValue() { - dtrsm( cndllntwotwo.order, cndllntwotwo.side, value, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), cndllntwotwo.ldb, cndllntwotwo.offsetB ); + dtrsm( cndllntwotwo.order, cndllntwotwo.side, value, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), 1, cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), 1, cndllntwotwo.ldb, cndllntwotwo.offsetB ); }; } }); @@ -165,7 +165,7 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun function badValue( value ) { return function badValue() { - dtrsm( cndllntwotwo.order, cndllntwotwo.side, cndllntwotwo.uplo, value, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), cndllntwotwo.ldb, cndllntwotwo.offsetB ); + dtrsm( cndllntwotwo.order, cndllntwotwo.side, cndllntwotwo.uplo, value, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), 1, cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), 1, cndllntwotwo.ldb, cndllntwotwo.offsetB ); }; } }); @@ -188,12 +188,12 @@ tape( 'the function throws an error if provided an invalid fifth argument', func function badValue( value ) { return function badValue() { - dtrsm( cndllntwotwo.order, cndllntwotwo.side, cndllntwotwo.uplo, cndllntwotwo.transa, value, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), cndllntwotwo.ldb, cndllntwotwo.offsetB ); + dtrsm( cndllntwotwo.order, cndllntwotwo.side, cndllntwotwo.uplo, cndllntwotwo.transa, value, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), 1, cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), 1, cndllntwotwo.ldb, cndllntwotwo.offsetB ); }; } }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { var expected; var out; var A; @@ -204,14 +204,14 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) expected = new Float64Array( cndllntwotwo.expected ); - out = dtrsm( cndllntwotwo.order, cndllntwotwo.side, cndllntwotwo.uplo, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, A, cndllntwotwo.lda, cndllntwotwo.offsetA, B, cndllntwotwo.ldb, cndllntwotwo.offsetB ); + out = dtrsm( cndllntwotwo.order, cndllntwotwo.side, cndllntwotwo.uplo, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, A, 1, cndllntwotwo.lda, cndllntwotwo.offsetA, B, 1, cndllntwotwo.ldb, cndllntwotwo.offsetB ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); t.end(); }); -tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { var expected; var out; var A; @@ -222,7 +222,7 @@ tape( 'the function Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) expected = new Float64Array( rndllntwotwo.expected ); - out = dtrsm( rndllntwotwo.order, rndllntwotwo.side, rndllntwotwo.uplo, rndllntwotwo.transa, rndllntwotwo.diag, rndllntwotwo.m, rndllntwotwo.n, rndllntwotwo.alpha, A, rndllntwotwo.lda, rndllntwotwo.offsetA, B, rndllntwotwo.ldb, rndllntwotwo.offsetB ); + out = dtrsm( rndllntwotwo.order, rndllntwotwo.side, rndllntwotwo.uplo, rndllntwotwo.transa, rndllntwotwo.diag, rndllntwotwo.m, rndllntwotwo.n, rndllntwotwo.alpha, A, rndllntwotwo.lda, 1, rndllntwotwo.offsetA, B, rndllntwotwo.ldb, 1, rndllntwotwo.offsetB ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); From acc78cca5330870faea9184a825b763e73afafb3 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Wed, 24 Jul 2024 19:04:09 +0530 Subject: [PATCH 20/33] refactor: repl.txt --- .../@stdlib/blas/base/dtrsm/docs/repl.txt | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt index 0d9d5ce18a1e..05d38e51e2bb 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt @@ -88,7 +88,7 @@ [ 0.0, 30.0, 6.0, 0.0, 12.0 ] -{{alias}}.ndarray( ord, side, ul, ta, diag, m, n, α, A, LDA, oa, B, LDB, ob ) +{{alias}}.ndarray( o, s, ul, ta, d, m, n, α, A, sa1, sa2, oa, B, sb1, sb2, ob ) Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` using alternative indexing semantics where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower @@ -101,11 +101,11 @@ Parameters ---------- - ord: string + o: string Row-major (C-style) or column-major (Fortran-style) order. Must be either 'row-major' or 'column-major'. - side: string + s: string Specifies whether `op( A )` appears on the left or right side of `X`. Must be either 'left' or 'right'. @@ -117,7 +117,7 @@ Specifies the form of `op( A )` to be used in the matrix multiplication. - diag: string + d: string Specifies whether `A` is unit triangular. Must be either 'unit' or 'non-unit'. @@ -133,22 +133,26 @@ A: Float64Array Triangular matrix `A`. - LDA: integer - Stride of the first dimension of `A` (a.k.a., leading dimension of the - matrix `A`). + sa1: integer + Stride of the first dimension of `A`. + + sa2: integer + Stride of the second dimension of `A`. oa: integer - Index offset for `A`. + Starting index for `A`. B: Float64Array Triangular matrix `B`. - LDB: integer - Stride of the first dimension of `B` (a.k.a., leading dimension of the - matrix `B`). + sb1: integer + Stride of the first dimension of `B`. + + sb2: integer + Stride of the second dimension of `B`. ob: integer - Index offset for `B`. + Starting index for `B`. Returns ------- @@ -165,7 +169,7 @@ > var ul = 'upper'; > var ta = 'none'; > var dg = 'non-unit'; - > {{alias}}.ndarray( ord, sd, ul, ta, dg, 2, 2, 6.0, A, 2, 0, B, 2, 0 ) + > {{alias}}.ndarray( ord, sd, ul, ta, dg, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ) [ 30.0, 6.0, 0.0, 12.0 ] // Advanced indexing: @@ -176,7 +180,7 @@ > var ul = 'upper'; > var ta = 'none'; > var dg = 'non-unit'; - > {{alias}}.ndarray( ord, sd, ul, ta, dg, 2, 2, 6.0, A, 2, 2, B, 2, 1 ) + > {{alias}}.ndarray( ord, sd, ul, ta, dg, 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ) [ 0.0, 30.0, 6.0, 0.0, 12.0 ] See Also From 35db166f070a4b3a67bc9eda182734956dc58484 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Wed, 24 Jul 2024 19:26:18 +0530 Subject: [PATCH 21/33] chore: apply suggestion from code review --- .../@stdlib/blas/base/dtrsm/README.md | 16 +++------------- .../blas/base/dtrsm/docs/types/index.d.ts | 6 +++--- .../@stdlib/blas/base/dtrsm/lib/base.js | 18 +++++++++--------- .../@stdlib/blas/base/dtrsm/lib/dtrsm.js | 2 +- .../@stdlib/blas/base/dtrsm/lib/ndarray.js | 2 +- .../@stdlib/blas/base/dtrsm/package.json | 2 +- 6 files changed, 18 insertions(+), 28 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md index adf0370ce56d..25fa5772bcba 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md @@ -20,7 +20,7 @@ limitations under the License. # dtrsm -> Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. +> Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`.
@@ -32,7 +32,7 @@ var dtrsm = require( '@stdlib/blas/base/dtrsm' ); #### dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) -Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. +Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`. ```javascript var Float64Array = require( '@stdlib/array/float64' ); @@ -59,16 +59,6 @@ The function has the following parameters: - **B**: input matrix `B`. - **LDB**: stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`). -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); -B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - -dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); -// B => [ 30.0, 6.0, 0.0, 12.0 ] -``` - Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. @@ -90,7 +80,7 @@ dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A1, 2, B1, 2 #### dtrsm.ndarray( o, s, ul, t, d, m, n, α, A, sa1, sa2, oa, B, sb1, sb2, ob ) -Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` using alternative indexing semantics where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B`. +Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` using alternative indexing semantics and where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`. ```javascript var Float64Array = require( '@stdlib/array/float64' ); diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts index a56c0b038cbf..36a801eddbee 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts @@ -27,7 +27,7 @@ import { Layout, MatrixTriangle, DiagonalType, OperationSide, TransposeOperation */ interface Routine { /** - * Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. + * Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`. * * @param order - storage layout of `A` and `B` * @param side - specifies whether `op( A )` appears on the left or right of `X` @@ -55,7 +55,7 @@ interface Routine { ( order: Layout, side: OperationSide, uplo: MatrixTriangle, transa: TransposeOperation, diag: DiagonalType, m: number, n: number, alpha: number, A: Float64Array, LDA: number, B: Float64Array, LDB: number ): Float64Array; /** - * Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. + * Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`. * * @param order - storage layout of `A` and `B` * @param side - specifies whether `op( A )` appears on the left or right of `X` @@ -88,7 +88,7 @@ interface Routine { } /** -* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. +* Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`. * * @param order - storage layout of `A` and `B` * @param side - specifies whether `op( A )` appears on the left or right of `X` diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js index 1e5a4627e9d4..01516d13be1d 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js @@ -16,14 +16,14 @@ * limitations under the License. */ -/* eslint-disable max-len, max-statements */ +/* eslint-disable max-len, max-statements, max-depth */ 'use strict'; // MAIN // /** -* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. +* Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`. * * @private * @param {string} order - storage layout of `A` and `B` @@ -94,16 +94,16 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid if ( upper ) { for ( j = 0; j < n; j++ ) { if ( alpha !== 1.0 ) { - for ( i = 0; i < m; i++ ) { // eslint-disable-line max-depth + for ( i = 0; i < m; i++ ) { B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] *= alpha; } } for ( k = m - 1; k >= 0; k-- ) { - if ( B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] !== 0.0 ) { // eslint-disable-line max-depth - if ( nounit ) { // eslint-disable-line max-depth + if ( B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] !== 0.0 ) { + if ( nounit ) { B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] /= A[ offsetA + ( k * strideA2 ) + ( k * strideA1 ) ]; } - for ( i = 0; i <= k - 1; i++ ) { // eslint-disable-line max-depth + for ( i = 0; i <= k - 1; i++ ) { B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] * A[ offsetA + ( k * strideA2 ) + ( i * strideA1 ) ]; } } @@ -120,10 +120,10 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid } for ( k = 0; k < m; k++ ) { if ( B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] !== 0.0 ) { - if ( nounit ) { // eslint-disable-line max-depth + if ( nounit ) { B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] /= A[ offsetA + ( k * strideA2 ) + ( k * strideA1 ) ]; } - for ( i = k + 1; i < m; i++ ) { // eslint-disable-line max-depth + for ( i = k + 1; i < m; i++ ) { B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] * A[ offsetA + ( k * strideA2 ) + ( i * strideA1 ) ]; } } @@ -174,7 +174,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid } for ( k = 0; k <= j - 1; k++ ) { if ( A[ offsetA + ( j * strideA2 ) + k ] !== 0.0 ) { - for ( i = 0; i < m; i++ ) { // eslint-disable-line max-depth + for ( i = 0; i < m; i++ ) { B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= A[ offsetA + ( j * strideA2 ) + ( k * strideA1 ) ] * B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ]; } } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js index 93853cb87625..e2cc0fce076e 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js @@ -32,7 +32,7 @@ var base = require( './base.js' ); // MAIN // /** -* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. +* Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`. * * @param {string} order - storage layout of `A` and `B` * @param {string} side - specifies whether `op( A )` appears on the left or right of `X` diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js index cf15cba9cc27..29979b6dc957 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js @@ -32,7 +32,7 @@ var base = require( './base.js' ); // MAIN // /** -* Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. +* Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`. * * @param {string} order - storage layout of `A` and `B` * @param {string} side - specifies whether `op( A )` appears on the left or right of `X` diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/package.json b/lib/node_modules/@stdlib/blas/base/dtrsm/package.json index afb7ba012d9a..7e15c841d4da 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/package.json +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/dtrsm", "version": "0.0.0", - "description": "Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`.", + "description": "Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", From 48b82314f2df45a682b7a72b3e0dbc6e8cf5f125 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Wed, 24 Jul 2024 19:40:25 +0530 Subject: [PATCH 22/33] refactor: base implementation to compute offsets before loop --- .../@stdlib/blas/base/dtrsm/lib/base.js | 111 ++++++++++++------ 1 file changed, 72 insertions(+), 39 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js index 01516d13be1d..a0ce424f581d 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js @@ -58,6 +58,10 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid var lside; var upper; var tmp; + var oa2; + var ob2; + var oa; + var ob; var i; var j; var k; @@ -82,8 +86,9 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid if ( alpha === 0.0 ) { for ( j = 0; j < n; j++ ) { + ob = offsetB + ( j * strideB2 ); for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] = 0.0; + B[ ob + ( i * strideB1 ) ] = 0.0; } } return B; @@ -93,18 +98,22 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid // B := alpha * inv( A ) * B if ( upper ) { for ( j = 0; j < n; j++ ) { + ob = offsetB + ( j * strideB2 ); if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] *= alpha; + B[ ob + ( i * strideB1 ) ] *= alpha; } } for ( k = m - 1; k >= 0; k-- ) { - if ( B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] !== 0.0 ) { + oa = offsetA + ( k * strideA2 ); + oa2 = oa + ( k * strideA1 ); + ob2 = ob + ( k * strideB1 ); + if ( B[ ob2 ] !== 0.0 ) { if ( nounit ) { - B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] /= A[ offsetA + ( k * strideA2 ) + ( k * strideA1 ) ]; + B[ ob2 ] /= A[ oa2 ]; } for ( i = 0; i <= k - 1; i++ ) { - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] * A[ offsetA + ( k * strideA2 ) + ( i * strideA1 ) ]; + B[ ob + ( i * strideB1 ) ] -= B[ ob2 ] * A[ oa + ( i * strideA1 ) ]; } } } @@ -113,18 +122,22 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid } // Lower for ( j = 0; j < n; j++ ) { + ob = offsetB + ( j * strideB2 ); if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] *= alpha; + B[ ob + ( i * strideB1 ) ] *= alpha; } } for ( k = 0; k < m; k++ ) { - if ( B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] !== 0.0 ) { + oa = offsetA + ( k * strideA2 ); + oa2 = oa + ( k * strideA1 ); + ob2 = ob + ( k * strideB1 ); + if ( B[ ob + ( k * strideB1 ) ] !== 0.0 ) { if ( nounit ) { - B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] /= A[ offsetA + ( k * strideA2 ) + ( k * strideA1 ) ]; + B[ ob2 ] /= A[ oa2 ]; } for ( i = k + 1; i < m; i++ ) { - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ] * A[ offsetA + ( k * strideA2 ) + ( i * strideA1 ) ]; + B[ ob + ( i * strideB1 ) ] -= B[ ob2 ] * A[ oa + ( i * strideA1 ) ]; } } } @@ -134,30 +147,36 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid // B := alpha * inv( A**T ) * B if ( upper ) { for ( j = 0; j < n; j++ ) { + ob = offsetB + ( j * strideB2 ); for ( i = 0; i < m; i++ ) { - tmp = alpha * B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ]; + oa = offsetA + ( i * strideA2 ); + oa2 = oa + ( i * strideA1 ); + tmp = alpha * B[ ob + ( i * strideB1 ) ]; for ( k = 0; k <= i - 1; k++ ) { - tmp -= A[ offsetA + ( i * strideA2 ) + ( k * strideA1 ) ] * B[ offsetB + ( j * strideB2 ) + ( k * strideB1 ) ]; + tmp -= A[ oa + ( k * strideA1 ) ] * B[ ob + ( k * strideB1 ) ]; } if ( nounit ) { - tmp /= A[ offsetA + ( i * strideA2 ) + ( i * strideA1 ) ]; + tmp /= A[ oa2 ]; } - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] = tmp; + B[ ob + ( i * strideB1 ) ] = tmp; } } return B; } // Lower for ( j = 0; j < n; j++ ) { + ob = offsetB + ( j * strideB2 ); for ( i = m - 1; i >= 0; i-- ) { - tmp = alpha * B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ]; + oa = offsetA + ( i * strideA2 ); + oa2 = oa + ( i * strideA1 ); + tmp = alpha * B[ ob + ( i * strideB1 ) ]; for ( k = i + 1; k < m; k++ ) { - tmp -= A[ offsetA + ( i * strideA2 ) + ( k * strideA1 ) ] * B[ offsetB + ( j * strideB2 ) + k ]; + tmp -= A[ oa + ( k * strideA1 ) ] * B[ ob + k ]; } if ( nounit ) { - tmp /= A[ offsetA + ( i * strideA2 ) + ( i * strideA1 ) ]; + tmp /= A[ oa2 ]; } - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] = tmp; + B[ ob + ( i * strideB1 ) ] = tmp; } } return B; @@ -167,22 +186,25 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid // B := alpha * B * inv( A ) if ( upper ) { for ( j = 0; j < n; j++ ) { + ob = offsetB + ( j * strideB2 ); + oa = offsetA + ( j * strideA2 ); if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] *= alpha; + B[ ob + ( i * strideB1 ) ] *= alpha; } } for ( k = 0; k <= j - 1; k++ ) { - if ( A[ offsetA + ( j * strideA2 ) + k ] !== 0.0 ) { + ob2 = offsetB + ( k * strideB2 ); + if ( A[ oa + ( k * strideA1 ) ] !== 0.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= A[ offsetA + ( j * strideA2 ) + ( k * strideA1 ) ] * B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ]; + B[ ob + ( i * strideB1 ) ] -= A[ oa + ( k * strideA1 ) ] * B[ ob2 + ( i * strideB1 ) ]; } } } if ( nounit ) { - tmp = 1.0 / A[ offsetA + ( j * strideA2 ) + j ]; + tmp = 1.0 / A[ oa + j ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] *= tmp; + B[ ob + ( i * strideB1 ) ] *= tmp; } } } @@ -190,22 +212,25 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid } // Lower for ( j = n - 1; j >= 0; j-- ) { + ob = offsetB + ( j * strideB2 ); + oa = offsetA + ( j * strideA2 ); if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] *= alpha; + B[ ob + ( i * strideB1 ) ] *= alpha; } } for ( k = j + 1; k < n; k++ ) { - if ( A[ offsetA + ( j * strideA2 ) + k ] !== 0 ) { + ob2 = offsetB + ( k * strideB2 ); + if ( A[ oa + k ] !== 0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= A[ offsetA + ( j * strideA2 ) + ( k * strideA1 ) ] * B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ]; + B[ ob + ( i * strideB1 ) ] -= A[ oa + ( k * strideA1 ) ] * B[ ob2 + ( i * strideB1 ) ]; } } } if ( nounit ) { - tmp = 1.0 / A[ offsetA + ( j * strideA2 ) + ( j * strideA1 ) ]; + tmp = 1.0 / A[ oa + ( j * strideA1 ) ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] *= tmp; + B[ ob + ( i * strideB1 ) ] *= tmp; } } } @@ -214,23 +239,27 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid // B := alpha * B * inv( A**T ) if ( upper ) { for ( k = n - 1; k >= 0; k-- ) { + ob = offsetB + ( k * strideB2 ); + oa = offsetA + ( k * strideA2 ); + oa2 = oa + ( k * strideA1 ); if ( nounit ) { - tmp = 1.0 / A[ offsetA + ( k * strideA2 ) + ( k * strideA1 ) ]; + tmp = 1.0 / A[ oa2 ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ] *= tmp; + B[ ob + ( i * strideB1 ) ] *= tmp; } } for ( j = 0; j <= k - 1; j++ ) { - if ( A[ offsetA + ( k * strideA2 ) + ( j * strideA1 ) ] !== 0 ) { - tmp = A[ offsetA + ( k * strideA2 ) + ( j * strideA1 ) ]; + ob2 = offsetB + ( j * strideB2 ); + if ( A[ oa + ( j * strideA1 ) ] !== 0 ) { + tmp = A[ oa + ( j * strideA1 ) ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= tmp * B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ]; + B[ ob2 + ( i * strideB1 ) ] -= tmp * B[ ob + ( i * strideB1 ) ]; } } } if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ] *= alpha; + B[ ob + ( i * strideB1 ) ] *= alpha; } } } @@ -238,23 +267,27 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid } // Lower for ( k = 0; k < n; k++ ) { + ob = offsetB + ( k * strideB2 ); + oa = offsetA + ( k * strideA2 ); + oa2 = oa + ( k * strideA1 ); if ( nounit ) { - tmp = 1.0 / A[ offsetA + ( k * strideA2 ) + ( k * strideA1 ) ]; + tmp = 1.0 / A[ oa2 ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ] *= tmp; + B[ ob + ( i * strideB1 ) ] *= tmp; } } for ( j = k + 1; j < n; j++ ) { - if ( A[ offsetA + ( k * strideA2 ) + j ] !== 0 ) { - tmp = A[ offsetA + ( k * strideA2 ) + ( j * strideA1 ) ]; + ob2 = offsetB + ( j * strideB2 ); + if ( A[ oa + j ] !== 0 ) { + tmp = A[ oa + ( j * strideA1 ) ]; for ( i = 0; i < m; i++ ) { - B[ offsetB + ( j * strideB2 ) + ( i * strideB1 ) ] -= tmp * B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ]; + B[ ob2 + ( i * strideB1 ) ] -= tmp * B[ ob + ( i * strideB1 ) ]; } } } if ( alpha !== 1.0 ) { for ( i = 0; i < m; i++ ) { - B[ offsetB + ( k * strideB2 ) + ( i * strideB1 ) ] *= alpha; + B[ ob + ( i * strideB1 ) ] *= alpha; } } } From 2eea9ee1da791184fafb505cee3834c58481599d Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Thu, 25 Jul 2024 09:28:20 +0530 Subject: [PATCH 23/33] chore: work in progress --- .../@stdlib/blas/base/dtrsm/README.md | 10 +- .../blas/base/dtrsm/benchmark/benchmark.js | 2 +- .../base/dtrsm/benchmark/benchmark.ndarray.js | 2 +- .../@stdlib/blas/base/dtrsm/docs/repl.txt | 30 +- .../blas/base/dtrsm/docs/types/index.d.ts | 8 +- .../blas/base/dtrsm/docs/types/test.ts | 472 +++++++++--------- .../@stdlib/blas/base/dtrsm/examples/index.js | 2 +- .../@stdlib/blas/base/dtrsm/lib/base.js | 6 +- .../@stdlib/blas/base/dtrsm/lib/dtrsm.js | 2 +- .../@stdlib/blas/base/dtrsm/lib/index.js | 4 +- .../@stdlib/blas/base/dtrsm/lib/ndarray.js | 2 +- .../blas/base/dtrsm/test/test.dtrsm.js | 7 +- .../blas/base/dtrsm/test/test.ndarray.js | 19 + 13 files changed, 282 insertions(+), 284 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md index 25fa5772bcba..d5800d25a75e 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md @@ -40,7 +40,7 @@ var Float64Array = require( '@stdlib/array/float64' ); A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); -dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // B => [ 30.0, 6.0, 0.0, 12.0 ] ``` @@ -74,7 +74,7 @@ var B0 = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element var B1 = new Float64Array( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A1, 2, B1, 2 ); +dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A1, 2, B1, 2 ); // B0 => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] ``` @@ -88,7 +88,7 @@ var Float64Array = require( '@stdlib/array/float64' ); A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); -dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); +dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] ``` @@ -109,7 +109,7 @@ var Float64Array = require( '@stdlib/array/float64' ); A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); -dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); +dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] ``` @@ -140,7 +140,7 @@ var dtrsm = require( '@stdlib/blas/base/dtrsm' ); var A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); var B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); -dtrsm( 'row-major', 'left', 'lower', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +dtrsm( 'row-major', 'left', 'lower', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); console.log( B ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.js index d10bc18dcc5d..92a1dd14fbb4 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.js @@ -62,7 +62,7 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - z = dtrsm( 'column-major', 'left', 'upper', 'none', 'non-unit', N, N, 1.0, A, N, B, N ); + z = dtrsm( 'column-major', 'left', 'upper', 'no-transpose', 'non-unit', N, N, 1.0, A, N, B, N ); if ( isnan( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js index b34804626974..cba76a040360 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js @@ -62,7 +62,7 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - z = dtrsm( 'column-major', 'left', 'upper', 'none', 'non-unit', N, N, 1.0, A, 1, N, 0, B, 1, N, 0 ); + z = dtrsm( 'column-major', 'left', 'upper', 'no-transpose', 'non-unit', N, N, 1.0, A, 1, N, 0, B, 1, N, 0 ); if ( isnan( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt index 05d38e51e2bb..a882614ed603 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt @@ -62,31 +62,16 @@ Examples -------- - // Standard usage: > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 3.0, 0.0, 4.0 ] ); > var B = new {{alias:@stdlib/array/float64}}( [ 5.0, 7.0, 0.0, 8.0 ] ); > var ord = 'row-major'; > var sd = 'left'; > var ul = 'upper'; - > var ta = 'none'; + > var ta = 'no-transpose'; > var dg = 'non-unit'; > {{alias}}( ord, sd, ul, ta, dg, 2, 2, 6.0, A, 2, B, 2 ) [ 30.0, 6.0, 0.0, 12.0 ] - // Using typed array views: - > var A0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 3.0, 0.0, 4.0 ] ); - > var B0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); - > var A1 = new {{alias:@stdlib/array/float64}}( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); - > var B1 = new {{alias:@stdlib/array/float64}}( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); - > var ord = 'row-major'; - > var sd = 'left'; - > var ul = 'upper'; - > var ta = 'none'; - > var dg = 'non-unit'; - > {{alias}}( ord, sd, ul, ta, dg, 2, 2, 6.0, A1, 2, B1, 2 ); - > B0 - [ 0.0, 30.0, 6.0, 0.0, 12.0 ] - {{alias}}.ndarray( o, s, ul, ta, d, m, n, α, A, sa1, sa2, oa, B, sb1, sb2, ob ) Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` @@ -167,21 +152,10 @@ > var ord = 'row-major'; > var sd = 'left'; > var ul = 'upper'; - > var ta = 'none'; + > var ta = 'no-transpose'; > var dg = 'non-unit'; > {{alias}}.ndarray( ord, sd, ul, ta, dg, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ) [ 30.0, 6.0, 0.0, 12.0 ] - // Advanced indexing: - > var A = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); - > var B = new {{alias:@stdlib/array/float64}}( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); - > var ord = 'row-major'; - > var sd = 'left'; - > var ul = 'upper'; - > var ta = 'none'; - > var dg = 'non-unit'; - > {{alias}}.ndarray( ord, sd, ul, ta, dg, 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ) - [ 0.0, 30.0, 6.0, 0.0, 12.0 ] - See Also -------- diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts index 36a801eddbee..038cde5ef35f 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts @@ -49,7 +49,7 @@ interface Routine { * var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); * - * dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); + * dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); * // B => [ 30.0, 6.0, 0.0, 12.0 ] */ ( order: Layout, side: OperationSide, uplo: MatrixTriangle, transa: TransposeOperation, diag: DiagonalType, m: number, n: number, alpha: number, A: Float64Array, LDA: number, B: Float64Array, LDB: number ): Float64Array; @@ -81,7 +81,7 @@ interface Routine { * var A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); * - * dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); + * dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); * // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] */ ndarray( order: Layout, side: OperationSide, uplo: MatrixTriangle, transa: TransposeOperation, diag: DiagonalType, m: number, n: number, alpha: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number, B: Float64Array, strideB1: number, strideB2: number, offsetB: number ): Float64Array; @@ -110,7 +110,7 @@ interface Routine { * var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +* dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); * // B => [ 30.0, 6.0, 0.0, 12.0 ] * * @example @@ -119,7 +119,7 @@ interface Routine { * var A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); +* dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); * // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] */ declare var dtrsm: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts index 51cdd79fbf4e..fdd4cb68fea4 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts @@ -26,7 +26,7 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectType Float64Array + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectType Float64Array } // The compiler throws an error if the function is provided a first argument which is not a string... @@ -34,14 +34,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 5, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( true, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( false, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( null, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( void 0, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( [], 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( {}, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( ( x: number ): number => x, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 5, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( true, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( false, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( null, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( void 0, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( [], 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( {}, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( ( x: number ): number => x, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a string... @@ -49,14 +49,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 5, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', true, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', false, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', null, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', void 0, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', [], 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', {}, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', ( x: number ): number => x, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 5, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', true, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', false, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', null, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', void 0, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', [], 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', {}, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', ( x: number ): number => x, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError } // The compiler throws an error if the function is provided a third argument which is not a string... @@ -64,14 +64,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 5, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', true, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', false, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', null, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', void 0, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', [], 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', {}, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', ( x: number ): number => x, 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 5, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', true, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', false, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', null, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', void 0, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', [], 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', {}, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', ( x: number ): number => x, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError } // The compiler throws an error if the function is provided a fourth argument which is not a string... @@ -94,14 +94,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 5, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', true, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', false, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', null, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', void 0, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', [], 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', {}, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', ( x: number ): number => x, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 5, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', true, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', false, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', null, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', void 0, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', [], 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', {}, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', ( x: number ): number => x, 2, 2, 6.0, A, 2, B, 2 ); // $ExpectError } // The compiler throws an error if the function is provided a sixth argument which is not a number... @@ -109,14 +109,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', '5', 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', true, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', false, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', null, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', void 0, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', [], 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', {}, 2, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', ( x: number ): number => x, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', '5', 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', true, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', false, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', null, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', void 0, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', [], 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', {}, 2, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', ( x: number ): number => x, 2, 6.0, A, 2, B, 2 ); // $ExpectError } // The compiler throws an error if the function is provided a seventh argument which is not a number... @@ -124,14 +124,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, '5', 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, true, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, false, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, null, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, void 0, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, [], 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, {}, 6.0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, ( x: number ): number => x, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, '5', 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, true, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, false, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, null, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, void 0, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, [], 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, {}, 6.0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, ( x: number ): number => x, 6.0, A, 2, B, 2 ); // $ExpectError } // The compiler throws an error if the function is provided an eighth argument which is not a number... @@ -139,29 +139,29 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, '5', A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, true, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, false, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, null, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, void 0, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, [], A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, {}, A, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, ( x: number ): number => x, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, '5', A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, true, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, false, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, null, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, void 0, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, [], A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, {}, A, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, ( x: number ): number => x, A, 2, B, 2 ); // $ExpectError } // The compiler throws an error if the function is provided a ninth argument which is not a Float64Array... { const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, '5', 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, 5, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, true, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, false, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, null, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, void 0, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, [], 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, {}, 2, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, ( x: number ): number => x, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, '5', 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, 5, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, true, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, false, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, null, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, void 0, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, [], 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, {}, 2, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, ( x: number ): number => x, 2, B, 2 ); // $ExpectError } // The compiler throws an error if the function is provided a tenth argument which is not a number... @@ -169,29 +169,29 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, '5', B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, true, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, false, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, null, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, void 0, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, [], B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, {}, B, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, ( x: number ): number => x, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, '5', B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, true, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, false, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, null, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, void 0, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, [], B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, {}, B, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, ( x: number ): number => x, B, 2 ); // $ExpectError } // The compiler throws an error if the function is provided an eleventh argument which is not a Float64Array... { const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, '5', 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 5, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, true, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, false, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, null, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, void 0, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, [], 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, {}, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, ( x: number ): number => x, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, '5', 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 5, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, true, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, false, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, null, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, void 0, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, [], 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, {}, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, ( x: number ): number => x, 2 ); // $ExpectError } // The compiler throws an error if the function is provided a twelfth argument which is not a number... @@ -199,14 +199,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, '5' ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, true ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, false ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, null ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, void 0 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, [] ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, {} ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, ( x: number ): number => x ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, '5' ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, true ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, false ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, null ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, void 0 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, [] ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, {} ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... @@ -218,15 +218,15 @@ import dtrsm = require( './index' ); dtrsm( 'row-major' ); // $ExpectError dtrsm( 'row-major', 'left' ); // $ExpectError dtrsm( 'row-major', 'left', 'upper' ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none' ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit' ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2 ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B ); // $ExpectError - dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2, 10 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose' ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit' ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2 ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B ); // $ExpectError + dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2, 10 ); // $ExpectError } // Attached to main export is an `ndarray` method which returns a Float64Array... @@ -234,7 +234,7 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectType Float64Array + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectType Float64Array } // The compiler throws an error if the function is provided a first argument which is not a string... @@ -242,14 +242,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 5, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( true, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( false, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( null, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( void 0, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( [], 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( {}, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( ( x: number ): number => x, 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 5, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( true, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( false, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( null, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( void 0, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( [], 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( {}, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( ( x: number ): number => x, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a string... @@ -257,14 +257,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 5, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', true, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', false, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', null, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', void 0, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', [], 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', {}, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', ( x: number ): number => x, 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 5, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', true, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', false, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', null, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', void 0, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', [], 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', {}, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', ( x: number ): number => x, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a third argument which is not a string... @@ -272,14 +272,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 5, 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', true, 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', false, 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', null, 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', void 0, 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', [], 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', {}, 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', ( x: number ): number => x, 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 5, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', true, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', false, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', null, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', void 0, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', [], 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', {}, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', ( x: number ): number => x, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a fourth argument which is not a string... @@ -302,14 +302,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 5, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', true, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', false, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', null, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', void 0, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', [], 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', {}, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', ( x: number ): number => x, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 5, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', true, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', false, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', null, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', void 0, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', [], 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', {}, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', ( x: number ): number => x, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a sixth argument which is not a number... @@ -317,14 +317,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', '5', 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', true, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', false, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', null, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', void 0, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', [], 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', {}, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', ( x: number ): number => x, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', '5', 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', true, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', false, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', null, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', void 0, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', [], 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', {}, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', ( x: number ): number => x, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a seventh argument which is not a number... @@ -332,14 +332,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, '5', 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, true, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, false, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, null, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, void 0, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, [], 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, {}, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, ( x: number ): number => x, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, '5', 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, true, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, false, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, null, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, void 0, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, [], 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, {}, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, ( x: number ): number => x, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided an eighth argument which is not a number... @@ -347,29 +347,29 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, '5', A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, true, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, false, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, null, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, void 0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, [], A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, {}, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, ( x: number ): number => x, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, '5', A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, true, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, false, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, null, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, void 0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, [], A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, {}, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, ( x: number ): number => x, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a ninth argument which is not a Float64Array... { const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, '5', 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, 5, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, true, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, false, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, null, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, void 0, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, [], 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, {}, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, ( x: number ): number => x, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, '5', 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, 5, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, true, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, false, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, null, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, void 0, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, [], 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, {}, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, ( x: number ): number => x, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a tenth argument which is not a number... @@ -377,14 +377,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, '5', 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, true, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, false, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, null, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, void 0, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, [], 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, {}, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, ( x: number ): number => x, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, '5', 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, true, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, false, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, null, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, void 0, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, [], 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, {}, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, ( x: number ): number => x, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided an eleventh argument which is not a number... @@ -392,14 +392,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, '5', 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, true, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, false, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, null, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, void 0, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, [], 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, {}, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, ( x: number ): number => x, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, '5', 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, true, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, false, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, null, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, void 0, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, [], 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, {}, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, ( x: number ): number => x, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a twelfth argument which is not a number... @@ -407,29 +407,29 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, '5', B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, true, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, false, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, null, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, void 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, [], B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, {}, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, ( x: number ): number => x, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, '5', B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, true, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, false, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, null, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, void 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, [], B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, {}, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, ( x: number ): number => x, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a thirteenth argument which is not a Float64Array... { const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, '5', 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, 5, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, true, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, false, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, null, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, void 0, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, [], 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, {}, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, ( x: number ): number => x, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, '5', 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, 5, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, true, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, false, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, null, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, void 0, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, [], 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, {}, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, ( x: number ): number => x, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a fourteenth argument which is not a number... @@ -437,14 +437,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, '5', 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, true, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, false, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, null, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, void 0, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, [], 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, {}, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, ( x: number ): number => x, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, '5', 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, true, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, false, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, null, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, void 0, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, [], 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, {}, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, ( x: number ): number => x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a fifteenth argument which is not a number... @@ -452,14 +452,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, '5', 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, true, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, false, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, null, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, void 0, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, [], 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, {}, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, ( x: number ): number => x, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, '5', 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, true, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, false, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, null, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, void 0, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, [], 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, {}, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, ( x: number ): number => x, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a sixteenth argument which is not a number... @@ -467,14 +467,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, '5' ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, true ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, false ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, null ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, void 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, [] ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, {} ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, ( x: number ): number => x ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, '5' ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, true ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, false ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, null ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, void 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, [] ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, {} ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... @@ -486,17 +486,17 @@ import dtrsm = require( './index' ); dtrsm.ndarray( 'row-major' ); // $ExpectError dtrsm.ndarray( 'row-major', 'left' ); // $ExpectError dtrsm.ndarray( 'row-major', 'left', 'upper' ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none' ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit' ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0, 10 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose' ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit' ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1 ); // $ExpectError + dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0, 10 ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js b/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js index da5ee7fb7c83..2cc867cb7bac 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/examples/index.js @@ -24,6 +24,6 @@ var dtrsm = require( './../lib' ); var A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); var B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); -var out = dtrsm( 'column-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +var out = dtrsm( 'column-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); console.log( out ); // => [ 30.0, 0.0, 6.0, 12.0 ] diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js index a0ce424f581d..06c6cb31095f 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js @@ -50,7 +50,7 @@ * var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); +* dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); * // B => [ 30.0, 6.0, 0.0, 12.0 ] */ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ) { // eslint-disable-line max-params @@ -94,7 +94,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid return B; } if ( lside ) { - if ( transa === 'none' ) { + if ( transa === 'no-transpose' ) { // B := alpha * inv( A ) * B if ( upper ) { for ( j = 0; j < n; j++ ) { @@ -182,7 +182,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid return B; } // Right - if ( transa === 'none' ) { + if ( transa === 'no-transpose' ) { // B := alpha * B * inv( A ) if ( upper ) { for ( j = 0; j < n; j++ ) { diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js index e2cc0fce076e..c44d71669480 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js @@ -59,7 +59,7 @@ var base = require( './base.js' ); * var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +* dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); * // B => [ 30.0, 6.0, 0.0, 12.0 ] */ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) { // eslint-disable-line max-params diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js index 05b24e8f76cb..06d7306cd467 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js @@ -30,7 +30,7 @@ * var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); +* dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); * // B => [ 30.0, 6.0, 0.0, 12.0 ] * * @example @@ -40,7 +40,7 @@ * var A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm.ndarray( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); +* dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); * // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] */ diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js index 29979b6dc957..4c49b84c974a 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js @@ -63,7 +63,7 @@ var base = require( './base.js' ); * var A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm( 'row-major', 'left', 'upper', 'none', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); +* dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); * // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] */ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ) { // eslint-disable-line max-len, max-params diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js index 28441462775b..6fe204d85ccd 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js @@ -92,6 +92,8 @@ tape( 'the function has an arity of 12', function test( t ) { tape( 'the function throws an error if provided an invalid first argument', function test( t ) { var values; + var A; + var B; var i; values = [ @@ -101,6 +103,9 @@ tape( 'the function throws an error if provided an invalid first argument', func 'boop' ]; + A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); + for ( i = 0; i < values.length; i++ ) { t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); } @@ -108,7 +113,7 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - dtrsm( value, clunntwotwo.side, clunntwotwo.uplo, clunntwotwo.transa, clunntwotwo.diag, clunntwotwo.m, clunntwotwo.n, clunntwotwo.alpha, new Float64Array( clunntwotwo.a ), clunntwotwo.lda, new Float64Array( clunntwotwo.b ), clunntwotwo.ldb ); + dtrsm( value, "left", "upper", "no-transpose", "non-unit", 2, 2, 6.0, A, 2, B, 2 ); }; } }); diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js index 1cd8d6f8291b..97ed955ebed1 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js @@ -228,3 +228,22 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); + +tape( 'the function supports complex access patterns ( row-major, strideA1 = , strideA2 = 2, strideB1 = , strideB2 = )', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( [ 1.0, 999.0, 0.0, 999.0, 0.0, 2.0, 999.0, 5.0, 999.0, 0.0, 3.0, 999.0, 6.0, 999.0, 9.0 ] ); + B = new Float64Array( [ 10.0, 999.0, 0.0, 999.0, 0.0, 11.0, 999.0, 14.0, 999.0, 0.0, 12.0, 999.0, 15.0, 999.0, 18.0 ] ); + + expected =[ 60, 999.0, 0.0, 999.0, 0.0, -10.8, 999.0, 16.8, 999.0, 0.0, -4.8, 999.0, -1.20, 999.0, 12 ] + + out = dtrsm( 'row-major', 'left', 'lower', 'no-transpose', 'non-unit', 3, 3, 6, A, 3, 2, 0, B, 3, 2, 0 ); + console.log( out ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 10.0 ); + + t.end(); +}); From 355a56edad6c6bc2c2d049bde6516c19a1d22560 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Thu, 25 Jul 2024 10:58:09 +0530 Subject: [PATCH 24/33] refactor: remove fixtures --- .../fixtures/column_major_llnthreethree.json | 15 -- .../test/fixtures/column_major_llntwotwo.json | 15 -- .../test/fixtures/column_major_llutwotwo.json | 15 -- .../fixtures/column_major_lunntwotwo.json | 15 -- .../test/fixtures/column_major_luutwotwo.json | 15 -- .../column_major_ndarray_llntwotwo.json | 17 -- .../fixtures/column_major_rlunntwotwo.json | 15 -- .../fixtures/column_major_runntwotwo.json | 15 -- .../fixtures/row_major_llnthreethree.json | 15 -- .../test/fixtures/row_major_llntwotwo.json | 15 -- .../test/fixtures/row_major_llutwotwo.json | 15 -- .../test/fixtures/row_major_lunntwotwo.json | 15 -- .../test/fixtures/row_major_luutwotwo.json | 15 -- .../fixtures/row_major_ndarray_llntwotwo.json | 17 -- .../test/fixtures/row_major_rlunntwotwo.json | 15 -- .../test/fixtures/row_major_runntwotwo.json | 15 -- .../blas/base/dtrsm/test/test.dtrsm.js | 161 +++++++++--------- 17 files changed, 81 insertions(+), 324 deletions(-) delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llnthreethree.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llntwotwo.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llutwotwo.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_lunntwotwo.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_luutwotwo.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_ndarray_llntwotwo.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_rlunntwotwo.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_runntwotwo.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llnthreethree.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llntwotwo.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llutwotwo.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_lunntwotwo.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_luutwotwo.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_ndarray_llntwotwo.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_rlunntwotwo.json delete mode 100644 lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_runntwotwo.json diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llnthreethree.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llnthreethree.json deleted file mode 100644 index f18c03da2655..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llnthreethree.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "column-major", - "side": "left", - "uplo": "lower", - "transa": "none", - "diag": "non-unit", - "m": 3, - "n": 3, - "alpha": 6.0, - "a": [ 1.0, 2.0, 3.0, 0.0, 5.0, 6.0, 0.0, 0.0, 9.0 ], - "lda": 3, - "b": [ 10.0, 11.0, 12.0, 0.0, 14.0, 15.0, 0.0, 0.0, 18.0 ], - "ldb": 3, - "expected": [ 60, -10.8, -4.8, 0, 16.8, -1.20, 0, 0, 12 ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llntwotwo.json deleted file mode 100644 index 9c14a6ee9d2e..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llntwotwo.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "column-major", - "side": "left", - "uplo": "lower", - "transa": "none", - "diag": "non-unit", - "m": 2, - "n": 2, - "alpha": 6.0, - "a": [ 1.0, 3.0, 0.0, 4.0 ], - "lda": 2, - "b": [ 5.0, 7.0, 0.0, 8.0 ], - "ldb": 2, - "expected": [ 30.0, -12.0, 0.0, 12.0 ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llutwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llutwotwo.json deleted file mode 100644 index 502c83e8d0e7..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_llutwotwo.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "column-major", - "side": "left", - "uplo": "lower", - "transa": "transpose", - "diag": "non-unit", - "m": 2, - "n": 2, - "alpha": 6.0, - "a": [ 1.0, 3.0, 0.0, 4.0 ], - "lda": 2, - "b": [ 5.0, 7.0, 0.0, 8.0 ], - "ldb": 2, - "expected": [ -1.5, 10.5, -36, 12 ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_lunntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_lunntwotwo.json deleted file mode 100644 index bf4c5004e630..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_lunntwotwo.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "column-major", - "side": "left", - "uplo": "upper", - "transa": "none", - "diag": "non-unit", - "m": 2, - "n": 2, - "alpha": 6.0, - "a": [ 1.0, 0.0, 3.0, 4.0 ], - "lda": 2, - "b": [ 5.0, 0.0, 7.0, 8.0 ], - "ldb": 2, - "expected": [ 30.0, 0.0, 6.0, 12.0 ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_luutwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_luutwotwo.json deleted file mode 100644 index a521b020d715..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_luutwotwo.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "column-major", - "side": "left", - "uplo": "upper", - "transa": "transpose", - "diag": "non-unit", - "m": 2, - "n": 2, - "alpha": 6.0, - "a": [ 1.0, 0.0, 3.0, 4.0 ], - "lda": 2, - "b": [ 5.0, 0.0, 7.0, 8.0 ], - "ldb": 2, - "expected": [ 30.0, -22.5, 42, -19.5 ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_ndarray_llntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_ndarray_llntwotwo.json deleted file mode 100644 index be057598ee6a..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_ndarray_llntwotwo.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "order": "column-major", - "side": "left", - "uplo": "lower", - "transa": "none", - "diag": "non-unit", - "m": 2, - "n": 2, - "alpha": 6.0, - "a": [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ], - "lda": 2, - "b": [ 0.0, 0.0, 0.0, 5.0, 7.0, 0.0, 8.0 ], - "ldb": 2, - "expected": [ 0.0, 0.0, 0.0, 30.0, -12.0, 0.0, 12.0 ], - "offsetA": 2, - "offsetB": 3 -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_rlunntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_rlunntwotwo.json deleted file mode 100644 index d08baed06a35..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_rlunntwotwo.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "column-major", - "side": "right", - "uplo": "lower", - "transa": "none", - "diag": "non-unit", - "m": 2, - "n": 2, - "alpha": 6.0, - "a": [ 1.0, 3.0, 0.0, 4.0 ], - "lda": 2, - "b": [ 5.0, 7.0, 0.0, 8.0 ], - "ldb": 2, - "expected": [ 30, 6, 0, 12 ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_runntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_runntwotwo.json deleted file mode 100644 index 07e0203d49bb..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/column_major_runntwotwo.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "column-major", - "side": "right", - "uplo": "upper", - "transa": "none", - "diag": "non-unit", - "m": 2, - "n": 2, - "alpha": 6.0, - "a": [ 1.0, 0.0, 3.0, 4.0 ], - "lda": 2, - "b": [ 5.0, 0.0, 7.0, 8.0 ], - "ldb": 2, - "expected": [ 30, 0, -12, 12 ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llnthreethree.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llnthreethree.json deleted file mode 100644 index 2ea9b36bef09..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llnthreethree.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "row-major", - "side": "left", - "uplo": "lower", - "transa": "none", - "diag": "non-unit", - "m": 3, - "n": 3, - "alpha": 6.0, - "a": [ 1.0, 0.0, 0.0, 2.0, 5.0, 0.0, 3.0, 6.0, 9.0 ], - "lda": 3, - "b": [ 10.0, 0.0, 0.0, 11.0, 14.0, 0.0, 12.0, 15.0, 18.0 ], - "ldb": 3, - "expected": [ 60, 0.0, 0.0, -10.8, 16.8, 0.0, -4.8, -1.20, 12 ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llntwotwo.json deleted file mode 100644 index ab0bd985080a..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llntwotwo.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "row-major", - "side": "left", - "uplo": "lower", - "transa": "none", - "diag": "non-unit", - "m": 2, - "n": 2, - "alpha": 6.0, - "a": [ 1.0, 0.0, 3.0, 4.0 ], - "lda": 2, - "b": [ 5.0, 0.0, 7.0, 8.0 ], - "ldb": 2, - "expected": [ 30.0, 0.0, -12.0, 12.0 ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llutwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llutwotwo.json deleted file mode 100644 index eaf52eb1a5df..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_llutwotwo.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "row-major", - "side": "left", - "uplo": "lower", - "transa": "transpose", - "diag": "non-unit", - "m": 2, - "n": 2, - "alpha": 6.0, - "a": [ 1.0, 0.0, 3.0, 4.0 ], - "lda": 2, - "b": [ 5.0, 0.0, 7.0, 8.0 ], - "ldb": 2, - "expected": [ -1.5, -36, 10.5, 12 ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_lunntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_lunntwotwo.json deleted file mode 100644 index 29e9d2747590..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_lunntwotwo.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "row-major", - "side": "left", - "uplo": "upper", - "transa": "none", - "diag": "non-unit", - "m": 2, - "n": 2, - "alpha": 6.0, - "a": [ 1.0, 3.0, 0.0, 4.0 ], - "lda": 2, - "b": [ 5.0, 7.0, 0.0, 8.0 ], - "ldb": 2, - "expected": [ 30.0, 6.0, 0.0, 12.0 ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_luutwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_luutwotwo.json deleted file mode 100644 index a07c277b7182..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_luutwotwo.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "row-major", - "side": "left", - "uplo": "upper", - "transa": "transpose", - "diag": "non-unit", - "m": 2, - "n": 2, - "alpha": 6.0, - "a": [ 1.0, 3.0, 0.0, 4.0 ], - "lda": 2, - "b": [ 5.0, 7.0, 0.0, 8.0 ], - "ldb": 2, - "expected": [ 30.0, 42.0, -22.5, -19.5 ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_ndarray_llntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_ndarray_llntwotwo.json deleted file mode 100644 index 421069165c72..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_ndarray_llntwotwo.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "order": "row-major", - "side": "left", - "uplo": "upper", - "transa": "none", - "diag": "non-unit", - "m": 2, - "n": 2, - "alpha": 6.0, - "a": [ 0.0, 1.0, 3.0, 0.0, 4.0 ], - "lda": 2, - "b": [ 0.0, 0.0, 0.0, 0.0, 5.0, 7.0, 0.0, 8.0 ], - "ldb": 2, - "expected": [ 0.0, 0.0, 0.0, 0.0, 30, 6, 0, 12 ], - "offsetA": 1, - "offsetB": 4 -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_rlunntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_rlunntwotwo.json deleted file mode 100644 index 5d361b8f3a90..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_rlunntwotwo.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "row-major", - "side": "right", - "uplo": "lower", - "transa": "none", - "diag": "non-unit", - "m": 2, - "n": 2, - "alpha": 6.0, - "a": [ 1.0, 0.0, 3.0, 4.0 ], - "lda": 2, - "b": [ 5.0, 0.0, 7.0, 8.0 ], - "ldb": 2, - "expected": [ 30, 0, 6, 12 ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_runntwotwo.json b/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_runntwotwo.json deleted file mode 100644 index 3f1cdad02d02..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/fixtures/row_major_runntwotwo.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "row-major", - "side": "right", - "uplo": "upper", - "transa": "none", - "diag": "non-unit", - "m": 2, - "n": 2, - "alpha": 6.0, - "a": [ 1.0, 3.0, 0.0, 4.0 ], - "lda": 2, - "b": [ 5.0, 7.0, 0.0, 8.0 ], - "ldb": 2, - "expected": [ 30, -12, 0, 12 ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js index 6fe204d85ccd..fa7c7aac07f7 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js @@ -29,25 +29,6 @@ var abs = require( '@stdlib/math/base/special/abs' ); var dtrsm = require( './../lib/dtrsm.js' ); -// FIXTURES // - -var cllntwotwo = require( './fixtures/column_major_llntwotwo.json' ); -var cllutwotwo = require( './fixtures/column_major_llutwotwo.json' ); -var clunntwotwo = require( './fixtures/column_major_lunntwotwo.json' ); -var cluutwotwo = require( './fixtures/column_major_luutwotwo.json' ); -var crlunntwotwo = require( './fixtures/column_major_rlunntwotwo.json' ); -var crunntwotwo = require( './fixtures/column_major_runntwotwo.json' ); -var cllnthreethree = require( './fixtures/column_major_llnthreethree.json' ); - -var rllntwotwo = require( './fixtures/row_major_llntwotwo.json' ); -var rllutwotwo = require( './fixtures/row_major_llutwotwo.json' ); -var rlunntwotwo = require( './fixtures/row_major_lunntwotwo.json' ); -var rluutwotwo = require( './fixtures/row_major_luutwotwo.json' ); -var rrlunntwotwo = require( './fixtures/row_major_rlunntwotwo.json' ); -var rrunntwotwo = require( './fixtures/row_major_runntwotwo.json' ); -var rllnthreethree = require( './fixtures/row_major_llnthreethree.json' ); - - // FUNCTIONS // /** @@ -113,13 +94,15 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - dtrsm( value, "left", "upper", "no-transpose", "non-unit", 2, 2, 6.0, A, 2, B, 2 ); + dtrsm( value, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); }; } }); tape( 'the function throws an error if provided an invalid second argument', function test( t ) { var values; + var A; + var B; var i; values = [ @@ -129,6 +112,9 @@ tape( 'the function throws an error if provided an invalid second argument', fun 'boop' ]; + A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); + for ( i = 0; i < values.length; i++ ) { t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); } @@ -136,13 +122,15 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - dtrsm( clunntwotwo.order, value, clunntwotwo.uplo, clunntwotwo.transa, clunntwotwo.diag, clunntwotwo.m, clunntwotwo.n, clunntwotwo.alpha, new Float64Array( clunntwotwo.a ), clunntwotwo.lda, new Float64Array( clunntwotwo.b ), clunntwotwo.ldb ); + dtrsm( 'column-major', value, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); }; } }); tape( 'the function throws an error if provided an invalid third argument', function test( t ) { var values; + var A; + var B; var i; values = [ @@ -152,6 +140,9 @@ tape( 'the function throws an error if provided an invalid third argument', func 'boop' ]; + A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); + for ( i = 0; i < values.length; i++ ) { t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); } @@ -159,13 +150,15 @@ tape( 'the function throws an error if provided an invalid third argument', func function badValue( value ) { return function badValue() { - dtrsm( clunntwotwo.order, clunntwotwo.side, value, clunntwotwo.transa, clunntwotwo.diag, clunntwotwo.m, clunntwotwo.n, clunntwotwo.alpha, new Float64Array( clunntwotwo.a ), clunntwotwo.lda, new Float64Array( clunntwotwo.b ), clunntwotwo.ldb ); + dtrsm( 'column-major', 'left', value, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); }; } }); tape( 'the function throws an error if provided an invalid fourth argument', function test( t ) { var values; + var A; + var B; var i; values = [ @@ -175,6 +168,9 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun 'boop' ]; + A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); + for ( i = 0; i < values.length; i++ ) { t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); } @@ -182,13 +178,15 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun function badValue( value ) { return function badValue() { - dtrsm( clunntwotwo.order, clunntwotwo.side, clunntwotwo.uplo, value, clunntwotwo.diag, clunntwotwo.m, clunntwotwo.n, clunntwotwo.alpha, new Float64Array( clunntwotwo.a ), clunntwotwo.lda, new Float64Array( clunntwotwo.b ), clunntwotwo.ldb ); + dtrsm( 'column-major', 'left', 'upper', value, 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); }; } }); tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { var values; + var A; + var B; var i; values = [ @@ -198,6 +196,9 @@ tape( 'the function throws an error if provided an invalid fifth argument', func 'boop' ]; + A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); + for ( i = 0; i < values.length; i++ ) { t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); } @@ -205,7 +206,7 @@ tape( 'the function throws an error if provided an invalid fifth argument', func function badValue( value ) { return function badValue() { - dtrsm( clunntwotwo.order, clunntwotwo.side, clunntwotwo.uplo, clunntwotwo.transa, value, clunntwotwo.m, clunntwotwo.n, clunntwotwo.alpha, new Float64Array( clunntwotwo.a ), clunntwotwo.lda, new Float64Array( clunntwotwo.b ), clunntwotwo.ldb ); + dtrsm( 'column-major', 'left', 'upper', 'no-transpose', value, 2, 2, 6.0, A, 2, B, 2 ); }; } }); @@ -216,12 +217,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( cllntwotwo.a ); - B = new Float64Array( cllntwotwo.b ); + A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - expected = new Float64Array( cllntwotwo.expected ); + expected = new Float64Array( [ 30.0, -12.0, 0.0, 12.0 ] ); - out = dtrsm( cllntwotwo.order, cllntwotwo.side, cllntwotwo.uplo, cllntwotwo.transa, cllntwotwo.diag, cllntwotwo.m, cllntwotwo.n, cllntwotwo.alpha, A, cllntwotwo.lda, B, cllntwotwo.ldb ); + out = dtrsm( 'column-major', 'left', 'lower', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -234,12 +235,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( cllutwotwo.a ); - B = new Float64Array( cllutwotwo.b ); + A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - expected = new Float64Array( cllutwotwo.expected ); + expected = new Float64Array( [ -1.5, 10.5, -36, 12 ] ); - out = dtrsm( cllutwotwo.order, cllutwotwo.side, cllutwotwo.uplo, cllutwotwo.transa, cllutwotwo.diag, cllutwotwo.m, cllutwotwo.n, cllutwotwo.alpha, A, cllutwotwo.lda, B, cllutwotwo.ldb ); + out = dtrsm( 'column-major', 'left', 'lower', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -252,12 +253,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( clunntwotwo.a ); - B = new Float64Array( clunntwotwo.b ); + A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); - expected = new Float64Array( clunntwotwo.expected ); + expected = new Float64Array( [ 30.0, 0.0, 6.0, 12.0 ] ); - out = dtrsm( clunntwotwo.order, clunntwotwo.side, clunntwotwo.uplo, clunntwotwo.transa, clunntwotwo.diag, clunntwotwo.m, clunntwotwo.n, clunntwotwo.alpha, A, clunntwotwo.lda, B, clunntwotwo.ldb ); + out = dtrsm( 'column-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -270,12 +271,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( cluutwotwo.a ); - B = new Float64Array( cluutwotwo.b ); + A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); - expected = new Float64Array( cluutwotwo.expected ); + expected = new Float64Array( [ 30.0, -22.5, 42, -19.5 ] ); - out = dtrsm( cluutwotwo.order, cluutwotwo.side, cluutwotwo.uplo, cluutwotwo.transa, cluutwotwo.diag, cluutwotwo.m, cluutwotwo.n, cluutwotwo.alpha, A, cluutwotwo.lda, B, cluutwotwo.ldb ); + out = dtrsm( 'column-major', 'left', 'upper', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -288,12 +289,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( crlunntwotwo.a ); - B = new Float64Array( crlunntwotwo.b ); + A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - expected = new Float64Array( crlunntwotwo.expected ); + expected = new Float64Array( [ 30, 6, 0, 12 ] ); - out = dtrsm( crlunntwotwo.order, crlunntwotwo.side, crlunntwotwo.uplo, crlunntwotwo.transa, crlunntwotwo.diag, crlunntwotwo.m, crlunntwotwo.n, crlunntwotwo.alpha, A, crlunntwotwo.lda, B, crlunntwotwo.ldb ); + out = dtrsm( 'column-major', 'right', 'lower', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -306,12 +307,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( crunntwotwo.a ); - B = new Float64Array( crunntwotwo.b ); + A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); - expected = new Float64Array( crunntwotwo.expected ); + expected = new Float64Array( [ 30, 0, -12, 12 ] ); - out = dtrsm( crunntwotwo.order, crunntwotwo.side, crunntwotwo.uplo, crunntwotwo.transa, crunntwotwo.diag, crunntwotwo.m, crunntwotwo.n, crunntwotwo.alpha, A, crunntwotwo.lda, B, crunntwotwo.ldb ); + out = dtrsm( 'column-major', 'right', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -324,12 +325,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( rllntwotwo.a ); - B = new Float64Array( rllntwotwo.b ); + A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); - expected = new Float64Array( rllntwotwo.expected ); + expected = new Float64Array( [ 30.0, 0.0, -12.0, 12.0 ] ); - out = dtrsm( rllntwotwo.order, rllntwotwo.side, rllntwotwo.uplo, rllntwotwo.transa, rllntwotwo.diag, rllntwotwo.m, rllntwotwo.n, rllntwotwo.alpha, A, rllntwotwo.lda, B, rllntwotwo.ldb ); + out = dtrsm( 'row-major', 'left', 'lower', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -342,12 +343,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( rllutwotwo.a ); - B = new Float64Array( rllutwotwo.b ); + A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); - expected = new Float64Array( rllutwotwo.expected ); + expected = new Float64Array( [ -1.5, -36, 10.5, 12 ] ); - out = dtrsm( rllutwotwo.order, rllutwotwo.side, rllutwotwo.uplo, rllutwotwo.transa, rllutwotwo.diag, rllutwotwo.m, rllutwotwo.n, rllutwotwo.alpha, A, rllutwotwo.lda, B, rllutwotwo.ldb ); + out = dtrsm( 'row-major', 'left', 'lower', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -360,12 +361,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( rlunntwotwo.a ); - B = new Float64Array( rlunntwotwo.b ); + A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - expected = new Float64Array( rlunntwotwo.expected ); + expected = new Float64Array( [ 30.0, 6.0, 0.0, 12.0 ] ); - out = dtrsm( rlunntwotwo.order, rlunntwotwo.side, rlunntwotwo.uplo, rlunntwotwo.transa, rlunntwotwo.diag, rlunntwotwo.m, rlunntwotwo.n, rlunntwotwo.alpha, A, rlunntwotwo.lda, B, rlunntwotwo.ldb ); + out = dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -378,12 +379,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( rluutwotwo.a ); - B = new Float64Array( rluutwotwo.b ); + A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - expected = new Float64Array( rluutwotwo.expected ); + expected = new Float64Array( [ 30.0, 42.0, -22.5, -19.5 ] ); - out = dtrsm( rluutwotwo.order, rluutwotwo.side, rluutwotwo.uplo, rluutwotwo.transa, rluutwotwo.diag, rluutwotwo.m, rluutwotwo.n, rluutwotwo.alpha, A, rluutwotwo.lda, B, rluutwotwo.ldb ); + out = dtrsm( 'row-major', 'left', 'upper', 'transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -396,12 +397,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( rrlunntwotwo.a ); - B = new Float64Array( rrlunntwotwo.b ); + A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 0.0, 7.0, 8.0 ] ); - expected = new Float64Array( rrlunntwotwo.expected ); + expected = new Float64Array( [ 30, 0, 6, 12 ] ); - out = dtrsm( rrlunntwotwo.order, rrlunntwotwo.side, rrlunntwotwo.uplo, rrlunntwotwo.transa, rrlunntwotwo.diag, rrlunntwotwo.m, rrlunntwotwo.n, rrlunntwotwo.alpha, A, rrlunntwotwo.lda, B, rrlunntwotwo.ldb ); + out = dtrsm( 'row-major', 'right', 'lower', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -414,12 +415,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( rrunntwotwo.a ); - B = new Float64Array( rrunntwotwo.b ); + A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - expected = new Float64Array( rrunntwotwo.expected ); + expected = new Float64Array( [ 30, -12, 0, 12 ] ); - out = dtrsm( rrunntwotwo.order, rrunntwotwo.side, rrunntwotwo.uplo, rrunntwotwo.transa, rrunntwotwo.diag, rrunntwotwo.m, rrunntwotwo.n, rrunntwotwo.alpha, A, rrunntwotwo.lda, B, rrunntwotwo.ldb ); + out = dtrsm( 'row-major', 'right', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -432,12 +433,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( cllnthreethree.a ); - B = new Float64Array( cllnthreethree.b ); + A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 5.0, 6.0, 0.0, 0.0, 9.0 ] ); + B = new Float64Array( [ 10.0, 11.0, 12.0, 0.0, 14.0, 15.0, 0.0, 0.0, 18.0 ] ); - expected = new Float64Array( cllnthreethree.expected ); + expected = new Float64Array( [ 60, -10.8, -4.8, 0, 16.8, -1.20, 0, 0, 12 ] ); - out = dtrsm( cllnthreethree.order, cllnthreethree.side, cllnthreethree.uplo, cllnthreethree.transa, cllnthreethree.diag, cllnthreethree.m, cllnthreethree.n, cllnthreethree.alpha, A, cllnthreethree.lda, B, cllnthreethree.ldb ); + out = dtrsm( 'column-major', 'left', 'lower', 'no-transpose', 'non-unit', 3, 3, 6.0, A, 3, B, 3 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 10.0 ); @@ -450,12 +451,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( rllnthreethree.a ); - B = new Float64Array( rllnthreethree.b ); + A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 5.0, 0.0, 3.0, 6.0, 9.0 ] ); + B = new Float64Array( [ 10.0, 0.0, 0.0, 11.0, 14.0, 0.0, 12.0, 15.0, 18.0 ] ); - expected = new Float64Array( rllnthreethree.expected ); + expected = new Float64Array( [ 60, 0.0, 0.0, -10.8, 16.8, 0.0, -4.8, -1.20, 12 ] ); - out = dtrsm( rllnthreethree.order, rllnthreethree.side, rllnthreethree.uplo, rllnthreethree.transa, rllnthreethree.diag, rllnthreethree.m, rllnthreethree.n, rllnthreethree.alpha, A, rllnthreethree.lda, B, rllnthreethree.ldb ); + out = dtrsm( 'row-major', 'left', 'lower', 'no-transpose', 'non-unit', 3, 3, 6.0, A, 3, B, 3 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 10.0 ); From 17b26714a6582248b69ad97d94ac40505a01bd63 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Thu, 25 Jul 2024 10:58:47 +0530 Subject: [PATCH 25/33] refactor: remove fixtures from ndarray tests --- .../blas/base/dtrsm/test/test.ndarray.js | 77 +++++++++---------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js index 97ed955ebed1..3b0ff0a6b3e4 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js @@ -29,13 +29,6 @@ var abs = require( '@stdlib/math/base/special/abs' ); var dtrsm = require( './../lib/ndarray.js' ); -// FIXTURES // - -var cndllntwotwo = require( './fixtures/column_major_ndarray_llntwotwo.json' ); - -var rndllntwotwo = require( './fixtures/row_major_ndarray_llntwotwo.json' ); - - // FUNCTIONS // /** @@ -80,6 +73,8 @@ tape( 'the function has an arity of 16', function test( t ) { tape( 'the function throws an error if provided an invalid first argument', function test( t ) { var values; + var A; + var B; var i; values = [ @@ -89,6 +84,9 @@ tape( 'the function throws an error if provided an invalid first argument', func 'boop' ]; + A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); + B = new Float64Array( [ 0.0, 0.0, 0.0, 5.0, 7.0, 0.0, 8.0 ] ); + for ( i = 0; i < values.length; i++ ) { t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); } @@ -96,13 +94,15 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - dtrsm( value, cndllntwotwo.side, cndllntwotwo.uplo, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), 1, cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), 1, 1, cndllntwotwo.ldb, cndllntwotwo.offsetB ); + dtrsm( value, 'left', 'lower', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); }; } }); tape( 'the function throws an error if provided an invalid second argument', function test( t ) { var values; + var A; + var B; var i; values = [ @@ -112,6 +112,9 @@ tape( 'the function throws an error if provided an invalid second argument', fun 'boop' ]; + A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); + B = new Float64Array( [ 0.0, 0.0, 0.0, 5.0, 7.0, 0.0, 8.0 ] ); + for ( i = 0; i < values.length; i++ ) { t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); } @@ -119,13 +122,15 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - dtrsm( cndllntwotwo.order, value, cndllntwotwo.uplo, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), 1, cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), 1, cndllntwotwo.ldb, cndllntwotwo.offsetB ); + dtrsm( value, 'lower', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); }; } }); tape( 'the function throws an error if provided an invalid third argument', function test( t ) { var values; + var A; + var B; var i; values = [ @@ -135,6 +140,9 @@ tape( 'the function throws an error if provided an invalid third argument', func 'boop' ]; + A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); + B = new Float64Array( [ 0.0, 0.0, 0.0, 5.0, 7.0, 0.0, 8.0 ] ); + for ( i = 0; i < values.length; i++ ) { t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); } @@ -142,13 +150,15 @@ tape( 'the function throws an error if provided an invalid third argument', func function badValue( value ) { return function badValue() { - dtrsm( cndllntwotwo.order, cndllntwotwo.side, value, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), 1, cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), 1, cndllntwotwo.ldb, cndllntwotwo.offsetB ); + dtrsm( 'column-major', value, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); }; } }); tape( 'the function throws an error if provided an invalid fourth argument', function test( t ) { var values; + var A; + var B; var i; values = [ @@ -158,6 +168,9 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun 'boop' ]; + A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); + B = new Float64Array( [ 0.0, 0.0, 0.0, 5.0, 7.0, 0.0, 8.0 ] ); + for ( i = 0; i < values.length; i++ ) { t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); } @@ -165,13 +178,15 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun function badValue( value ) { return function badValue() { - dtrsm( cndllntwotwo.order, cndllntwotwo.side, cndllntwotwo.uplo, value, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), 1, cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), 1, cndllntwotwo.ldb, cndllntwotwo.offsetB ); + dtrsm( 'column-major', 'left', 'lower', value, 'non-unit', 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); }; } }); tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { var values; + var A; + var B; var i; values = [ @@ -181,6 +196,9 @@ tape( 'the function throws an error if provided an invalid fifth argument', func 'boop' ]; + A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); + B = new Float64Array( [ 0.0, 0.0, 0.0, 5.0, 7.0, 0.0, 8.0 ] ); + for ( i = 0; i < values.length; i++ ) { t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); } @@ -188,7 +206,7 @@ tape( 'the function throws an error if provided an invalid fifth argument', func function badValue( value ) { return function badValue() { - dtrsm( cndllntwotwo.order, cndllntwotwo.side, cndllntwotwo.uplo, cndllntwotwo.transa, value, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, new Float64Array( cndllntwotwo.a ), 1, cndllntwotwo.lda, cndllntwotwo.offsetA, new Float64Array( cndllntwotwo.b ), 1, cndllntwotwo.ldb, cndllntwotwo.offsetB ); + dtrsm( 'column-major', 'left', 'lower', 'no-transpose', value, 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); }; } }); @@ -199,12 +217,12 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( cndllntwotwo.a ); - B = new Float64Array( cndllntwotwo.b ); + A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); + B = new Float64Array( [ 0.0, 0.0, 0.0, 5.0, 7.0, 0.0, 8.0 ] ); - expected = new Float64Array( cndllntwotwo.expected ); + expected = new Float64Array( [ 0.0, 0.0, 0.0, 30.0, -12.0, 0.0, 12.0 ] ); - out = dtrsm( cndllntwotwo.order, cndllntwotwo.side, cndllntwotwo.uplo, cndllntwotwo.transa, cndllntwotwo.diag, cndllntwotwo.m, cndllntwotwo.n, cndllntwotwo.alpha, A, 1, cndllntwotwo.lda, cndllntwotwo.offsetA, B, 1, cndllntwotwo.ldb, cndllntwotwo.offsetB ); + out = dtrsm( 'column-major', 'left', 'lower', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -217,33 +235,14 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) var A; var B; - A = new Float64Array( rndllntwotwo.a ); - B = new Float64Array( rndllntwotwo.b ); + A = new Float64Array( [ 0.0, 1.0, 3.0, 0.0, 4.0 ] ); + B = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 5.0, 7.0, 0.0, 8.0 ] ); - expected = new Float64Array( rndllntwotwo.expected ); + expected = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 30, 6, 0, 12 ] ); - out = dtrsm( rndllntwotwo.order, rndllntwotwo.side, rndllntwotwo.uplo, rndllntwotwo.transa, rndllntwotwo.diag, rndllntwotwo.m, rndllntwotwo.n, rndllntwotwo.alpha, A, rndllntwotwo.lda, 1, rndllntwotwo.offsetA, B, rndllntwotwo.ldb, 1, rndllntwotwo.offsetB ); + out = dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 1, B, 2, 1, 4 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); t.end(); }); - -tape( 'the function supports complex access patterns ( row-major, strideA1 = , strideA2 = 2, strideB1 = , strideB2 = )', function test( t ) { - var expected; - var out; - var A; - var B; - - A = new Float64Array( [ 1.0, 999.0, 0.0, 999.0, 0.0, 2.0, 999.0, 5.0, 999.0, 0.0, 3.0, 999.0, 6.0, 999.0, 9.0 ] ); - B = new Float64Array( [ 10.0, 999.0, 0.0, 999.0, 0.0, 11.0, 999.0, 14.0, 999.0, 0.0, 12.0, 999.0, 15.0, 999.0, 18.0 ] ); - - expected =[ 60, 999.0, 0.0, 999.0, 0.0, -10.8, 999.0, 16.8, 999.0, 0.0, -4.8, 999.0, -1.20, 999.0, 12 ] - - out = dtrsm( 'row-major', 'left', 'lower', 'no-transpose', 'non-unit', 3, 3, 6, A, 3, 2, 0, B, 3, 2, 0 ); - console.log( out ); - t.strictEqual( out, B, 'returns expected value' ); - isApprox( t, B, expected, 10.0 ); - - t.end(); -}); From 9deb187b741853bc571bfa5890d15165a4b65d60 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Thu, 25 Jul 2024 19:44:26 +0530 Subject: [PATCH 26/33] refactor: docs/repl.txt --- lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt index a882614ed603..1e531607edf8 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt @@ -146,15 +146,14 @@ Examples -------- - // Standard usage: > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 3.0, 0.0, 4.0 ] ); > var B = new {{alias:@stdlib/array/float64}}( [ 5.0, 7.0, 0.0, 8.0 ] ); - > var ord = 'row-major'; - > var sd = 'left'; + > var o = 'row-major'; + > var s = 'left'; > var ul = 'upper'; > var ta = 'no-transpose'; > var dg = 'non-unit'; - > {{alias}}.ndarray( ord, sd, ul, ta, dg, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ) + > {{alias}}.ndarray( o, s, ul, ta, dg, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ) [ 30.0, 6.0, 0.0, 12.0 ] See Also From 5f3be1991f88971640a2f6fba24277bb8e98b36a Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Thu, 25 Jul 2024 20:05:48 +0530 Subject: [PATCH 27/33] chore: update description of tests --- .../blas/base/dtrsm/test/test.dtrsm.js | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js index fa7c7aac07f7..2cb37784a13a 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js @@ -211,7 +211,7 @@ tape( 'the function throws an error if provided an invalid fifth argument', func } }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves the matrix equation `B = alpha * inv( A ) * B` ( column-major, lower )', function test( t ) { var expected; var out; var A; @@ -229,7 +229,7 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves the matrix equation `B = alpha * inv( A^T ) * B` ( column-major, lower )', function test( t ) { var expected; var out; var A; @@ -247,7 +247,7 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves the matrix equation `B = alpha * inv( A ) * B` ( column-major, upper )', function test( t ) { var expected; var out; var A; @@ -265,7 +265,7 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves the matrix equation `B = alpha * inv( A^T ) * B` ( column-major, upper )', function test( t ) { var expected; var out; var A; @@ -283,7 +283,7 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves the matrix equation `B = alpha * B * inv( A )` ( column-major, lower )', function test( t ) { var expected; var out; var A; @@ -301,7 +301,7 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves the matrix equation `B = alpha * B * inv( A )` ( column-major, upper )', function test( t ) { var expected; var out; var A; @@ -319,7 +319,7 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves the matrix equation `B = alpha * inv( A ) * B` ( row-major, lower )', function test( t ) { var expected; var out; var A; @@ -337,7 +337,7 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves the matrix equation `B = alpha * inv( A^T ) * B` ( row-major, lower )', function test( t ) { var expected; var out; var A; @@ -355,7 +355,7 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves the matrix equation `B = alpha * inv( A ) * B` ( row-major, upper )', function test( t ) { var expected; var out; var A; @@ -373,7 +373,7 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves the matrix equation `B = alpha * inv( A^T ) * B` ( row-major, upper )', function test( t ) { var expected; var out; var A; @@ -391,7 +391,7 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves the matrix equation `B = alpha * B * inv( A )` ( row-major, lower )', function test( t ) { var expected; var out; var A; @@ -409,7 +409,7 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves the matrix equation `B = alpha * B * inv( A )` ( row-major, upper )', function test( t ) { var expected; var out; var A; @@ -427,7 +427,7 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function solves the matrix equation `B = alpha * inv( A ) * B` ( column-major, lower, n = 3, m = 3 )', function test( t ) { var expected; var out; var A; @@ -445,7 +445,7 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function solves the matrix equation `B = alpha * inv( A ) * B` ( row-major, lower, n = 3, m = 3 )', function test( t ) { var expected; var out; var A; From 2bae8132bd80a94be35b095a69fc8811c2dd8613 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Thu, 25 Jul 2024 20:06:15 +0530 Subject: [PATCH 28/33] chore: update description of ndarray tests --- .../@stdlib/blas/base/dtrsm/test/test.ndarray.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js index 3b0ff0a6b3e4..d4583ada5386 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable max-len */ + 'use strict'; @@ -211,7 +211,7 @@ tape( 'the function throws an error if provided an invalid fifth argument', func } }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (column-major)', function test( t ) { +tape( 'the function supports providing an offset to A & B ( column-major, lower )', function test( t ) { var expected; var out; var A; @@ -229,7 +229,7 @@ tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) t.end(); }); -tape( 'the function solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A) = A` or `op( A ) = A**T`. The matrix `X` is overwritten on `B` (row-major)', function test( t ) { +tape( 'the function supports providing an offset to A & B ( row-major, upper )', function test( t ) { var expected; var out; var A; From b50078f20a2048daab26b40bc57d3269827ad265 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Thu, 25 Jul 2024 20:25:34 +0530 Subject: [PATCH 29/33] test: add tests for complex access patterns --- .../blas/base/dtrsm/test/test.ndarray.js | 92 ++++++++++++++++++- 1 file changed, 91 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js index d4583ada5386..c8ce37151807 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js @@ -16,7 +16,7 @@ * limitations under the License. */ - +/* eslint-disable max-len */ 'use strict'; @@ -246,3 +246,93 @@ tape( 'the function supports providing an offset to A & B ( row-major, upper )', t.end(); }); + +tape( 'the function supports accessing accessing arrays in a non contigous order of columns ( row-major, upper )', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( [ 999.9, 1.0, 999.9, 3.0, 0.0, 999.9, 4.0 ] ); + B = new Float64Array( [ 999.9, 999.9, 999.9, 999.9, 5.0, 999.9, 7.0, 0.0, 999.9, 8.0 ] ); + + expected = new Float64Array( [ 999.9, 999.9, 999.9, 999.9, 30, 999.9, 6, 0, 999.9, 12 ] ); + + out = dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 3, 2, 1, B, 3, 2, 4 ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports accessing accessing arrays in a non contigous order of columns & rows ( row-major, upper )', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( [ 999.9, 1.0, 999.9, 3.0, 999.9, 999.9, 999.9, 0.0, 999.9, 4.0 ] ); + B = new Float64Array( [ 999.9, 999.9, 999.9, 999.9, 5.0, 999.9, 7.0, 999.9, 999.9, 999.9, 0.0, 999.9, 8.0 ] ); + + expected = new Float64Array( [ 999.9, 999.9, 999.9, 999.9, 30, 999.9, 6, 999.9, 999.9, 999.9, 0, 999.9, 12 ] ); + + out = dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 6, 2, 1, B, 6, 2, 4 ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports complex and different access patterns for both A and B ( row-major, upper )', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( [ 999.9, 1.0, 999.9, 3.0, 999.9, 999.9, 999.9, 0.0, 999.9, 4.0 ] ); + B = new Float64Array( [ 999.9, 999.9, 999.9, 999.9, 5.0, 999.9, 999.9, 7.0, 999.9, 999.9, 999.9, 999.9, 0.0, 999.9, 999.9, 8.0 ] ); + + expected = new Float64Array( [ 999.9, 999.9, 999.9, 999.9, 30, 999.9, 999.9, 6, 999.9, 999.9, 999.9, 999.9, 0, 999.9, 999.9, 12 ] ); + + out = dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 6, 2, 1, B, 8, 3, 4 ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports accessing elements in reverser order ( row-major, upper )', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( [ 4.0, 999.9, 0.0, 999.9, 999.9, 999.9, 3.0, 999.9, 1.0 ] ); + B = new Float64Array( [ 8.0, 999.9, 999.9, 0.0, 999.9, 999.9, 999.9, 999.9, 7.0, 999.9, 999.9, 5.0 ] ); + + expected = new Float64Array( [ 12, 999.9, 999.9, 0, 999.9, 999.9, 999.9, 999.9, 6, 999.9, 999.9, 30 ] ); + + out = dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, -6, -2, 8, B, -8, -3, 11 ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports accessing elements of both arrays in different order ( row-major, upper )', function test( t ) { + var expected; + var out; + var A; + var B; + + A = new Float64Array( [ 1.0, 999.9, 3.0, 999.9, 999.9, 999.9, 0.0, 999.9, 4.0 ] ); + B = new Float64Array( [ 8.0, 999.9, 999.9, 0.0, 999.9, 999.9, 999.9, 999.9, 7.0, 999.9, 999.9, 5.0 ] ); + + expected = new Float64Array( [ 12, 999.9, 999.9, 0, 999.9, 999.9, 999.9, 999.9, 6, 999.9, 999.9, 30 ] ); + + out = dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 6, 2, 0, B, -8, -3, 11 ); + t.strictEqual( out, B, 'returns expected value' ); + isApprox( t, B, expected, 2.0 ); + + t.end(); +}); From 7e295dec77dcbaefbe66d2505fd180fd193e4282 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Thu, 25 Jul 2024 20:26:56 +0530 Subject: [PATCH 30/33] fix: incorrect spelling of contiguous --- lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js index c8ce37151807..d6bcca0f7767 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js @@ -247,7 +247,7 @@ tape( 'the function supports providing an offset to A & B ( row-major, upper )', t.end(); }); -tape( 'the function supports accessing accessing arrays in a non contigous order of columns ( row-major, upper )', function test( t ) { +tape( 'the function supports accessing accessing arrays in a non contiguous order of columns ( row-major, upper )', function test( t ) { var expected; var out; var A; @@ -265,7 +265,7 @@ tape( 'the function supports accessing accessing arrays in a non contigous order t.end(); }); -tape( 'the function supports accessing accessing arrays in a non contigous order of columns & rows ( row-major, upper )', function test( t ) { +tape( 'the function supports accessing accessing arrays in a non contiguous order of columns & rows ( row-major, upper )', function test( t ) { var expected; var out; var A; From 6585a6a8141c3fc558adeb4c2b853365345bbc27 Mon Sep 17 00:00:00 2001 From: Pranav <85227306+Pranavchiku@users.noreply.github.com> Date: Thu, 25 Jul 2024 20:42:24 +0530 Subject: [PATCH 31/33] chore: apply suggestions from code review Signed-off-by: Pranav <85227306+Pranavchiku@users.noreply.github.com> --- .../@stdlib/blas/base/dtrsm/docs/repl.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt index 1e531607edf8..2500cf6f97bf 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt @@ -2,8 +2,8 @@ {{alias}}( ord, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, - or non-unit, upper or lower triangular matrix and `op( A )` is one of - `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. + or non-unit, upper or lower triangular matrix and `op(A)` is one of + `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`. Indexing is relative to the first index. To introduce an offset, use typed array views. @@ -17,7 +17,7 @@ either 'row-major' or 'column-major'. side: string - Specifies whether `op( A )` appears on the left or right side of `X`. + Specifies whether `op(A)` appears on the left or right side of `X`. Must be either 'left' or 'right'. uplo: string @@ -25,7 +25,7 @@ supplied. Must be either 'upper' or 'lower'. transa: string - Specifies the form of `op( A )` to be used in the matrix + Specifies the form of `op(A)` to be used in the matrix multiplication. diag: string @@ -77,8 +77,8 @@ Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` using alternative indexing semantics where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower - triangular matrix and `op( A )` is one of `op( A ) = A` or - `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. + triangular matrix and `op(A)` is one of `op(A) = A` or + `op(A) = A^T`. The matrix `X` is overwritten on `B`. While typed array views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting @@ -91,7 +91,7 @@ either 'row-major' or 'column-major'. s: string - Specifies whether `op( A )` appears on the left or right side of `X`. + Specifies whether `op(A)` appears on the left or right side of `X`. Must be either 'left' or 'right'. ul: string @@ -99,7 +99,7 @@ supplied. Must be either 'upper' or 'lower'. ta: string - Specifies the form of `op( A )` to be used in the matrix + Specifies the form of `op(A)` to be used in the matrix multiplication. d: string From 03532e00cea29d03e13e7bbee11b2d7a163b7bd6 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Thu, 8 Aug 2024 16:34:38 +0530 Subject: [PATCH 32/33] refactor: base implementation and consequent changes --- .../@stdlib/blas/base/dtrsm/README.md | 17 +- .../base/dtrsm/benchmark/benchmark.ndarray.js | 2 +- .../@stdlib/blas/base/dtrsm/docs/repl.txt | 9 +- .../blas/base/dtrsm/docs/types/index.d.ts | 7 +- .../blas/base/dtrsm/docs/types/test.ts | 306 +++++++++--------- .../@stdlib/blas/base/dtrsm/lib/base.js | 14 +- .../@stdlib/blas/base/dtrsm/lib/dtrsm.js | 2 +- .../@stdlib/blas/base/dtrsm/lib/index.js | 4 +- .../@stdlib/blas/base/dtrsm/lib/ndarray.js | 28 +- .../@stdlib/blas/base/dtrsm/test/test.js | 1 + .../blas/base/dtrsm/test/test.ndarray.js | 54 +--- 11 files changed, 201 insertions(+), 243 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md index d5800d25a75e..9e9e046e48a8 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/README.md @@ -78,7 +78,7 @@ dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A1, // B0 => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] ``` -#### dtrsm.ndarray( o, s, ul, t, d, m, n, α, A, sa1, sa2, oa, B, sb1, sb2, ob ) +#### dtrsm.ndarray( s, ul, t, d, m, n, α, A, sa1, sa2, oa, B, sb1, sb2, ob ) Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` using alternative indexing semantics and where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`. @@ -88,15 +88,24 @@ var Float64Array = require( '@stdlib/array/float64' ); A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); -dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); +dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] ``` -The function has the following additional parameters: +The function has the following parameters: +- **side**: specifies whether `op( A )` appears on the left or right side of `X`. +- **uplo**: specifies whether the upper or lower triangular part of the matrix `A` is supplied. +- **transa**: specifies the form of `op( A )` to be used in the matrix multiplication. +- **diag**: specifies whether or not `A` is unit triangular. +- **m**: number of rows in `B`. +- **n**: number of columns in `B`. +- **alpha**: scalar constant. +- **A**: input matrix `A`. - **sa1**: stride of the first dimension of `A`. - **sa2**: stride of the second dimension of `A`. - **oa**: starting index for `A`. +- **B**: input matrix `B`. - **sb1**: stride of the first dimension of `B`. - **sb2**: stride of the second dimension of `B`. - **ob**: starting index for `B`. @@ -109,7 +118,7 @@ var Float64Array = require( '@stdlib/array/float64' ); A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); -dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); +dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] ``` diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js index cba76a040360..19356e321165 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/benchmark/benchmark.ndarray.js @@ -62,7 +62,7 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - z = dtrsm( 'column-major', 'left', 'upper', 'no-transpose', 'non-unit', N, N, 1.0, A, 1, N, 0, B, 1, N, 0 ); + z = dtrsm( 'left', 'upper', 'no-transpose', 'non-unit', N, N, 1.0, A, 1, N, 0, B, 1, N, 0 ); if ( isnan( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt index 1e531607edf8..515650bd00f2 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/repl.txt @@ -73,7 +73,7 @@ [ 30.0, 6.0, 0.0, 12.0 ] -{{alias}}.ndarray( o, s, ul, ta, d, m, n, α, A, sa1, sa2, oa, B, sb1, sb2, ob ) +{{alias}}.ndarray( s, ul, ta, d, m, n, α, A, sa1, sa2, oa, B, sb1, sb2, ob ) Solves matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` using alternative indexing semantics where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower @@ -86,10 +86,6 @@ Parameters ---------- - o: string - Row-major (C-style) or column-major (Fortran-style) order. Must be - either 'row-major' or 'column-major'. - s: string Specifies whether `op( A )` appears on the left or right side of `X`. Must be either 'left' or 'right'. @@ -148,12 +144,11 @@ -------- > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 3.0, 0.0, 4.0 ] ); > var B = new {{alias:@stdlib/array/float64}}( [ 5.0, 7.0, 0.0, 8.0 ] ); - > var o = 'row-major'; > var s = 'left'; > var ul = 'upper'; > var ta = 'no-transpose'; > var dg = 'non-unit'; - > {{alias}}.ndarray( o, s, ul, ta, dg, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ) + > {{alias}}.ndarray( s, ul, ta, dg, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ) [ 30.0, 6.0, 0.0, 12.0 ] See Also diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts index 038cde5ef35f..d6c753e49f89 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/index.d.ts @@ -57,7 +57,6 @@ interface Routine { /** * Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`. * - * @param order - storage layout of `A` and `B` * @param side - specifies whether `op( A )` appears on the left or right of `X` * @param uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied * @param transa - specifies the form of `op( A )` to be used in matrix multiplication @@ -81,10 +80,10 @@ interface Routine { * var A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); * - * dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); + * dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); * // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] */ - ndarray( order: Layout, side: OperationSide, uplo: MatrixTriangle, transa: TransposeOperation, diag: DiagonalType, m: number, n: number, alpha: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number, B: Float64Array, strideB1: number, strideB2: number, offsetB: number ): Float64Array; + ndarray( side: OperationSide, uplo: MatrixTriangle, transa: TransposeOperation, diag: DiagonalType, m: number, n: number, alpha: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number, B: Float64Array, strideB1: number, strideB2: number, offsetB: number ): Float64Array; } /** @@ -119,7 +118,7 @@ interface Routine { * var A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); +* dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); * // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] */ declare var dtrsm: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts index fdd4cb68fea4..b9290b592791 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/docs/types/test.ts @@ -234,7 +234,7 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectType Float64Array + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectType Float64Array } // The compiler throws an error if the function is provided a first argument which is not a string... @@ -242,14 +242,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 5, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( true, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( false, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( null, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( void 0, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( [], 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( {}, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( ( x: number ): number => x, 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 5, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( true, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( false, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( null, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( void 0, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( [], 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( {}, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( ( x: number ): number => x, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a string... @@ -257,14 +257,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 5, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', true, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', false, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', null, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', void 0, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', [], 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', {}, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', ( x: number ): number => x, 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 5, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', true, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', false, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', null, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', void 0, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', [], 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', {}, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', ( x: number ): number => x, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a third argument which is not a string... @@ -272,14 +272,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 5, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', true, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', false, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', null, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', void 0, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', [], 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', {}, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', ( x: number ): number => x, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 5, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', true, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', false, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', null, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', void 0, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', [], 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', {}, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', ( x: number ): number => x, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a fourth argument which is not a string... @@ -287,29 +287,29 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 5, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', true, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', false, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', null, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', void 0, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', [], 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', {}, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', ( x: number ): number => x, 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 5, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', true, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', false, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', null, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', void 0, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', [], 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', {}, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', ( x: number ): number => x, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a fifth argument which is not a string... +// The compiler throws an error if the function is provided a fifth argument which is not a number... { const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 5, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', true, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', false, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', null, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', void 0, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', [], 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', {}, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', ( x: number ): number => x, 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', '5', 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', true, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', false, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', null, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', void 0, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', [], 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', {}, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', ( x: number ): number => x, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a sixth argument which is not a number... @@ -317,14 +317,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', '5', 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', true, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', false, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', null, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', void 0, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', [], 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', {}, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', ( x: number ): number => x, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, '5', 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, true, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, false, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, null, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, void 0, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, [], 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, {}, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, ( x: number ): number => x, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a seventh argument which is not a number... @@ -332,44 +332,44 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, '5', 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, true, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, false, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, null, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, void 0, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, [], 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, {}, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, ( x: number ): number => x, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, '5', A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, true, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, false, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, null, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, void 0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, [], A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, {}, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, ( x: number ): number => x, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided an eighth argument which is not a number... +// The compiler throws an error if the function is provided an eighth argument which is not a Float64Array... { - const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, '5', A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, true, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, false, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, null, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, void 0, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, [], A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, {}, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, ( x: number ): number => x, A, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, '5', 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, 5, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, true, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, false, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, null, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, void 0, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, [], 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, {}, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, ( x: number ): number => x, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a ninth argument which is not a Float64Array... +// The compiler throws an error if the function is provided a ninth argument which is not a number... { + const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, '5', 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, 5, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, true, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, false, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, null, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, void 0, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, [], 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, {}, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, ( x: number ): number => x, 2, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, '5', 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, true, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, false, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, null, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, void 0, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, [], 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, {}, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, ( x: number ): number => x, 1, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a tenth argument which is not a number... @@ -377,14 +377,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, '5', 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, true, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, false, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, null, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, void 0, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, [], 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, {}, 1, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, ( x: number ): number => x, 1, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, '5', 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, true, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, false, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, null, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, void 0, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, [], 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, {}, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, ( x: number ): number => x, 0, B, 2, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided an eleventh argument which is not a number... @@ -392,44 +392,44 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, '5', 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, true, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, false, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, null, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, void 0, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, [], 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, {}, 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, ( x: number ): number => x, 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, '5', B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, true, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, false, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, null, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, void 0, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, [], B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, {}, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, ( x: number ): number => x, B, 2, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a twelfth argument which is not a number... +// The compiler throws an error if the function is provided a twelfth argument which is not a Float64Array... { const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); - const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, '5', B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, true, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, false, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, null, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, void 0, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, [], B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, {}, B, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, ( x: number ): number => x, B, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, '5', 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, 5, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, true, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, false, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, null, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, void 0, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, [], 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, {}, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, ( x: number ): number => x, 2, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a thirteenth argument which is not a Float64Array... +// The compiler throws an error if the function is provided a thirteenth argument which is not a number... { const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); + const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, '5', 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, 5, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, true, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, false, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, null, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, void 0, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, [], 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, {}, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, ( x: number ): number => x, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, '5', 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, true, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, false, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, null, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, void 0, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, [], 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, {}, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, ( x: number ): number => x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a fourteenth argument which is not a number... @@ -437,14 +437,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, '5', 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, true, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, false, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, null, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, void 0, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, [], 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, {}, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, ( x: number ): number => x, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, '5', 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, true, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, false, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, null, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, void 0, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, [], 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, {}, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, ( x: number ): number => x, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a fifteenth argument which is not a number... @@ -452,29 +452,14 @@ import dtrsm = require( './index' ); const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, '5', 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, true, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, false, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, null, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, void 0, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, [], 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, {}, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a sixteenth argument which is not a number... -{ - const A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); - const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); - - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, '5' ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, true ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, false ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, null ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, void 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, [] ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, {} ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, ( x: number ): number => x ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, '5' ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, true ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, false ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, null ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, void 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, [] ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, {} ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... @@ -483,20 +468,19 @@ import dtrsm = require( './index' ); const B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); dtrsm.ndarray(); // $ExpectError - dtrsm.ndarray( 'row-major' ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left' ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper' ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose' ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit' ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1 ); // $ExpectError - dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0, 10 ); // $ExpectError + dtrsm.ndarray( 'left' ); // $ExpectError + dtrsm.ndarray( 'left', 'upper' ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose' ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit' ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1 ); // $ExpectError + dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0, 10 ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js index 06c6cb31095f..e1a6a870c9f8 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/base.js @@ -16,17 +16,21 @@ * limitations under the License. */ -/* eslint-disable max-len, max-statements, max-depth */ +/* eslint-disable max-len, max-statements, max-depth, max-lines-per-function */ 'use strict'; +// MODULES // + +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); + + // MAIN // /** * Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`. * * @private -* @param {string} order - storage layout of `A` and `B` * @param {string} side - specifies whether `op( A )` appears on the left or right of `X` * @param {string} uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied * @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication @@ -50,10 +54,10 @@ * var A = new Float64Array( [ 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); +* dtrsm( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 ); * // B => [ 30.0, 6.0, 0.0, 12.0 ] */ -function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ) { // eslint-disable-line max-params +function dtrsm( side, uplo, transa, diag, m, n, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ) { // eslint-disable-line max-params var nounit; var lside; var upper; @@ -73,7 +77,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strid if ( m === 0 || n === 0 ) { return B; } - if ( order === 'row-major' ) { + if ( isRowMajor( [ strideA1, strideA2 ] ) ) { lside = !lside; upper = !upper; tmp = strideA1; diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js index c44d71669480..b314c3a0958e 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/dtrsm.js @@ -93,7 +93,7 @@ function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, LDA, B, LDB ) { sb1 = LDB; sb2 = 1; } - return base( order, side, uplo, transa, diag, m, n, alpha, A, sa1, sa2, 0, B, sb1, sb2, 0 ); // eslint-disable-line max-len + return base( side, uplo, transa, diag, m, n, alpha, A, sa1, sa2, 0, B, sb1, sb2, 0 ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js index 06d7306cd467..4f14487d8202 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* BLAS routine to solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are m by n matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op( A )` is one of `op( A ) = A` or `op( A ) = A ** T`. The matrix `X` is overwritten on `B`. +* BLAS routine to solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`. * * @module @stdlib/blas/base/dtrsm * @@ -40,7 +40,7 @@ * var A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm.ndarray( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); +* dtrsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); * // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] */ diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js index 4c49b84c974a..ec247045b44f 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/lib/ndarray.js @@ -20,7 +20,6 @@ // MODULES // -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); var isOperationSide = require( '@stdlib/blas/base/assert/is-operation-side' ); var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); @@ -34,7 +33,6 @@ var base = require( './base.js' ); /** * Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`. * -* @param {string} order - storage layout of `A` and `B` * @param {string} side - specifies whether `op( A )` appears on the left or right of `X` * @param {string} uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied * @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication @@ -50,11 +48,10 @@ var base = require( './base.js' ); * @param {integer} strideB1 - stride of the first dimension of `B` * @param {integer} strideB2 - stride of the second dimension of `B` * @param {NonNegativeInteger} offsetB - starting index for `B` -* @throws {TypeError} first argument must be a valid order -* @throws {TypeError} second argument must be a valid side -* @throws {TypeError} third argument must specify whether the lower or upper triangular matrix is supplied. -* @throws {TypeError} fourth argument must specify correct transpose operation -* @throws {TypeError} fifth argument must specify whether the matrix is unit triangular or not +* @throws {TypeError} first argument must be a valid side +* @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied. +* @throws {TypeError} third argument must specify correct transpose operation +* @throws {TypeError} fourth argument must specify whether the matrix is unit triangular or not * @returns {Float64Array} `B` * * @example @@ -63,26 +60,23 @@ var base = require( './base.js' ); * var A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); * var B = new Float64Array( [ 0.0, 5.0, 7.0, 0.0, 8.0 ] ); * -* dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); +* dtrsm( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 ); * // B => [ 0.0, 30.0, 6.0, 0.0, 12.0 ] */ -function dtrsm( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ) { // eslint-disable-line max-len, max-params - if ( !isLayout( order ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); - } +function dtrsm( side, uplo, transa, diag, m, n, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ) { // eslint-disable-line max-len, max-params if ( !isOperationSide( side ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be a valid side. Value: `%s`.', side ) ); + throw new TypeError( format( 'invalid argument. First argument must be a valid side. Value: `%s`.', side ) ); } if ( !isMatrixTriangle( uplo ) ) { - throw new TypeError( format( 'invalid argument. Thirds argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); + throw new TypeError( format( 'invalid argument. Second argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); } if ( !isTransposeOperation( transa ) ) { - throw new TypeError( format( 'invalid argument. Fourth argument must specify correct transpose operation. Value: `%s`.', transa ) ); + throw new TypeError( format( 'invalid argument. Third argument must specify correct transpose operation. Value: `%s`.', transa ) ); } if ( !isDiagonalType( diag ) ) { - throw new TypeError( format( 'invalid argument. Fifth argument must specify whether the matrix is unit triangular or not. Value: `%s`.', diag ) ); + throw new TypeError( format( 'invalid argument. Fourth argument must specify whether the matrix is unit triangular or not. Value: `%s`.', diag ) ); } - return base( order, side, uplo, transa, diag, m, n, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ); // eslint-disable-line max-len + return base( side, uplo, transa, diag, m, n, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.js index 9e9b3fb18708..a56d939c278a 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.js @@ -1,3 +1,4 @@ + /** * @license Apache-2.0 * diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js index d6bcca0f7767..2743ff8f8e56 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js @@ -66,8 +66,8 @@ tape( 'main export is a function', function test( t ) { t.end(); }); -tape( 'the function has an arity of 16', function test( t ) { - t.strictEqual( dtrsm.length, 16, 'returns expected value' ); +tape( 'the function has an arity of 15', function test( t ) { + t.strictEqual( dtrsm.length, 15, 'returns expected value' ); t.end(); }); @@ -94,7 +94,7 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - dtrsm( value, 'left', 'lower', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); + dtrsm( value, 'lower', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); }; } }); @@ -122,7 +122,7 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - dtrsm( value, 'lower', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); + dtrsm( 'left', value, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); }; } }); @@ -150,7 +150,7 @@ tape( 'the function throws an error if provided an invalid third argument', func function badValue( value ) { return function badValue() { - dtrsm( 'column-major', value, 'no-transpose', 'non-unit', 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); + dtrsm( 'left', 'lower', value, 'non-unit', 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); }; } }); @@ -178,35 +178,7 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun function badValue( value ) { return function badValue() { - dtrsm( 'column-major', 'left', 'lower', value, 'non-unit', 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); - }; - } -}); - -tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { - var values; - var A; - var B; - var i; - - values = [ - 'foo', - 'bar', - 'beep', - 'boop' - ]; - - A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); - B = new Float64Array( [ 0.0, 0.0, 0.0, 5.0, 7.0, 0.0, 8.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() { - dtrsm( 'column-major', 'left', 'lower', 'no-transpose', value, 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); + dtrsm( 'left', 'lower', 'no-transpose', value, 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); }; } }); @@ -222,7 +194,7 @@ tape( 'the function supports providing an offset to A & B ( column-major, lower expected = new Float64Array( [ 0.0, 0.0, 0.0, 30.0, -12.0, 0.0, 12.0 ] ); - out = dtrsm( 'column-major', 'left', 'lower', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); + out = dtrsm( 'left', 'lower', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 1, 2, 2, B, 1, 2, 3 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -240,7 +212,7 @@ tape( 'the function supports providing an offset to A & B ( row-major, upper )', expected = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 30, 6, 0, 12 ] ); - out = dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 1, B, 2, 1, 4 ); + out = dtrsm( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 1, B, 2, 1, 4 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -258,7 +230,7 @@ tape( 'the function supports accessing accessing arrays in a non contiguous orde expected = new Float64Array( [ 999.9, 999.9, 999.9, 999.9, 30, 999.9, 6, 0, 999.9, 12 ] ); - out = dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 3, 2, 1, B, 3, 2, 4 ); + out = dtrsm( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 3, 2, 1, B, 3, 2, 4 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -276,7 +248,7 @@ tape( 'the function supports accessing accessing arrays in a non contiguous orde expected = new Float64Array( [ 999.9, 999.9, 999.9, 999.9, 30, 999.9, 6, 999.9, 999.9, 999.9, 0, 999.9, 12 ] ); - out = dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 6, 2, 1, B, 6, 2, 4 ); + out = dtrsm( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 6, 2, 1, B, 6, 2, 4 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -294,7 +266,7 @@ tape( 'the function supports complex and different access patterns for both A an expected = new Float64Array( [ 999.9, 999.9, 999.9, 999.9, 30, 999.9, 999.9, 6, 999.9, 999.9, 999.9, 999.9, 0, 999.9, 999.9, 12 ] ); - out = dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 6, 2, 1, B, 8, 3, 4 ); + out = dtrsm( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 6, 2, 1, B, 8, 3, 4 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -312,7 +284,7 @@ tape( 'the function supports accessing elements in reverser order ( row-major, u expected = new Float64Array( [ 12, 999.9, 999.9, 0, 999.9, 999.9, 999.9, 999.9, 6, 999.9, 999.9, 30 ] ); - out = dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, -6, -2, 8, B, -8, -3, 11 ); + out = dtrsm( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, -6, -2, 8, B, -8, -3, 11 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); @@ -330,7 +302,7 @@ tape( 'the function supports accessing elements of both arrays in different orde expected = new Float64Array( [ 12, 999.9, 999.9, 0, 999.9, 999.9, 999.9, 999.9, 6, 999.9, 999.9, 30 ] ); - out = dtrsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 6, 2, 0, B, -8, -3, 11 ); + out = dtrsm( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 6, 2, 0, B, -8, -3, 11 ); t.strictEqual( out, B, 'returns expected value' ); isApprox( t, B, expected, 2.0 ); From d0183d332bb2e87984471564ce1f0c3efb6afa0d Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Thu, 8 Aug 2024 16:36:05 +0530 Subject: [PATCH 33/33] test: add more values --- .../blas/base/dtrsm/test/test.dtrsm.js | 55 +++++++++++++++++-- .../blas/base/dtrsm/test/test.ndarray.js | 44 +++++++++++++-- 2 files changed, 90 insertions(+), 9 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js index 2cb37784a13a..b56f9a0b04b1 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.dtrsm.js @@ -81,7 +81,16 @@ tape( 'the function throws an error if provided an invalid first argument', func 'foo', 'bar', 'beep', - 'boop' + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} ]; A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); @@ -109,7 +118,16 @@ tape( 'the function throws an error if provided an invalid second argument', fun 'foo', 'bar', 'beep', - 'boop' + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} ]; A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); @@ -137,7 +155,16 @@ tape( 'the function throws an error if provided an invalid third argument', func 'foo', 'bar', 'beep', - 'boop' + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} ]; A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); @@ -165,7 +192,16 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun 'foo', 'bar', 'beep', - 'boop' + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} ]; A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); @@ -193,7 +229,16 @@ tape( 'the function throws an error if provided an invalid fifth argument', func 'foo', 'bar', 'beep', - 'boop' + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} ]; A = new Float64Array( [ 1.0, 0.0, 3.0, 4.0 ] ); diff --git a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js index 2743ff8f8e56..3375d42e3586 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrsm/test/test.ndarray.js @@ -81,7 +81,16 @@ tape( 'the function throws an error if provided an invalid first argument', func 'foo', 'bar', 'beep', - 'boop' + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} ]; A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); @@ -109,7 +118,16 @@ tape( 'the function throws an error if provided an invalid second argument', fun 'foo', 'bar', 'beep', - 'boop' + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} ]; A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); @@ -137,7 +155,16 @@ tape( 'the function throws an error if provided an invalid third argument', func 'foo', 'bar', 'beep', - 'boop' + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} ]; A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] ); @@ -165,7 +192,16 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun 'foo', 'bar', 'beep', - 'boop' + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} ]; A = new Float64Array( [ 0.0, 0.0, 1.0, 3.0, 0.0, 4.0 ] );