diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-transposed/README.md b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/README.md new file mode 100644 index 000000000000..846287e2f92c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/README.md @@ -0,0 +1,125 @@ + + +# isTransposed + +> Test whether an input value indicates that a matrix should be transposed. + + + +
+ +Test whether an input value indicates that a matrix should be transposed. + +
+ + + + + +
+ +## Usage + +```javascript +var isTransposed = require( '@stdlib/blas/base/assert/is-transposed' ); +``` + +#### isTransposed( value ) + +Test whether an input value indicates that a matrix should be transposed. + +```javascript +var bool = isTransposed( 'transpose' ); +// returns true + +bool = isTransposed( 'conjugate-transpose' ); +// returns true + +bool = isTransposed( 'no-transpose' ); +// returns false + +bool = isTransposed( 'foo' ); +// returns false +``` + +
+ + + + + +
+ +
+ + + + + +
+ +## Examples + + + +```javascript +var isTransposed = require( '@stdlib/blas/base/assert/is-transposed' ); + +var bool = isTransposed( 'transpose' ); +// returns true + +bool = isTransposed( 'conjugate-transpose' ); +// returns true + +bool = isTransposed( 'no-transpose' ); +// returns false + +bool = isTransposed( 'foo' ); +// returns false +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-transposed/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/benchmark/benchmark.js new file mode 100644 index 000000000000..f265a0e9bbda --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/benchmark/benchmark.js @@ -0,0 +1,60 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var pkg = require( './../package.json' ).name; +var isTransposed = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var values; + var out; + var i; + + values = [ + 'transpose', + 'conjugate-transpose', + 'no-transpose', + 'foo', + 'bar', + '', + 'beep', + 'boop' + ]; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + out = isTransposed( values[ i%values.length ] ); + if ( typeof out !== 'boolean' ) { + b.fail( 'should return a boolean' ); + } + } + b.toc(); + if ( !isBoolean( out ) ) { + b.fail( 'should return a boolean' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-transposed/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/docs/repl.txt new file mode 100644 index 000000000000..70e949455999 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/docs/repl.txt @@ -0,0 +1,29 @@ + +{{alias}}( value ) + Test whether an input value indicates that a matrix should be transposed. + + Parameters + ---------- + value: any + Value to test. + + Returns + ------- + bool: boolean + Boolean indicating if an input value indicates that a matrix should be + transposed. + + Examples + -------- + > var bool = {{alias}}( 'transpose' ) + true + > bool = {{alias}}( 'conjugate-transpose' ) + true + > bool = {{alias}}( 'no-transpose' ) + false + > bool = {{alias}}( 'foo' ) + false + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-transposed/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/docs/types/index.d.ts new file mode 100644 index 000000000000..5296eef4f93e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/docs/types/index.d.ts @@ -0,0 +1,45 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 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 + +/** +* Test whether an input value indicates that a matrix should be transposed. +* +* @param value - value to test +* @returns boolean indicating whether an input value indicates that a matrix should be transposed. +* +* @example +* var bool = isTransposed( 'transpose' ); +* // returns true +* +* bool = isTransposed( 'conjugate-transpose' ); +* // returns true +* +* bool = isTransposed( 'no-transpose' ); +* // returns false +* +* bool = isTransposed( 'foo' ); +* // returns false +*/ +declare function isTransposed( value: any ): boolean; + + +// EXPORTS // + +export = isTransposed; diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-transposed/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/docs/types/test.ts new file mode 100644 index 000000000000..1bd7570aac12 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/docs/types/test.ts @@ -0,0 +1,34 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 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 isTransposed = require( './index' ); + + +// TESTS // + +// The function returns a boolean... +{ + isTransposed( 'transpose' ); // $ExpectType boolean + isTransposed( 'foo' ); // $ExpectType boolean +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + isTransposed(); // $ExpectError + isTransposed( 'foo', 123 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-transposed/examples/index.js b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/examples/index.js new file mode 100644 index 000000000000..1bf9f98a3831 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/examples/index.js @@ -0,0 +1,37 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 isTransposed = require( './../lib' ); + +var bool = isTransposed( 'transpose' ); +console.log( bool ); +// => true + +bool = isTransposed( 'conjugate-transpose' ); +console.log( bool ); +// => true + +bool = isTransposed( 'no-transpose' ); +console.log( bool ); +// => false + +bool = isTransposed( 'foo' ); +console.log( bool ); +// => false diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-transposed/lib/index.js b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/lib/index.js new file mode 100644 index 000000000000..9d7d549595e5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/lib/index.js @@ -0,0 +1,48 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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'; + +/** +* Test whether an input value indicates that a matrix should be transposed. +* +* @module @stdlib/blas/base/assert/is-transposed +* +* @example +* var isTransposed = require( '@stdlib/blas/base/assert/is-transposed' ); +* var bool = isTransposed( 'transpose' ); +* // returns true +* +* bool = isTransposed( 'conjugate-transpose' ); +* // returns true +* +* bool = isTransposed( 'no-transpose' ); +* // returns false +* +* bool = isTransposed( 'foo' ); +* // returns false +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-transposed/lib/main.js b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/lib/main.js new file mode 100644 index 000000000000..16f39c996482 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/lib/main.js @@ -0,0 +1,51 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 // + +/** +* Test whether an input value indicates that a matrix should be transposed. +* +* @name isTransposed +* @type {Function} +* @param {*} value - value to test +* @returns {boolean} boolean indicating whether an input value indicates that a matrix should be transposed. +* +* @example +* var bool = isTransposed( 'transpose' ); +* // returns true +* +* bool = isTransposed( 'conjugate-transpose' ); +* // returns true +* +* bool = isTransposed( 'no-transpose' ); +* // returns false +* +* bool = isTransposed( 'foo' ); +* // returns false +*/ +function isTransposed( value ) { + return ( ( value === 'transpose' ) || ( value === 'conjugate-transpose' ) ); +} + + +// EXPORTS // + +module.exports = isTransposed; diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-transposed/package.json b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/package.json new file mode 100644 index 000000000000..49d432c6cea3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/package.json @@ -0,0 +1,75 @@ +{ + "name": "@stdlib/blas/base/assert/is-transposed", + "version": "0.0.0", + "description": "Test whether an input value indicates that a matrix should be transposed.", + "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", + "stdtypes", + "types", + "base", + "blas", + "transpose", + "multidimensional", + "ndarray", + "array", + "utilities", + "utility", + "utils", + "util", + "assert", + "test", + "check", + "is", + "valid", + "validate", + "validation", + "isvalid" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/blas/base/assert/is-transposed/test/test.js b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/test/test.js new file mode 100644 index 000000000000..a02892a06a5d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/assert/is-transposed/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 isTransposed = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof isTransposed, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns `true` if provided a transpose operation', function test( t ) { + var values; + var bool; + var i; + + values = [ + 'transpose', + 'conjugate-transpose' + ]; + for ( i = 0; i < values.length; i++ ) { + bool = isTransposed( values[ i ] ); + t.strictEqual( bool, true, 'returns expected value when provided '+values[ i ] ); + } + t.end(); +}); + +tape( 'the function returns `false` if not provided a transpose operation', function test( t ) { + var values; + var bool; + var i; + + values = [ + 'no-transpose', + 'c', + 'fortran', + 'c-style', + 'fortran-style', + '', + 'beep', + 'boop', + 'foo', + 'bar', + 5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + bool = isTransposed( values[ i ] ); + t.strictEqual( bool, false, 'returns expected value when provided '+values[ i ] ); + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/lib/base.js b/lib/node_modules/@stdlib/blas/base/dgemm/lib/base.js index 961d02bb4248..29aad7c10f85 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/lib/base.js @@ -23,6 +23,7 @@ // MODULES // var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var isTransposed = require( '@stdlib/blas/base/assert/is-transposed' ); var ddot = require( '@stdlib/blas/base/ddot' ).ndarray; var blockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' ); @@ -34,29 +35,6 @@ var bsize = blockSize( 'float64', 'float64' ); // TODO: consider using a larger // FUNCTIONS // -/** -* Tests whether a provided string indicates to transpose a matrix. -* -* @private -* @param {string} str - input string -* @returns {boolean} boolean indicating whether to transpose a matrix -* -* @example -* var bool = isTransposed( 'transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'conjugate-transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'no-transpose' ); -* // returns false -*/ -function isTransposed( str ) { // TODO: consider moving to a separate helper utility package - return ( str !== 'no-transpose' ); -} - /** * Fills a matrix with zeros. * 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 eedda5fe03b2..0eab743a9bb0 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.js @@ -25,6 +25,7 @@ var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTranspose = require( '@stdlib/blas/base/assert/is-transpose-operation' ); var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var isTransposed = require( '@stdlib/blas/base/assert/is-transposed' ); var format = require( '@stdlib/string/format' ); var base = require( './base.js' ); @@ -104,7 +105,7 @@ function dgemm( order, transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, iscm = isColumnMajor( order ); if ( ( isrm && transA === 'no-transpose' ) || - ( iscm && transA === 'transpose' ) + ( iscm && isTransposed( transA ) ) ) { nrowsa = K; } else { @@ -112,7 +113,7 @@ function dgemm( order, transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, } if ( ( isrm && transB === 'no-transpose' ) || - ( iscm && transB === 'transpose' ) + ( iscm && isTransposed( transB ) ) ) { nrowsb = N; } else { diff --git a/lib/node_modules/@stdlib/blas/base/dgemv/lib/base.js b/lib/node_modules/@stdlib/blas/base/dgemv/lib/base.js index 317577b3997f..a47507c5fa09 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dgemv/lib/base.js @@ -21,36 +21,11 @@ // MODULES // var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var isTransposed = require( '@stdlib/blas/base/assert/is-transposed' ); var dfill = require( '@stdlib/blas/ext/base/dfill' ).ndarray; var dscal = require( '@stdlib/blas/base/dscal' ).ndarray; -// FUNCTIONS // - -/** -* Tests whether a provided string indicates to transpose a matrix. -* -* @private -* @param {string} str - input string -* @returns {boolean} boolean indicating whether to transpose a matrix -* -* @example -* var bool = isTransposed( 'transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'conjugate-transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'no-transpose' ); -* // returns false -*/ -function isTransposed( str ) { // TODO: consider moving to a separate helper utility package - return ( str !== 'no-transpose' ); -} - - // MAIN // /** diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/lib/accessors.js b/lib/node_modules/@stdlib/blas/base/ggemm/lib/accessors.js index 7acf4d96ecb9..38bf429f8590 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/lib/accessors.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/lib/accessors.js @@ -23,6 +23,7 @@ // MODULES // var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var isTransposed = require( '@stdlib/blas/base/assert/is-transposed' ); var gdot = require( '@stdlib/blas/base/gdot' ).ndarray; var blockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' ); @@ -34,29 +35,6 @@ var bsize = blockSize( 'float64', 'float64' ); // TODO: consider using a larger // FUNCTIONS // -/** -* Tests whether a provided string indicates to transpose a matrix. -* -* @private -* @param {string} str - input string -* @returns {boolean} boolean indicating whether to transpose a matrix -* -* @example -* var bool = isTransposed( 'transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'conjugate-transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'no-transpose' ); -* // returns false -*/ -function isTransposed( str ) { // TODO: consider moving to a separate helper utility package - return ( str !== 'no-transpose' ); -} - /** * Fills a matrix with zeros. * diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/lib/base.js b/lib/node_modules/@stdlib/blas/base/ggemm/lib/base.js index 91f536a26709..c47fe0835ddc 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/lib/base.js @@ -24,6 +24,7 @@ var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var isTransposed = require( '@stdlib/blas/base/assert/is-transposed' ); var gdot = require( '@stdlib/blas/base/gdot' ).ndarray; var blockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' ); var accessors = require( './accessors.js' ); @@ -36,29 +37,6 @@ var bsize = blockSize( 'float64', 'float64' ); // TODO: consider using a larger // FUNCTIONS // -/** -* Tests whether a provided string indicates to transpose a matrix. -* -* @private -* @param {string} str - input string -* @returns {boolean} boolean indicating whether to transpose a matrix -* -* @example -* var bool = isTransposed( 'transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'conjugate-transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'no-transpose' ); -* // returns false -*/ -function isTransposed( str ) { // TODO: consider moving to a separate helper utility package - return ( str !== 'no-transpose' ); -} - /** * Fills a matrix with zeros. * diff --git a/lib/node_modules/@stdlib/blas/base/ggemm/lib/main.js b/lib/node_modules/@stdlib/blas/base/ggemm/lib/main.js index 08373a5691f1..5fa2e4f3eee3 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemm/lib/main.js +++ b/lib/node_modules/@stdlib/blas/base/ggemm/lib/main.js @@ -25,6 +25,7 @@ var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTranspose = require( '@stdlib/blas/base/assert/is-transpose-operation' ); var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var isTransposed = require( '@stdlib/blas/base/assert/is-transposed' ); var format = require( '@stdlib/string/format' ); var base = require( './base.js' ); @@ -102,7 +103,7 @@ function ggemm( order, transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, iscm = isColumnMajor( order ); if ( ( isrm && transA === 'no-transpose' ) || - ( iscm && transA === 'transpose' ) + ( iscm && isTransposed( transA ) ) ) { nrowsa = K; } else { @@ -110,7 +111,7 @@ function ggemm( order, transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, } if ( ( isrm && transB === 'no-transpose' ) || - ( iscm && transB === 'transpose' ) + ( iscm && isTransposed( transB ) ) ) { nrowsb = N; } else { diff --git a/lib/node_modules/@stdlib/blas/base/ggemv/lib/accessors.js b/lib/node_modules/@stdlib/blas/base/ggemv/lib/accessors.js index 3feef8d26257..8c027e30dd2a 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemv/lib/accessors.js +++ b/lib/node_modules/@stdlib/blas/base/ggemv/lib/accessors.js @@ -21,36 +21,11 @@ // MODULES // var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var isTransposed = require( '@stdlib/blas/base/assert/is-transposed' ); var gfill = require( '@stdlib/blas/ext/base/gfill' ).ndarray; var gscal = require( '@stdlib/blas/base/gscal' ).ndarray; -// FUNCTIONS // - -/** -* Tests whether a provided string indicates to transpose a matrix. -* -* @private -* @param {string} str - input string -* @returns {boolean} boolean indicating whether to transpose a matrix -* -* @example -* var bool = isTransposed( 'transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'conjugate-transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'no-transpose' ); -* // returns false -*/ -function isTransposed( str ) { // TODO: consider moving to a separate helper utility package - return ( str !== 'no-transpose' ); -} - - // MAIN // /** diff --git a/lib/node_modules/@stdlib/blas/base/ggemv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ggemv/lib/base.js index af3b60795052..6b7147b16d8b 100644 --- a/lib/node_modules/@stdlib/blas/base/ggemv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/ggemv/lib/base.js @@ -22,37 +22,12 @@ var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var isTransposed = require( '@stdlib/blas/base/assert/is-transposed' ); var gfill = require( '@stdlib/blas/ext/base/gfill' ).ndarray; var gscal = require( '@stdlib/blas/base/gscal' ).ndarray; var accessors = require( './accessors.js' ); -// FUNCTIONS // - -/** -* Tests whether a provided string indicates to transpose a matrix. -* -* @private -* @param {string} str - input string -* @returns {boolean} boolean indicating whether to transpose a matrix -* -* @example -* var bool = isTransposed( 'transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'conjugate-transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'no-transpose' ); -* // returns false -*/ -function isTransposed( str ) { // TODO: consider moving to a separate helper utility package - return ( str !== 'no-transpose' ); -} - - // MAIN // /** diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/lib/base.js b/lib/node_modules/@stdlib/blas/base/sgemm/lib/base.js index 718e8b6fa1d2..48ca07ad7937 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/lib/base.js @@ -23,6 +23,7 @@ // MODULES // var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var isTransposed = require( '@stdlib/blas/base/assert/is-transposed' ); var sdot = require( '@stdlib/blas/base/sdot' ).ndarray; var blockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' ); var f32 = require( '@stdlib/number/float64/base/to-float32' ); @@ -35,29 +36,6 @@ var bsize = blockSize( 'float32', 'float32' ); // TODO: consider using a larger // FUNCTIONS // -/** -* Tests whether a provided string indicates to transpose a matrix. -* -* @private -* @param {string} str - input string -* @returns {boolean} boolean indicating whether to transpose a matrix -* -* @example -* var bool = isTransposed( 'transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'conjugate-transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'no-transpose' ); -* // returns false -*/ -function isTransposed( str ) { // TODO: consider moving to a separate helper utility package - return ( str !== 'no-transpose' ); -} - /** * Fills a matrix with zeros. * diff --git a/lib/node_modules/@stdlib/blas/base/sgemm/lib/sgemm.js b/lib/node_modules/@stdlib/blas/base/sgemm/lib/sgemm.js index 342a12785626..b39ca92458e7 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemm/lib/sgemm.js +++ b/lib/node_modules/@stdlib/blas/base/sgemm/lib/sgemm.js @@ -25,6 +25,7 @@ var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTranspose = require( '@stdlib/blas/base/assert/is-transpose-operation' ); var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var isTransposed = require( '@stdlib/blas/base/assert/is-transposed' ); var format = require( '@stdlib/string/format' ); var base = require( './base.js' ); @@ -104,7 +105,7 @@ function sgemm( order, transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, iscm = isColumnMajor( order ); if ( ( isrm && transA === 'no-transpose' ) || - ( iscm && transA === 'transpose' ) + ( iscm && isTransposed( transA ) ) ) { nrowsa = K; } else { @@ -112,7 +113,7 @@ function sgemm( order, transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, } if ( ( isrm && transB === 'no-transpose' ) || - ( iscm && transB === 'transpose' ) + ( iscm && isTransposed( transB ) ) ) { nrowsb = N; } else { diff --git a/lib/node_modules/@stdlib/blas/base/sgemv/lib/base.js b/lib/node_modules/@stdlib/blas/base/sgemv/lib/base.js index 8289eadd514a..4bdb6cddde8b 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/sgemv/lib/base.js @@ -22,36 +22,11 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' ); var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var isTransposed = require( '@stdlib/blas/base/assert/is-transposed' ); var sfill = require( '@stdlib/blas/ext/base/sfill' ).ndarray; var sscal = require( '@stdlib/blas/base/sscal' ).ndarray; -// FUNCTIONS // - -/** -* Tests whether a provided string indicates to transpose a matrix. -* -* @private -* @param {string} str - input string -* @returns {boolean} boolean indicating whether to transpose a matrix -* -* @example -* var bool = isTransposed( 'transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'conjugate-transpose' ); -* // returns true -* -* @example -* var bool = isTransposed( 'no-transpose' ); -* // returns false -*/ -function isTransposed( str ) { // TODO: consider moving to a separate helper utility package - return ( str !== 'no-transpose' ); -} - - // MAIN // /**