Skip to content

Commit 6ee5d86

Browse files
committed
refactor: use base assertion utility
--- 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 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: passed - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent f924a93 commit 6ee5d86

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/node_modules/@stdlib/lapack/base/slaswp/benchmark/benchmark.ndarray.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var bench = require( '@stdlib/bench' );
2424
var uniform = require( '@stdlib/random/array/uniform' );
2525
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
26+
var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' );
2627
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
2728
var pow = require( '@stdlib/math/base/special/pow' );
2829
var floor = require( '@stdlib/math/base/special/floor' );
@@ -55,7 +56,7 @@ function createBenchmark( order, N, nrows ) {
5556
var sa2;
5657
var A;
5758

58-
if ( order === 'column-major' ) {
59+
if ( isColumnMajor( order ) ) {
5960
sa1 = 1;
6061
sa2 = N;
6162
} else { // order === 'row-major'

lib/node_modules/@stdlib/lapack/base/slaswp/lib/slaswp.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
// MODULES //
2222

2323
var isLayout = require( '@stdlib/blas/base/assert/is-layout' );
24+
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
25+
var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' );
2426
var max = require( '@stdlib/math/base/special/max' );
2527
var format = require( '@stdlib/string/format' );
2628
var base = require( './base.js' );
@@ -62,7 +64,7 @@ function slaswp( order, N, A, LDA, k1, k2, IPIV, incx ) {
6264
if ( !isLayout( order ) ) {
6365
throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) );
6466
}
65-
if ( order === 'row-major' && LDA < max( 1, N ) ) {
67+
if ( isRowMajor( order ) && LDA < max( 1, N ) ) {
6668
throw new RangeError( format( 'invalid argument. Fourth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) );
6769
}
6870
if ( incx > 0 ) {
@@ -77,7 +79,7 @@ function slaswp( order, N, A, LDA, k1, k2, IPIV, incx ) {
7779
} else {
7880
return A;
7981
}
80-
if ( order === 'column-major' ) {
82+
if ( isColumnMajor( order ) ) {
8183
sa1 = 1;
8284
sa2 = LDA;
8385
} else { // order === 'row-major'

0 commit comments

Comments
 (0)