Skip to content

Commit e82dc31

Browse files
committed
refactor: make the base implementation cleaner
--- 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: 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent aed3649 commit e82dc31

File tree

1 file changed

+9
-9
lines changed
  • lib/node_modules/@stdlib/lapack/base/dgebak/lib

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ var swaps = require( './swaps.js' );
6464
* // returns <Float64Array>[ 0.5, 2, 4, 10, 3, 6 ]
6565
*/
6666
function dgebak( job, side, N, M, ilo, ihi, scale, strideScale, offsetScale, V, strideV1, strideV2, offsetV ) { // eslint-disable-line max-len, max-params
67+
var is;
6768
var i;
6869
var s;
6970

@@ -79,16 +80,15 @@ function dgebak( job, side, N, M, ilo, ihi, scale, strideScale, offsetScale, V,
7980
}
8081

8182
if ( job === 'scale' || job === 'both' ) {
82-
if ( side === 'right' ) {
83-
for ( i = ilo; i <= ihi; i++ ) {
84-
s = scale[ offsetScale + ( i * strideScale ) ];
85-
dscal( M, s, V, strideV2, offsetV + ( i * strideV1 ) );
86-
}
87-
} else {
88-
for ( i = ilo; i <= ihi; i++ ) {
89-
s = 1 / scale[ offsetScale + ( i * strideScale ) ];
90-
dscal( M, s, V, strideV2, offsetV + ( i * strideV1 ) );
83+
is = offsetScale + ( ilo * strideScale );
84+
for ( i = ilo; i <= ihi; i++ ) {
85+
if ( side === 'right' ) {
86+
s = scale[ is ];
87+
} else {
88+
s = 1 / scale[ is ];
9189
}
90+
dscal( M, s, V, strideV2, offsetV + ( i * strideV1 ) );
91+
is += strideScale;
9292
}
9393
}
9494

0 commit comments

Comments
 (0)