Skip to content

Commit 12615c0

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 26695c2 commit 12615c0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' );
2424
var uniform = require( '@stdlib/random/array/uniform' );
2525
var Complex128Array = require( '@stdlib/array/complex128' );
2626
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
27+
var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' );
2728
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2829
var pow = require( '@stdlib/math/base/special/pow' );
2930
var floor = require( '@stdlib/math/base/special/floor' );
@@ -60,7 +61,7 @@ function createBenchmark( order, N, nrows ) {
6061
var sa2;
6162
var A;
6263

63-
if ( order === 'column-major' ) {
64+
if ( isColumnMajor( order ) ) {
6465
sa1 = 1;
6566
sa2 = N;
6667
} else { // order === 'row-major'

lib/node_modules/@stdlib/lapack/base/zlaswp/lib/zlaswp.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 zlaswp( 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 zlaswp( 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)