diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/cindex_of_row.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/cindex_of_row.js index 050b6059d03d..d496b097d623 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/cindex_of_row.js +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/cindex_of_row.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 row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-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 cindexOfRow( 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( N, strideX ), workspace, strideW, stride2offset( M, strideW ) ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/cindex_of_row.native.js b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/cindex_of_row.native.js index 9bb434a1e9f0..a654393bbaf4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/cindex_of_row.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/cindex-of-row/lib/cindex_of_row.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 row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-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 cindexOfRow( 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-row/lib/dindex_of_row.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/dindex_of_row.js index 3046f4acce61..fe538aff0f81 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/dindex_of_row.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/dindex_of_row.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 row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-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 dindexOfRow( 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( N, strideX ), workspace, strideW, stride2offset( M, strideW ) ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/dindex_of_row.native.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/dindex_of_row.native.js index 2903b2055bcd..501f98dc9293 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/dindex_of_row.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/dindex_of_row.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 row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-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 dindexOfRow( 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-row/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/lib/main.js index 1e911fd1fda0..2d5a29edd3b1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/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 row, 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 gindexOfRow( 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( N, strideX ) ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/sindex-of-row/lib/sindex_of_row.js b/lib/node_modules/@stdlib/blas/ext/base/sindex-of-row/lib/sindex_of_row.js index e124f41cddd4..dd46e014d2f9 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sindex-of-row/lib/sindex_of_row.js +++ b/lib/node_modules/@stdlib/blas/ext/base/sindex-of-row/lib/sindex_of_row.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 row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-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 sindexOfRow( 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( N, strideX ), workspace, strideW, stride2offset( M, strideW ) ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/sindex-of-row/lib/sindex_of_row.native.js b/lib/node_modules/@stdlib/blas/ext/base/sindex-of-row/lib/sindex_of_row.native.js index 04b76dd1188c..5883be7fa79b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sindex-of-row/lib/sindex_of_row.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/sindex-of-row/lib/sindex_of_row.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 row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-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 sindexOfRow( 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-row/lib/zindex_of_row.js b/lib/node_modules/@stdlib/blas/ext/base/zindex-of-row/lib/zindex_of_row.js index 8cc10b7462b1..a3f984254c45 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/zindex-of-row/lib/zindex_of_row.js +++ b/lib/node_modules/@stdlib/blas/ext/base/zindex-of-row/lib/zindex_of_row.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 row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-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 zindexOfRow( 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( N, strideX ), workspace, strideW, stride2offset( M, strideW ) ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/zindex-of-row/lib/zindex_of_row.native.js b/lib/node_modules/@stdlib/blas/ext/base/zindex-of-row/lib/zindex_of_row.native.js index a32c234148f8..aa62a5a41a02 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/zindex-of-row/lib/zindex_of_row.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/zindex-of-row/lib/zindex_of_row.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 row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-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 zindexOfRow( 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;