diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-column/lib/cindex_of_column.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-column/lib/cindex_of_column.js index 1dcdba459234..9ceb0ac81b9d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-column/lib/cindex_of_column.js +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-column/lib/cindex_of_column.js @@ -20,9 +20,8 @@ // MODULES // -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var resolveLayout = require( '@stdlib/blas/base/layout-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 stride2offset = require( '@stdlib/strided/base/stride2offset' ); var max = require( '@stdlib/math/base/special/fast/max' ); var format = require( '@stdlib/string/format' ); @@ -39,7 +38,7 @@ var ndarray = require( './ndarray.js' ); * - If the function is provided an empty matrix or if the function is unable to find a matching column, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in row-major order. When the matrix is stored in column-major order, the workspace array is ignored. * -* @param {string} order - storage layout +* @param {(integer|string)} order - storage layout * @param {PositiveInteger} M - number of rows in `A` * @param {PositiveInteger} N - number of columns in `A` * @param {Complex64Array} A - input matrix @@ -67,24 +66,24 @@ function cindexOfColumn( order, M, N, A, LDA, x, strideX, workspace, strideW ) { var sa1; var sa2; var s; - if ( !isLayout( order ) ) { + var l; + + l = resolveLayout( order ); + if ( l === null ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } - if ( isRowMajor( order ) ) { + if ( isRowMajor( l ) ) { s = N; + sa1 = LDA; + sa2 = 1; } else { s = M; + sa1 = 1; + sa2 = LDA; } if ( LDA < max( 1, s ) ) { throw new RangeError( format( 'invalid argument. Fifth argument must be greater than or equal to max(1,%d). Value: `%d`.', max( 1, s ), LDA ) ); } - if ( isColumnMajor( order ) ) { - sa1 = 1; - sa2 = LDA; - } else { // order === 'row-major' - sa1 = LDA; - sa2 = 1; - } return ndarray( M, N, A, sa1, sa2, 0, x, strideX, stride2offset( M, strideX ), workspace, strideW, stride2offset( N, strideW ) ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-column/lib/cindex_of_column.native.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-column/lib/cindex_of_column.native.js index 9e3681d579b8..8cf1d3ff0868 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-column/lib/cindex_of_column.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-column/lib/cindex_of_column.native.js @@ -20,7 +20,7 @@ // MODULES // -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var resolveLayout = require( '@stdlib/blas/base/layout-resolve-str' ); var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); var max = require( '@stdlib/math/base/special/fast/max' ); @@ -39,7 +39,7 @@ var addon = require( './../src/addon.node' ); * - If the function is provided an empty matrix or if the function is unable to find a matching column, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in row-major order. When the matrix is stored in column-major order, the workspace array is ignored. * -* @param {string} order - storage layout +* @param {(integer|string)} order - storage layout * @param {PositiveInteger} M - number of rows in `A` * @param {PositiveInteger} N - number of columns in `A` * @param {Complex64Array} A - input matrix @@ -65,10 +65,13 @@ var addon = require( './../src/addon.node' ); */ function cindexOfColumn( order, M, N, A, LDA, x, strideX, workspace, strideW ) { var s; - if ( !isLayout( order ) ) { + var l; + + l = resolveLayout( order ); + if ( l === null ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } - if ( isRowMajor( order ) ) { + if ( isRowMajor( l ) ) { s = N; } else { s = M; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-column/lib/dindex_of_column.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-column/lib/dindex_of_column.js index 6ff35470c6bf..18ca8e553a01 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-column/lib/dindex_of_column.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-column/lib/dindex_of_column.js @@ -20,9 +20,8 @@ // MODULES // -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var resolveLayout = require( '@stdlib/blas/base/layout-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 stride2offset = require( '@stdlib/strided/base/stride2offset' ); var max = require( '@stdlib/math/base/special/fast/max' ); var format = require( '@stdlib/string/format' ); @@ -39,7 +38,7 @@ var ndarray = require( './ndarray.js' ); * - If the function is provided an empty matrix or if the function is unable to find a matching column, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in row-major order. When the matrix is stored in column-major order, the workspace array is ignored. * -* @param {string} order - storage layout +* @param {(integer|string)} order - storage layout * @param {PositiveInteger} M - number of rows in `A` * @param {PositiveInteger} N - number of columns in `A` * @param {Float64Array} A - input matrix @@ -67,24 +66,24 @@ function dindexOfColumn( order, M, N, A, LDA, x, strideX, workspace, strideW ) { var sa1; var sa2; var s; - if ( !isLayout( order ) ) { + var l; + + l = resolveLayout( order ); + if ( l === null ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } - if ( isRowMajor( order ) ) { + if ( isRowMajor( l ) ) { s = N; + sa1 = LDA; + sa2 = 1; } else { s = M; + sa1 = 1; + sa2 = LDA; } if ( LDA < max( 1, s ) ) { throw new RangeError( format( 'invalid argument. Fifth argument must be greater than or equal to max(1,%d). Value: `%d`.', s, LDA ) ); } - if ( isColumnMajor( order ) ) { - sa1 = 1; - sa2 = LDA; - } else { // order === 'row-major' - sa1 = LDA; - sa2 = 1; - } return ndarray( M, N, A, sa1, sa2, 0, x, strideX, stride2offset( M, strideX ), workspace, strideW, stride2offset( N, strideW ) ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-column/lib/dindex_of_column.native.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-column/lib/dindex_of_column.native.js index 36ab6c8caa9f..f77ff662fe1d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-column/lib/dindex_of_column.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-column/lib/dindex_of_column.native.js @@ -20,7 +20,7 @@ // MODULES // -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var resolveLayout = require( '@stdlib/blas/base/layout-resolve-str' ); var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); var max = require( '@stdlib/math/base/special/fast/max' ); var resolveOrder = require( '@stdlib/blas/base/layout-resolve-enum' ); @@ -38,7 +38,7 @@ var addon = require( './../src/addon.node' ); * - If the function is provided an empty matrix or if the function is unable to find a matching column, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in row-major order. When the matrix is stored in column-major order, the workspace array is ignored. * -* @param {string} order - storage layout +* @param {(integer|string)} order - storage layout * @param {PositiveInteger} M - number of rows in `A` * @param {PositiveInteger} N - number of columns in `A` * @param {Float64Array} A - input matrix @@ -64,10 +64,13 @@ var addon = require( './../src/addon.node' ); */ function dindexOfColumn( order, M, N, A, LDA, x, strideX, workspace, strideW ) { var s; - if ( !isLayout( order ) ) { + var l; + + l = resolveLayout( order ); + if ( l === null ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } - if ( isRowMajor( order ) ) { + if ( isRowMajor( l ) ) { s = N; } else { s = M; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/main.js index 76deffae2a71..e34a0bb17eaf 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-column/lib/main.js @@ -20,9 +20,8 @@ // MODULES // -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var resolveLayout = require( '@stdlib/blas/base/layout-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 stride2offset = require( '@stdlib/strided/base/stride2offset' ); var max = require( '@stdlib/math/base/special/fast/max' ); var format = require( '@stdlib/string/format' ); @@ -38,7 +37,7 @@ var base = require( './base.js' ); * * - If the function is provided an empty matrix or if the function is unable to find a matching column, the function returns `-1` (i.e., an invalid index). * -* @param {string} order - storage layout +* @param {(integer|string)} order - storage layout * @param {PositiveInteger} M - number of rows in `A` * @param {PositiveInteger} N - number of columns in `A` * @param {Collection} A - input matrix @@ -60,24 +59,24 @@ function gindexOfColumn( order, M, N, A, LDA, x, strideX ) { var sa1; var sa2; var s; - if ( !isLayout( order ) ) { + var l; + + l = resolveLayout( order ); + if ( l === null ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } - if ( isRowMajor( order ) ) { + if ( isRowMajor( l ) ) { s = N; + sa1 = LDA; + sa2 = 1; } else { s = M; + sa1 = 1; + sa2 = LDA; } if ( LDA < max( 1, s ) ) { throw new RangeError( format( 'invalid argument. Fifth argument must be greater than or equal to max(1,%d). Value: `%d`.', s, LDA ) ); } - if ( isColumnMajor( order ) ) { - sa1 = 1; - sa2 = LDA; - } else { // order === 'row-major' - sa1 = LDA; - sa2 = 1; - } return base( M, N, A, sa1, sa2, 0, x, strideX, stride2offset( M, strideX ) ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/sindex-of-column/lib/sindex_of_column.js b/lib/node_modules/@stdlib/blas/ext/base/sindex-of-column/lib/sindex_of_column.js index 9ec5cdeab99f..c67f750696a3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sindex-of-column/lib/sindex_of_column.js +++ b/lib/node_modules/@stdlib/blas/ext/base/sindex-of-column/lib/sindex_of_column.js @@ -20,9 +20,8 @@ // MODULES // -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var resolveLayout = require( '@stdlib/blas/base/layout-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 stride2offset = require( '@stdlib/strided/base/stride2offset' ); var max = require( '@stdlib/math/base/special/fast/max' ); var format = require( '@stdlib/string/format' ); @@ -39,7 +38,7 @@ var ndarray = require( './ndarray.js' ); * - If the function is provided an empty matrix or if the function is unable to find a matching column, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in row-major order. When the matrix is stored in column-major order, the workspace array is ignored. * -* @param {string} order - storage layout +* @param {(integer|string)} order - storage layout * @param {PositiveInteger} M - number of rows in `A` * @param {PositiveInteger} N - number of columns in `A` * @param {Float32Array} A - input matrix @@ -67,24 +66,24 @@ function sindexOfColumn( order, M, N, A, LDA, x, strideX, workspace, strideW ) { var sa1; var sa2; var s; - if ( !isLayout( order ) ) { + var l; + + l = resolveLayout( order ); + if ( l === null ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } - if ( isRowMajor( order ) ) { + if ( isRowMajor( l ) ) { s = N; + sa1 = LDA; + sa2 = 1; } else { s = M; + sa1 = 1; + sa2 = LDA; } if ( LDA < max( 1, s ) ) { throw new RangeError( format( 'invalid argument. Fifth argument must be greater than or equal to max(1,%d). Value: `%d`.', max( 1, s ), LDA ) ); } - if ( isColumnMajor( order ) ) { - sa1 = 1; - sa2 = LDA; - } else { // order === 'row-major' - sa1 = LDA; - sa2 = 1; - } return ndarray( M, N, A, sa1, sa2, 0, x, strideX, stride2offset( M, strideX ), workspace, strideW, stride2offset( N, strideW ) ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/sindex-of-column/lib/sindex_of_column.native.js b/lib/node_modules/@stdlib/blas/ext/base/sindex-of-column/lib/sindex_of_column.native.js index cb9b6c17231d..d0543510dadd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sindex-of-column/lib/sindex_of_column.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/sindex-of-column/lib/sindex_of_column.native.js @@ -20,7 +20,7 @@ // MODULES // -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var resolveLayout = require( '@stdlib/blas/base/layout-resolve-str' ); var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); var max = require( '@stdlib/math/base/special/fast/max' ); var resolveOrder = require( '@stdlib/blas/base/layout-resolve-enum' ); @@ -38,7 +38,7 @@ var addon = require( './../src/addon.node' ); * - If the function is provided an empty matrix or if the function is unable to find a matching column, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in row-major order. When the matrix is stored in column-major order, the workspace array is ignored. * -* @param {string} order - storage layout +* @param {(integer|string)} order - storage layout * @param {PositiveInteger} M - number of rows in `A` * @param {PositiveInteger} N - number of columns in `A` * @param {Float32Array} A - input matrix @@ -64,10 +64,13 @@ var addon = require( './../src/addon.node' ); */ function sindexOfColumn( order, M, N, A, LDA, x, strideX, workspace, strideW ) { var s; - if ( !isLayout( order ) ) { + var l; + + l = resolveLayout( order ); + if ( l === null ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } - if ( isRowMajor( order ) ) { + if ( isRowMajor( l ) ) { s = N; } else { s = M; diff --git a/lib/node_modules/@stdlib/blas/ext/base/zindex-of-column/lib/zindex_of_column.js b/lib/node_modules/@stdlib/blas/ext/base/zindex-of-column/lib/zindex_of_column.js index 201caa5c3551..1a005d5b7eb8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/zindex-of-column/lib/zindex_of_column.js +++ b/lib/node_modules/@stdlib/blas/ext/base/zindex-of-column/lib/zindex_of_column.js @@ -20,9 +20,8 @@ // MODULES // -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var resolveLayout = require( '@stdlib/blas/base/layout-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 stride2offset = require( '@stdlib/strided/base/stride2offset' ); var max = require( '@stdlib/math/base/special/fast/max' ); var format = require( '@stdlib/string/format' ); @@ -39,7 +38,7 @@ var ndarray = require( './ndarray.js' ); * - If the function is provided an empty matrix or if the function is unable to find a matching column, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in row-major order. When the matrix is stored in column-major order, the workspace array is ignored. * -* @param {string} order - storage layout +* @param {(integer|string)} order - storage layout * @param {PositiveInteger} M - number of rows in `A` * @param {PositiveInteger} N - number of columns in `A` * @param {Complex128Array} A - input matrix @@ -67,24 +66,24 @@ function zindexOfColumn( order, M, N, A, LDA, x, strideX, workspace, strideW ) { var sa1; var sa2; var s; - if ( !isLayout( order ) ) { + var l; + + l = resolveLayout( order ); + if ( l === null ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } - if ( isRowMajor( order ) ) { + if ( isRowMajor( l ) ) { s = N; + sa1 = LDA; + sa2 = 1; } else { s = M; + sa1 = 1; + sa2 = LDA; } if ( LDA < max( 1, s ) ) { throw new RangeError( format( 'invalid argument. Fifth argument must be greater than or equal to max(1,%d). Value: `%d`.', max( 1, s ), LDA ) ); } - if ( isColumnMajor( order ) ) { - sa1 = 1; - sa2 = LDA; - } else { // order === 'row-major' - sa1 = LDA; - sa2 = 1; - } return ndarray( M, N, A, sa1, sa2, 0, x, strideX, stride2offset( M, strideX ), workspace, strideW, stride2offset( N, strideW ) ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/zindex-of-column/lib/zindex_of_column.native.js b/lib/node_modules/@stdlib/blas/ext/base/zindex-of-column/lib/zindex_of_column.native.js index 794ef0dc3bbf..1b5ec754926b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/zindex-of-column/lib/zindex_of_column.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/zindex-of-column/lib/zindex_of_column.native.js @@ -20,7 +20,7 @@ // MODULES // -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var resolveLayout = require( '@stdlib/blas/base/layout-resolve-str' ); var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); var max = require( '@stdlib/math/base/special/fast/max' ); @@ -39,7 +39,7 @@ var addon = require( './../src/addon.node' ); * - If the function is provided an empty matrix or if the function is unable to find a matching column, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in row-major order. When the matrix is stored in column-major order, the workspace array is ignored. * -* @param {string} order - storage layout +* @param {(integer|string)} order - storage layout * @param {PositiveInteger} M - number of rows in `A` * @param {PositiveInteger} N - number of columns in `A` * @param {Complex128Array} A - input matrix @@ -65,10 +65,13 @@ var addon = require( './../src/addon.node' ); */ function zindexOfColumn( order, M, N, A, LDA, x, strideX, workspace, strideW ) { var s; - if ( !isLayout( order ) ) { + var l; + + l = resolveLayout( order ); + if ( l === null ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } - if ( isRowMajor( order ) ) { + if ( isRowMajor( l ) ) { s = N; } else { s = M;