Skip to content

Commit 805e889

Browse files
committed
chore: cleaning up
--- 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: passed - 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 2e1ec09 commit 805e889

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

lib/node_modules/@stdlib/lapack/base/dlacn2/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ dlacn2( 4, V, X, ISGN, EST, KASE, ISAVE );
5555
The function has the following parameters:
5656

5757
- **N**: number of rows/columns in `A`.
58-
- **V**: workspace [`Float64Array`][mdn-float64array] having `N` indexed elements, used internally to store intermediate vectors.
59-
- **X**: input/output [`Float64Array`][mdn-float64array] having `N` indexed elements, contains the current or next matrix-vector product.
60-
- **ISGN**: [`Int32Array`][mdn-int32array] having `N` indexed elements, stores the sign of each element in `X` during iterations.
61-
- **EST**: single-element [`Float64Array`][mdn-float64array], on output, contains the estimated one-norm of the matrix `A`.
58+
- **V**: workspace [`Float64Array`][mdn-float64array] having `N` indexed elements. This workspace is used internally to store intermediate vectors.
59+
- **X**: input/output [`Float64Array`][mdn-float64array] having `N` indexed elements. This array contains the current or next matrix-vector product.
60+
- **ISGN**: [`Int32Array`][mdn-int32array] having `N` indexed elements. This array stores the sign of each element in `X` during iterations.
61+
- **EST**: single-element [`Float64Array`][mdn-float64array], on output. This array contains the estimated one-norm of the matrix `A`.
6262
- **KASE**: single-element [`Int32Array`][mdn-int32array] that controls the reverse communication.
63-
- **ISAVE**: [`Int32Array`][mdn-int32array] having 3 indexed elements, used internally to maintain state across multiple calls.
63+
- **ISAVE**: [`Int32Array`][mdn-int32array] having 3 indexed elements. This array is used internally to maintain state across multiple calls.
6464

65-
The reverse communication takes place using `KASE`, it may have any of these values:
65+
The reverse communication takes place using `KASE`. The single-element in `KASE` may have the following values:
6666

6767
- `0`: estimation is complete.
6868
- `1`: caller must compute `A * X` and store the result back in `X`.
@@ -134,24 +134,24 @@ dlacn2.ndarray( 4, V, 1, 0, X, 1, 0, ISGN, 1, 0, EST, 0, KASE, 0, ISAVE, 1, 0 );
134134
The function has the following parameters:
135135

136136
- **N**: number of rows/columns in `A`.
137-
- **V**: workspace [`Float64Array`][mdn-float64array] having `N` indexed elements, used internally to store intermediate vectors.
137+
- **V**: workspace [`Float64Array`][mdn-float64array] having `N` indexed elements. This workspace is used internally to store intermediate vectors.
138138
- **sv**: stride length for `V`.
139139
- **ov**: starting index for `V`.
140-
- **X**: input/output [`Float64Array`][mdn-float64array] having `N` indexed elements, contains the current or next matrix-vector product.
140+
- **X**: input/output [`Float64Array`][mdn-float64array] having `N` indexed elements. This array contains the current or next matrix-vector product.
141141
- **sx**: stride length for `X`.
142142
- **ox**: starting index for `X`.
143-
- **ISGN**: [`Int32Array`][mdn-int32array] having `N` indexed elements, stores the sign of each element in `X` during iterations.
143+
- **ISGN**: [`Int32Array`][mdn-int32array] having `N` indexed elements. This array stores the sign of each element in `X` during iterations.
144144
- **sisgn**: stride length for `ISGN`.
145145
- **oisgn**: starting index for `ISGN`.
146-
- **EST**: single-element [`Float64Array`][mdn-float64array], on output, contains the estimated one-norm of the matrix `A`.
146+
- **EST**: single-element [`Float64Array`][mdn-float64array], on output. This array contains the estimated one-norm of the matrix `A`.
147147
- **oe**: starting index for `EST`.
148148
- **KASE**: single-element [`Int32Array`][mdn-int32array] that controls the reverse communication.
149149
- **ok**: starting index for `KASE`.
150-
- **ISAVE**: [`Int32Array`][mdn-int32array] having 3 indexed elements, used internally to maintain state across multiple calls.
150+
- **ISAVE**: [`Int32Array`][mdn-int32array] having 3 indexed elements. This array is used internally to maintain state across multiple calls.
151151
- **sisave**: stride length for `ISAVE`.
152152
- **oisave**: starting index for `ISAVE`.
153153

154-
The reverse communication takes place using `KASE`, it may have any of these values:
154+
The reverse communication takes place using `KASE`. The single-element in `KASE` may have the following values:
155155

156156
- `0`: estimation is complete.
157157
- `1`: caller must compute `A * X` and store the result back in `X`.

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ function isaveIsTwo( N, X, strideX, offsetX, KASE, offsetKASE, ISAVE, strideISAV
180180
var i1;
181181

182182
i1 = offsetISAVE + strideISAVE;
183-
ISAVE[ i1 ] = idamax( N, X, strideX, offsetX ); // stores the index of the max element in X
183+
ISAVE[ i1 ] = idamax( N, X, strideX, offsetX ); // stores the index of the max absolute value in X
184184
ISAVE[ i1 + strideISAVE ] = 2;
185-
xmax = offsetX + ( ISAVE[ i1 ] * strideX ); // pointer to the max element in X
185+
xmax = offsetX + ( ISAVE[ i1 ] * strideX ); // pointer to the max absolute value in X
186186

187187
dfill( N, 0.0, X, strideX, offsetX );
188188

@@ -317,13 +317,16 @@ function isaveIsFour( N, X, strideX, offsetX, ISAVE, strideISAVE, offsetISAVE, K
317317
var prevxmax;
318318
var jlast;
319319
var xmax;
320+
var i1;
320321
var i2;
321322

322-
jlast = ISAVE[ offsetISAVE + strideISAVE ];
323-
prevxmax = offsetX + ( jlast * strideX ); // points to X[ isave(1) ]
324-
ISAVE[ offsetISAVE + strideISAVE ] = idamax( N, X, strideX, offsetX );
325-
xmax = offsetX + ( ISAVE[ offsetISAVE + strideISAVE ] * strideX ); // points to the largest value in X
326-
i2 = offsetISAVE + ( 2 * strideISAVE ); // points to isave(2), the number of refinement iterations
323+
i1 = offsetISAVE + strideISAVE;
324+
i2 = i1 + strideISAVE; // points to ISAVE( 2 ), the number of refinement operations
325+
326+
jlast = ISAVE[ i1 ];
327+
prevxmax = offsetX + ( jlast * strideX ); // points to the largest absolute value in X from the previous iteration
328+
ISAVE[ i1 ] = idamax( N, X, strideX, offsetX );
329+
xmax = offsetX + ( ISAVE[ i1 ] * strideX ); // points to the largest absolute value in X
327330

328331
if ( X[ prevxmax ] !== abs( X[ xmax ] ) && ISAVE[ i2 ] < 5 ) {
329332
ISAVE[ i2 ] += 1;

0 commit comments

Comments
 (0)