Skip to content

Commit b7e80eb

Browse files
committed
feat: merge loops
--- 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 b5618f1 commit b7e80eb

File tree

1 file changed

+12
-22
lines changed
  • lib/node_modules/@stdlib/lapack/base/dppequ/lib

1 file changed

+12
-22
lines changed

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

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var min = require( '@stdlib/math/base/special/min' );
2828
// MAIN //
2929

3030
/**
31-
* Computes the row and column scalings intended to equilibrate a symmetric positive definite matrix `A` in packed storage and reduce it's condition number (with respect to the two-norm).
31+
* Computes the row and column scaling factors intended to equilibrate a symmetric positive definite matrix `A` in packed storage and reduce it's condition number (with respect to the two-norm).
3232
*
3333
* @param {string} order - specifies whether `AP` is packed in row-major or column-major order
3434
* @param {string} uplo - 'Upper' or 'Lower' triangle of `A` is stored
@@ -72,36 +72,26 @@ function dppequ( order, uplo, N, AP, strideAP, offsetAP, S, strideS, offsetS, ou
7272
smin = S[ offsetAP ];
7373
amax = S[ offsetAP ];
7474

75-
if ( order === 'row-major' ) {
76-
if ( uplo === 'U' ) { // uplo === 'U'
77-
jj = 0;
78-
for ( i = 1; i < N; i++ ) {
75+
if ( uplo === 'U' ) { // uplo === 'U'
76+
jj = 0;
77+
for ( i = 1; i < N; i++ ) {
78+
if ( order === 'row-major' ) {
7979
jj += N - i + 1;
80-
S[ offsetS + (i * strideS) ] = AP[ offsetAP + (jj * strideAP) ];
81-
smin = min( smin, S[ offsetS + (i * strideS) ] );
82-
amax = max( amax, S[ offsetS + (i * strideS) ] );
83-
}
84-
} else { // uplo === 'L'
85-
jj = 0;
86-
for ( i = 1; i < N; i++ ) {
80+
} else { // order === 'column-major'
8781
jj += i + 1;
88-
S[ offsetS + (i * strideS) ] = AP[ offsetAP + (jj * strideAP) ];
89-
smin = min( smin, S[ offsetS + (i * strideS) ] );
90-
amax = max( amax, S[ offsetS + (i * strideS) ] );
9182
}
92-
}
93-
} else if ( uplo === 'U' ) { // order === 'col-major'
94-
jj = 0;
95-
for ( i = 1; i < N; i++ ) {
96-
jj += i + 1;
9783
S[ offsetS + (i * strideS) ] = AP[ offsetAP + (jj * strideAP) ];
9884
smin = min( smin, S[ offsetS + (i * strideS) ] );
9985
amax = max( amax, S[ offsetS + (i * strideS) ] );
10086
}
101-
} else { // uplo === 'L', order === 'col-major'
87+
} else { // uplo === 'L'
10288
jj = 0;
10389
for ( i = 1; i < N; i++ ) {
104-
jj += N - i + 1;
90+
if ( order === 'row-major' ) {
91+
jj += i + 1;
92+
} else { // order === 'column-major'
93+
jj += N - i + 1;
94+
}
10595
S[ offsetS + (i * strideS) ] = AP[ offsetAP + (jj * strideAP) ];
10696
smin = min( smin, S[ offsetS + (i * strideS) ] );
10797
amax = max( amax, S[ offsetS + (i * strideS) ] );

0 commit comments

Comments
 (0)