From 4d6933f59294b7e09494c3e62e16ccf7a9721942 Mon Sep 17 00:00:00 2001 From: kaustubh Date: Sun, 13 Sep 2026 13:34:27 +0530 Subject: [PATCH 1/2] refactor: add support for enums in blas/ext/base/*index-of-row --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../ext/base/cindex-of-row/lib/cindex_of_row.js | 13 ++++++++----- .../base/cindex-of-row/lib/cindex_of_row.native.js | 11 +++++++---- .../ext/base/dindex-of-row/lib/dindex_of_row.js | 13 ++++++++----- .../base/dindex-of-row/lib/dindex_of_row.native.js | 11 +++++++---- .../@stdlib/blas/ext/base/gindex-of-row/lib/main.js | 13 ++++++++----- .../ext/base/sindex-of-row/lib/sindex_of_row.js | 13 ++++++++----- .../base/sindex-of-row/lib/sindex_of_row.native.js | 11 +++++++---- .../ext/base/zindex-of-row/lib/zindex_of_row.js | 13 ++++++++----- .../base/zindex-of-row/lib/zindex_of_row.native.js | 11 +++++++---- 9 files changed, 68 insertions(+), 41 deletions(-) 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..e8f56a128ee4 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,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 isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); var stride2offset = require( '@stdlib/strided/base/stride2offset' ); @@ -39,7 +39,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,10 +67,13 @@ 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; } else { s = M; @@ -78,7 +81,7 @@ function cindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { 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 ) ) { + if ( isColumnMajor( l ) ) { sa1 = 1; sa2 = LDA; } else { // order === 'row-major' 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..6da7a21c9e7b 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,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 isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); var stride2offset = require( '@stdlib/strided/base/stride2offset' ); @@ -39,7 +39,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,10 +67,13 @@ 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; } else { s = M; @@ -78,7 +81,7 @@ function dindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { 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 ) ) { + if ( isColumnMajor( l ) ) { sa1 = 1; sa2 = LDA; } else { // order === 'row-major' 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..7d9522d4abbb 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,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 isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); var stride2offset = require( '@stdlib/strided/base/stride2offset' ); @@ -38,7 +38,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,10 +60,13 @@ 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; } else { s = M; @@ -71,7 +74,7 @@ function gindexOfRow( order, M, N, A, LDA, x, strideX ) { 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 ) ) { + if ( isColumnMajor( l ) ) { sa1 = 1; sa2 = LDA; } else { // order === 'row-major' 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..e3d107d0a469 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,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 isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); var stride2offset = require( '@stdlib/strided/base/stride2offset' ); @@ -39,7 +39,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,10 +67,13 @@ 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; } else { s = M; @@ -78,7 +81,7 @@ function sindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { 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 ) ) { + if ( isColumnMajor( l ) ) { sa1 = 1; sa2 = LDA; } else { // order === 'row-major' 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..5717834f8265 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,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 isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); var stride2offset = require( '@stdlib/strided/base/stride2offset' ); @@ -39,7 +39,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,10 +67,13 @@ 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; } else { s = M; @@ -78,7 +81,7 @@ function zindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { 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 ) ) { + if ( isColumnMajor( l ) ) { sa1 = 1; sa2 = LDA; } else { // order === 'row-major' 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; From 92f6137585a44270f838523ea54743c960da2833 Mon Sep 17 00:00:00 2001 From: kaustubh Date: Tue, 15 Sep 2026 21:42:48 +0530 Subject: [PATCH 2/2] refactor: reduce complexity and consolidate conditionals --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/ext/base/cindex-of-row/lib/cindex_of_row.js | 12 ++++-------- .../blas/ext/base/dindex-of-row/lib/dindex_of_row.js | 12 ++++-------- .../@stdlib/blas/ext/base/gindex-of-row/lib/main.js | 12 ++++-------- .../blas/ext/base/sindex-of-row/lib/sindex_of_row.js | 12 ++++-------- .../blas/ext/base/zindex-of-row/lib/zindex_of_row.js | 12 ++++-------- 5 files changed, 20 insertions(+), 40 deletions(-) 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 e8f56a128ee4..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 @@ -22,7 +22,6 @@ 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' ); @@ -75,19 +74,16 @@ function cindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { } 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( l ) ) { - 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.js b/lib/node_modules/@stdlib/blas/ext/base/dindex-of-row/lib/dindex_of_row.js index 6da7a21c9e7b..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 @@ -22,7 +22,6 @@ 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' ); @@ -75,19 +74,16 @@ function dindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { } 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( l ) ) { - 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/gindex-of-row/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/gindex-of-row/lib/main.js index 7d9522d4abbb..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 @@ -22,7 +22,6 @@ 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' ); @@ -68,19 +67,16 @@ function gindexOfRow( order, M, N, A, LDA, x, strideX ) { } 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( l ) ) { - 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 e3d107d0a469..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 @@ -22,7 +22,6 @@ 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' ); @@ -75,19 +74,16 @@ function sindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { } 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( l ) ) { - 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.js b/lib/node_modules/@stdlib/blas/ext/base/zindex-of-row/lib/zindex_of_row.js index 5717834f8265..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 @@ -22,7 +22,6 @@ 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' ); @@ -75,19 +74,16 @@ function zindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW ) { } 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( l ) ) { - 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 }