diff --git a/lib/node_modules/@stdlib/blas/ext/base/clast-index-of-row/lib/clast_index_of_row.js b/lib/node_modules/@stdlib/blas/ext/base/clast-index-of-row/lib/clast_index_of_row.js index 13ec4cbbd3ac..b00f9961af7d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/clast-index-of-row/lib/clast_index_of_row.js +++ b/lib/node_modules/@stdlib/blas/ext/base/clast-index-of-row/lib/clast_index_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 @@ -68,24 +67,24 @@ function clastIndexOfRow( 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/clast-index-of-row/lib/clast_index_of_row.native.js b/lib/node_modules/@stdlib/blas/ext/base/clast-index-of-row/lib/clast_index_of_row.native.js index 789123b13519..3e68421a2942 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/clast-index-of-row/lib/clast_index_of_row.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/clast-index-of-row/lib/clast_index_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 @@ -66,10 +66,13 @@ var addon = require( './../src/addon.node' ); */ function clastIndexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { // eslint-disable-line max-len 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/dlast-index-of-row/lib/dlast_index_of_row.js b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of-row/lib/dlast_index_of_row.js index a77bbde25303..d1c4b7be3ab4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of-row/lib/dlast_index_of_row.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of-row/lib/dlast_index_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 dlastIndexOfRow( 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( N, strideX ), workspace, strideW, stride2offset( M, strideW ) ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of-row/lib/dlast_index_of_row.native.js b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of-row/lib/dlast_index_of_row.native.js index ed0de8cc5d5b..aae3cd10a5e7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of-row/lib/dlast_index_of_row.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of-row/lib/dlast_index_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 dlastIndexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { // eslint-disable-line max-len 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/glast-index-of-row/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/glast-index-of-row/lib/main.js index dfcf36191a86..ad8120c540de 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/glast-index-of-row/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/glast-index-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' ); @@ -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 {Collection} A - input matrix @@ -64,24 +63,24 @@ function glastIndexOfRow( 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/slast-index-of-row/lib/slast_index_of_row.js b/lib/node_modules/@stdlib/blas/ext/base/slast-index-of-row/lib/slast_index_of_row.js index 3fc44c6be203..e006a6befa8d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/slast-index-of-row/lib/slast_index_of_row.js +++ b/lib/node_modules/@stdlib/blas/ext/base/slast-index-of-row/lib/slast_index_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 slastIndexOfRow( 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/slast-index-of-row/lib/slast_index_of_row.native.js b/lib/node_modules/@stdlib/blas/ext/base/slast-index-of-row/lib/slast_index_of_row.native.js index 56279f9ff36f..b5e903d3f78c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/slast-index-of-row/lib/slast_index_of_row.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/slast-index-of-row/lib/slast_index_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 slastIndexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { // eslint-disable-line max-len 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/zlast-index-of-row/lib/zlast_index_of_row.js b/lib/node_modules/@stdlib/blas/ext/base/zlast-index-of-row/lib/zlast_index_of_row.js index d0e0b689e1c2..833573fe53ce 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/zlast-index-of-row/lib/zlast_index_of_row.js +++ b/lib/node_modules/@stdlib/blas/ext/base/zlast-index-of-row/lib/zlast_index_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 @@ -68,24 +67,24 @@ function zlastIndexOfRow( 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/zlast-index-of-row/lib/zlast_index_of_row.native.js b/lib/node_modules/@stdlib/blas/ext/base/zlast-index-of-row/lib/zlast_index_of_row.native.js index 264839a58d3f..55d88f08820e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/zlast-index-of-row/lib/zlast_index_of_row.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/zlast-index-of-row/lib/zlast_index_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 @@ -66,10 +66,13 @@ var addon = require( './../src/addon.node' ); */ function zlastIndexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { // eslint-disable-line max-len 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;