Skip to content

Commit 44c54a9

Browse files
committed
docs: update docs
--- 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: passed - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 086fc3c commit 44c54a9

File tree

6 files changed

+64
-53
lines changed

6 files changed

+64
-53
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ The function has the following parameters:
112112
- **N**: number of columns in `A`.
113113
- **A**: input [`Float64Array`][mdn-float64array].
114114
- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`).
115-
- **work**: [`Float64Array`][mdn-float64array] used to compute the infinity norm, should have `M` indexed elements if computing the infinity norm otherwise it's fine to pass a dummy array.
115+
- **work**: [`Float64Array`][mdn-float64array] used as a temporary workspace.
116+
117+
`work` should have `N` indexed elements if calculating the one norm in a row-major layout and `M` indexed elements if calculating the infinity norm in column-major layout, in all other cases it is fine to pass a dummy [`Float64Array`][mdn-float64array].
116118

117119
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
118120

@@ -175,10 +177,12 @@ The function has the following additional parameters:
175177
- **strideA1**: stride of the first dimension of `A`.
176178
- **strideA2**: stride of the second dimension of `A`.
177179
- **offsetA**: starting index for `A`.
178-
- **work**: [`Float64Array`][mdn-float64array] used to compute the infinity norm, should have `M` indexed elements if computing the infinity norm otherwise it's fine to pass a dummy array.
180+
- **work**: [`Float64Array`][mdn-float64array] used as a temporary workspace
179181
- **strideWork**: stride length of `work`.
180182
- **offsetWork**: starting index of `work`.
181183

184+
`work` should have `N` indexed elements if calculating the one norm in a row-major layout and `M` indexed elements if calculating the infinity norm in column-major layout, in all other cases it is fine to pass a dummy [`Float64Array`][mdn-float64array].
185+
182186
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example,
183187

184188
<!-- eslint-disable max-len -->

lib/node_modules/@stdlib/lapack/base/dlange/docs/repl.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
matrix `A`).
3131

3232
work: Float64Array
33-
Work array used to compute the infinity norm, should have `M` indexed
34-
elements if computing the infinity norm otherwise pass a dummy array.
33+
Temporary workspace array. `work` should have `N` indexed elements if
34+
computing the one norm in row-major layout and `M` indexed elements
35+
if computing infinity norm in column-major layout.
3536

3637
Returns
3738
-------
@@ -82,8 +83,9 @@
8283
Starting index for `A`.
8384

8485
work: Float64Array
85-
Work array used to compute the infinity norm, should have `M` indexed
86-
elements if computing the infinity norm otherwise pass a dummy array.
86+
Temporary workspace array. `work` should have `N` indexed elements if
87+
computing the one norm in row-major layout and `M` indexed elements
88+
if computing infinity norm in column-major layout.
8789

8890
sw: integer
8991
Stride length for `work`.

lib/node_modules/@stdlib/lapack/base/dlange/docs/types/index.d.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ interface Routine {
4545
*
4646
* ## Notes
4747
*
48-
* - use `norm` = `max`, to calculate the element with the largest absolute value
49-
* - use `norm` = `one`, to calculate the one norm
50-
* - use `norm` = `infinity`, to calculate the infinity norm
51-
* - use `norm` = `frobenius`, to calculate the frobenius norm
48+
* - use `norm` = `max` to calculate the element with the largest absolute value
49+
* - use `norm` = `one` to calculate the one norm, work should have `N` indexed elements if row-major layout is used
50+
* - use `norm` = `infinity` to calculate the infinity norm, work should have `M` indexed elements if column-major layout is used
51+
* - use `norm` = `frobenius` to calculate the frobenius norm
5252
*
5353
* @param order - storage layout
5454
* @param norm - specifies the type of norm to be calculated
5555
* @param M - number of rows in `A`
5656
* @param N - number of columns in `A`
5757
* @param A - input array
5858
* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`)
59-
* @param work - only used to compute the infinity norm, should have `M` indexed elements if computing the infinity norm otherwise it's fine to pass a dummy array
59+
* @param work - temporary workspace array
6060
* @returns required norm value
6161
*
6262
* @example
@@ -75,10 +75,10 @@ interface Routine {
7575
*
7676
* ## Notes
7777
*
78-
* - use `norm` = `max`, to calculate the element with the largest absolute value
79-
* - use `norm` = `one`, to calculate the one norm
80-
* - use `norm` = `infinity`, to calculate the infinity norm
81-
* - use `norm` = `frobenius`, to calculate the frobenius norm
78+
* - use `norm` = `max` to calculate the element with the largest absolute value
79+
* - use `norm` = `one` to calculate the one norm, work should have `N` indexed elements if row-major layout is used
80+
* - use `norm` = `infinity` to calculate the infinity norm, work should have `M` indexed elements if column-major layout is used
81+
* - use `norm` = `frobenius` to calculate the frobenius norm
8282
*
8383
* @param norm - specifies the type of norm to be calculated
8484
* @param M - number of rows in `A`
@@ -87,7 +87,7 @@ interface Routine {
8787
* @param strideA1 - stride of the first dimension of `A`
8888
* @param strideA2 - stride of the second dimension of `A`
8989
* @param offsetA - starting index of `A`
90-
* @param work - only used to compute the infinity norm, should have `M` indexed elements if computing the infinity norm otherwise it's fine to pass a dummy array
90+
* @param work - temporary workspace array
9191
* @param strideWork - stride length of `work`
9292
* @param offsetWork - starting index of `work`
9393
* @returns required norm value
@@ -109,18 +109,18 @@ interface Routine {
109109
*
110110
* ## Notes
111111
*
112-
* - use `norm` = `max`, to calculate the element with the largest absolute value
113-
* - use `norm` = `one`, to calculate the one norm
114-
* - use `norm` = `infinity`, to calculate the infinity norm
115-
* - use `norm` = `frobenius`, to calculate the frobenius norm
112+
* - use `norm` = `max` to calculate the element with the largest absolute value
113+
* - use `norm` = `one` to calculate the one norm, work should have `N` indexed elements if row-major layout is used
114+
* - use `norm` = `infinity` to calculate the infinity norm, work should have `M` indexed elements if column-major layout is used
115+
* - use `norm` = `frobenius` to calculate the frobenius norm
116116
*
117117
* @param order - storage layout
118118
* @param norm - specifies the type of norm to be calculated
119119
* @param M - number of rows in `A`
120120
* @param N - number of columns in `A`
121121
* @param A - input array
122122
* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`)
123-
* @param work - only used to compute the infinity norm, should have `M` indexed elements if computing the infinity norm otherwise it's fine to pass a dummy array
123+
* @param work - temporary workspace array
124124
* @returns required norm value
125125
*
126126
* @example

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

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var abs = require( '@stdlib/math/base/special/abs' );
4343
* @param {integer} strideA1 - stride of the first dimension of `A`
4444
* @param {integer} strideA2 - stride of the second dimension of `A`
4545
* @param {NonNegativeInteger} offsetA - starting index of `A`
46-
* @param {Float64Array} work - work array, should have `N` indexed elements
46+
* @param {Float64Array} work - work array, should have `N` indexed elements if row-major layout is used
4747
* @param {integer} strideWork - stride length of `work`
4848
* @param {NonNegativeInteger} offsetWork - starting index of `work`
4949
* @returns {number} required norm value
@@ -180,7 +180,7 @@ function maxAbs( M, N, A, strideA1, strideA2, offsetA ) {
180180
* @param {integer} strideA1 - stride of the first dimension of `A`
181181
* @param {integer} strideA2 - stride of the second dimension of `A`
182182
* @param {NonNegativeInteger} offsetA - starting index of `A`
183-
* @param {Float64Array} work - work array, should have `M` indexed elements
183+
* @param {Float64Array} work - work array, should have `M` indexed elements if column-major layout is used
184184
* @param {integer} strideWork - stride length of `work`
185185
* @param {NonNegativeInteger} offsetWork - starting index of `work`
186186
* @returns {number} required norm value
@@ -268,30 +268,35 @@ function infinityNorm( M, N, A, strideA1, strideA2, offsetA, work, strideWork, o
268268
* // returns ~25.5
269269
*/
270270
function frobeniusNorm( M, N, A, strideA1, strideA2, offsetA ) {
271-
var value;
272-
var ia1;
273271
var out;
272+
var da0;
273+
var da1;
274+
var S1;
275+
var S2;
276+
var ia;
274277
var i;
275278

276279
out = new Float64Array( [ 0.0, 1.0 ] );
277280

278281
if ( isRowMajor( [ strideA1, strideA2 ] ) ) {
279-
ia1 = offsetA;
280-
for ( i = 0; i < M; i++ ) {
281-
dlassq( N, A, strideA2, ia1, out[ 0 ], out[ 1 ], out, 1, 0 );
282-
ia1 += strideA1;
283-
}
284-
value = out[ 0 ] * sqrt( out[ 1 ] );
282+
S1 = M;
283+
S2 = N;
284+
da0 = strideA2;
285+
da1 = strideA1;
285286
} else {
286-
ia1 = offsetA;
287-
for ( i = 0; i < N; i++ ) {
288-
dlassq( M, A, strideA1, ia1, out[ 0 ], out[ 1 ], out, 1, 0 );
289-
ia1 += strideA2;
290-
}
291-
value = out[ 0 ] * sqrt( out[ 1 ] );
287+
S1 = N;
288+
S2 = M;
289+
da0 = strideA1;
290+
da1 = strideA2;
292291
}
293292

294-
return value;
293+
ia = offsetA;
294+
for ( i = 0; i < S1; i++ ) {
295+
dlassq( S2, A, da0, ia, out[ 0 ], out[ 1 ], out, 1, 0 );
296+
ia += da1;
297+
}
298+
299+
return out[ 0 ] * sqrt( out[ 1 ] );
295300
}
296301

297302

@@ -302,10 +307,10 @@ function frobeniusNorm( M, N, A, strideA1, strideA2, offsetA ) {
302307
*
303308
* ## Notes
304309
*
305-
* - use `norm` = `max`, to calculate the element with the largest absolute value
306-
* - use `norm` = `one`, to calculate the one norm
307-
* - use `norm` = `infinity`, to calculate the infinity norm
308-
* - use `norm` = `frobenius`, to calculate the frobenius norm
310+
* - use `norm` = `max` to calculate the element with the largest absolute value
311+
* - use `norm` = `one` to calculate the one norm, work should have `N` indexed elements if row-major layout is used
312+
* - use `norm` = `infinity` to calculate the infinity norm, work should have `M` indexed elements if column-major layout is used
313+
* - use `norm` = `frobenius` to calculate the frobenius norm
309314
*
310315
* @private
311316
* @param {string} norm - specifies the type of norm to be calculated
@@ -315,7 +320,7 @@ function frobeniusNorm( M, N, A, strideA1, strideA2, offsetA ) {
315320
* @param {integer} strideA1 - stride of the first dimension of `A`
316321
* @param {integer} strideA2 - stride of the second dimension of `A`
317322
* @param {NonNegativeInteger} offsetA - starting index of `A`
318-
* @param {Float64Array} work - only used to compute the infinity norm, should have `M` indexed elements if computing the infinity norm otherwise it's fine to pass a dummy array
323+
* @param {Float64Array} work - temporary workspace array
319324
* @param {integer} strideWork - stride length of `work`
320325
* @param {NonNegativeInteger} offsetWork - starting index of `work`
321326
* @returns {number} required norm value

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ var base = require( './base.js' );
3737
*
3838
* ## Notes
3939
*
40-
* - use `norm` = `max`, to calculate the element with the largest absolute value
41-
* - use `norm` = `one`, to calculate the one norm
42-
* - use `norm` = `infinity`, to calculate the infinity norm
43-
* - use `norm` = `frobenius`, to calculate the frobenius norm
40+
* - use `norm` = `max` to calculate the element with the largest absolute value
41+
* - use `norm` = `one` to calculate the one norm, work should have `N` indexed elements if row-major layout is used
42+
* - use `norm` = `infinity` to calculate the infinity norm, work should have `M` indexed elements if column-major layout is used
43+
* - use `norm` = `frobenius` to calculate the frobenius norm
4444
*
4545
* @private
4646
* @param {string} order - storage layout
@@ -49,7 +49,7 @@ var base = require( './base.js' );
4949
* @param {NonNegativeInteger} N - number of columns in `A`
5050
* @param {Float64Array} A - input array
5151
* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`)
52-
* @param {Float64Array} work - only used to compute the infinity norm, should have `M` indexed elements if computing the infinity norm otherwise it's fine to pass a dummy array
52+
* @param {Float64Array} work - temporary workspace array
5353
* @throws {TypeError} first argument must be a valid order
5454
* @throws {TypeError} second argument must be a valid operation
5555
* @throws {RangeError} sixth argument must be greater than or equal to max(1,N)

lib/node_modules/@stdlib/lapack/base/dlange/lib/ndarray.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ var base = require( './base.js' );
3333
*
3434
* ## Notes
3535
*
36-
* - use `norm` = `max`, to calculate the element with the largest absolute value
37-
* - use `norm` = `one`, to calculate the one norm
38-
* - use `norm` = `infinity`, to calculate the infinity norm
39-
* - use `norm` = `frobenius`, to calculate the frobenius norm
36+
* - use `norm` = `max` to calculate the element with the largest absolute value
37+
* - use `norm` = `one` to calculate the one norm, work should have `N` indexed elements if row-major layout is used
38+
* - use `norm` = `infinity` to calculate the infinity norm, work should have `M` indexed elements if column-major layout is used
39+
* - use `norm` = `frobenius` to calculate the frobenius norm
4040
*
4141
* @param {string} norm - specifies the type of norm to be calculated
4242
* @param {NonNegativeInteger} M - number of rows in `A`
@@ -45,7 +45,7 @@ var base = require( './base.js' );
4545
* @param {integer} strideA1 - stride of the first dimension of `A`
4646
* @param {integer} strideA2 - stride of the second dimension of `A`
4747
* @param {NonNegativeInteger} offsetA - starting index of `A`
48-
* @param {Float64Array} work - only used to compute the infinity norm, should have `M` indexed elements if computing the infinity norm otherwise it's fine to pass a dummy array
48+
* @param {Float64Array} work - temporary workspace array
4949
* @param {integer} strideWork - stride length of `work`
5050
* @param {NonNegativeInteger} offsetWork - starting index of `work`
5151
* @throws {TypeError} first argument must be a valid operation

0 commit comments

Comments
 (0)