Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand All @@ -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)`
Expand Down Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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
}


Expand Down
17 changes: 11 additions & 6 deletions lib/node_modules/@stdlib/blas/base/dgemm/lib/ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

Expand All @@ -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)`
Expand Down Expand Up @@ -69,10 +69,15 @@ var base = require( './base.js' );
* // C => <Float64Array>[ 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 ) {
Expand All @@ -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
}


Expand Down