diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.js b/lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.js index 6bb253c98777..d0b5711d5c16 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.js @@ -22,7 +22,7 @@ var max = require( '@stdlib/math/base/special/fast/max' ); var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); -var isMatrixTranspose = require( '@stdlib/blas/base/assert/is-transpose-operation' ); +var resolveStr = require( '@stdlib/blas/base/transpose-operation-resolve-str' ); var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); var format = require( '@stdlib/string/format' ); @@ -35,8 +35,8 @@ var base = require( './base.js' ); * Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by `N` matrix. * * @param {string} order - storage layout -* @param {string} transA - specifies whether `A` should be transposed, conjugate-transposed, or not transposed -* @param {string} transB - specifies whether `B` should be transposed, conjugate-transposed, or not transposed +* @param {(integer|string)} transA - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {(integer|string)} transB - specifies whether `B` should be transposed, conjugate-transposed, or not transposed * @param {NonNegativeInteger} M - number of rows in the matrix `op(A)` and in the matrix `C` * @param {NonNegativeInteger} N - number of columns in the matrix `op(B)` and in the matrix `C` * @param {NonNegativeInteger} K - number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)` @@ -81,14 +81,18 @@ function dgemm( order, transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, var sb2; var sc1; var sc2; + var ta; + var tb; if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } - if ( !isMatrixTranspose( transA ) ) { + ta = resolveStr( transA ); + if ( ta === null ) { throw new TypeError( format( 'invalid argument. Second argument must be a valid transpose operation. Value: `%s`.', transA ) ); } - if ( !isMatrixTranspose( transB ) ) { + tb = resolveStr( transB ); + if ( tb === null ) { throw new TypeError( format( 'invalid argument. Third argument must be a valid transpose operation. Value: `%s`.', transB ) ); } if ( M < 0 ) { @@ -147,7 +151,7 @@ function dgemm( order, transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, sc1 = LDC; sc2 = 1; } - return base( transA, transB, M, N, K, alpha, A, sa1, sa2, 0, B, sb1, sb2, 0, beta, C, sc1, sc2, 0 ); // eslint-disable-line max-len + return base( ta, tb, M, N, K, alpha, A, sa1, sa2, 0, B, sb1, sb2, 0, beta, C, sc1, sc2, 0 ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dgemm/lib/ndarray.js index a4470f003074..2e8e7891117d 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/lib/ndarray.js @@ -20,7 +20,7 @@ // MODULES // -var isMatrixTranspose = require( '@stdlib/blas/base/assert/is-transpose-operation' ); +var resolveStr = require( '@stdlib/blas/base/transpose-operation-resolve-str' ); var format = require( '@stdlib/string/format' ); var base = require( './base.js' ); @@ -30,8 +30,8 @@ var base = require( './base.js' ); /** * Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by `N` matrix. * -* @param {string} transA - specifies whether `A` should be transposed, conjugate-transposed, or not transposed -* @param {string} transB - specifies whether `B` should be transposed, conjugate-transposed, or not transposed +* @param {(integer|string)} transA - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {(integer|string)} transB - specifies whether `B` should be transposed, conjugate-transposed, or not transposed * @param {NonNegativeInteger} M - number of rows in the matrix `op(A)` and in the matrix `C` * @param {NonNegativeInteger} N - number of columns in the matrix `op(B)` and in the matrix `C` * @param {NonNegativeInteger} K - number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)` @@ -69,10 +69,15 @@ var base = require( './base.js' ); * // C => [ 2.0, 5.0, 6.0, 11.0 ] */ function dgemm( transA, transB, M, N, K, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB, beta, C, strideC1, strideC2, offsetC ) { // eslint-disable-line max-params, max-len - if ( !isMatrixTranspose( transA ) ) { + var ta; + var tb; + + ta = resolveStr( transA ); + if ( ta === null ) { throw new TypeError( format( 'invalid argument. First argument must be a valid transpose operation. Value: `%s`.', transA ) ); } - if ( !isMatrixTranspose( transB ) ) { + tb = resolveStr( transB ); + if ( tb === null ) { throw new TypeError( format( 'invalid argument. Second argument must be a valid transpose operation. Value: `%s`.', transB ) ); } if ( M < 0 ) { @@ -90,7 +95,7 @@ function dgemm( transA, transB, M, N, K, alpha, A, strideA1, strideA2, offsetA, if ( strideC2 === 0 ) { throw new RangeError( format( 'invalid argument. Eighteenth argument must be non-zero. Value: `%d`.', strideC2 ) ); } - return base( transA, transB, M, N, K, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB, beta, C, strideC1, strideC2, offsetC ); // eslint-disable-line max-len + return base( ta, tb, M, N, K, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB, beta, C, strideC1, strideC2, offsetC ); // eslint-disable-line max-len }