Skip to content

Commit 0f43988

Browse files
committed
chore: cleanup
--- 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: passed - 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 f7e0090 commit 0f43988

File tree

8 files changed

+58
-61
lines changed

8 files changed

+58
-61
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# dlarfg
2222

23-
> LAPACK routine to generate a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; x]` zeros out `X`.
23+
> LAPACK routine to generate a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; X]` zeros out `X`.
2424
2525
<section class="usage">
2626

@@ -32,7 +32,7 @@ var dlarfg = require( '@stdlib/lapack/base/dlarfg' );
3232

3333
#### dlarfg( N, X, incx, out )
3434

35-
Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; x]` zeros out `X`.
35+
Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; X]` zeros out `X`.
3636

3737
```javascript
3838
var Float64Array = require( '@stdlib/array/float64' );
@@ -48,9 +48,9 @@ dlarfg( 4, X, 1, out );
4848
The function has the following parameters:
4949

5050
- **N**: number of rows/columns of the elementary reflector `H`.
51-
- **X**: overwritten by the vector `V` on exit, expects `N - 1` indexed elements [`Float64Array`][mdn-float64array].
51+
- **X**: a [`Float64Array`][mdn-float64array] which is overwritten by the vector `V`. Should have `N - 1` indexed elements.
5252
- **incx**: stride length of `X`.
53-
- **out**: output [`Float64Array`][mdn-float64array], the first element of `out` represents alpha and the second element of `out` represents `tau`.
53+
- **out**: output [`Float64Array`][mdn-float64array]. The first element of `out` represents alpha and the second element of `out` represents `tau`.
5454

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

@@ -74,7 +74,7 @@ dlarfg( 4, X1, 1, out1 );
7474

7575
#### dlarfg.ndarray( N, X, strideX, offsetX, out, strideOut, offsetOut )
7676

77-
Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; x]` zeros out `X` using alternative indexing semantics.
77+
Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; X]` zeros out `X` using alternative indexing semantics.
7878

7979
```javascript
8080
var Float64Array = require( '@stdlib/array/float64' );
@@ -90,10 +90,10 @@ dlarfg.ndarray( 4, X, 1, 0, out, 1, 0 );
9090
The function has the following parameters:
9191

9292
- **N**: number of rows/columns of the elementary reflector `H`.
93-
- **X**: overwritten by the vector `V` on exit, expects `N - 1` indexed elements [`Float64Array`][mdn-float64array].
93+
- **X**: a [`Float64Array`][mdn-float64array] which is overwritten by the vector `V`. Should have `N - 1` indexed elements.
9494
- **strideX**: stride length of `X`.
9595
- **offsetX**: starting index of `X`.
96-
- **out**: output [`Float64Array`][mdn-float64array], the first element of `out` represents alpha and the second element of `out` represents `tau`.
96+
- **out**: output [`Float64Array`][mdn-float64array]. The first element of `out` represents alpha and the second element of `out` represents `tau`.
9797
- **strideOut**: stride length of `out`.
9898
- **offsetOut**: starting index of `out`.
9999

@@ -118,9 +118,9 @@ dlarfg.ndarray( 4, X, 1, 1, out, 1, 1 );
118118

119119
## Notes
120120

121-
- `H` is a Householder matrix with the form `H = I - tau * [1; v] * [1, v^T]`, where `tau` is a scalar and `v` is a vector.
122-
- the input vector is `[alpha; x]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
123-
- the result of applying `H` to `[alpha; x]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
121+
- `H` is a Householder matrix with the form `H = I - tau * [1; V] * [1, V^T]`, where `tau` is a scalar and `V` is a vector.
122+
- the input vector is `[alpha; X]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
123+
- the result of applying `H` to `[alpha; X]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
124124
- if all elements of `X` are zero, then `tau = 0` and `H` is the identity matrix.
125125
- otherwise, `1 <= tau <= 2`
126126
- `dlarfg()` corresponds to the [LAPACK][lapack] routine [`dlarfg`][lapack-dlarfg].

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
{{alias}}( N, X, incx, out )
33
Generates a real elementary reflector `H` of order `N` such that applying
4-
`H` to a vector `[alpha; x]` zeros out `X`.
4+
`H` to a vector `[alpha; X]` zeros out `X`.
55

6-
`H` is a Householder matrix with the form `H = I - tau * [1; v] * [1, v^T]`,
7-
where `tau` is a scalar and `v` is a vector. The input vector is
8-
`[alpha; x]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element
9-
vector. The result of applying `H` to `[alpha; x]` is `[beta; 0]`, with
6+
`H` is a Householder matrix with the form `H = I - tau * [1; V] * [1, V^T]`,
7+
where `tau` is a scalar and `V` is a vector. The input vector is
8+
`[alpha; X]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element
9+
vector. The result of applying `H` to `[alpha; X]` is `[beta; 0]`, with
1010
`beta` being a scalar and the rest of the vector zeroed. If all elements of
1111
`X` are zero, then `tau = 0` and `H` is the identity matrix. Otherwise,
1212
`1 <= tau <= 2`.
@@ -43,12 +43,12 @@
4343

4444
{{alias}}.ndarray( N, X, strideX, offsetX, out, strideOut, offsetOut )
4545
Generates a real elementary reflector `H` of order `N` such that applying
46-
`H` to a vector `[alpha; x]` zeros out `X`.
46+
`H` to a vector `[alpha; X]` zeros out `X`.
4747

48-
`H` is a Householder matrix with the form `H = I - tau * [1; v] * [1, v^T]`,
49-
where `tau` is a scalar and `v` is a vector. The input vector is
50-
`[alpha; x]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element
51-
vector. The result of applying `H` to `[alpha; x]` is `[beta; 0]`, with
48+
`H` is a Householder matrix with the form `H = I - tau * [1; V] * [1, V^T]`,
49+
where `tau` is a scalar and `V` is a vector. The input vector is
50+
`[alpha; X]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element
51+
vector. The result of applying `H` to `[alpha; X]` is `[beta; 0]`, with
5252
`beta` being a scalar and the rest of the vector zeroed. If all elements of
5353
`X` are zero, then `tau = 0` and `H` is the identity matrix. Otherwise,
5454
`1 <= tau <= 2`.

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
*/
2424
interface Routine {
2525
/**
26-
* Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; x]` zeros out `X`.
26+
* Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; X]` zeros out `X`.
2727
*
2828
* ## Notes
2929
*
30-
* - `H` is a Householder matrix with the form `H = I - tau * [1; v] * [1, v^T]`, where `tau` is a scalar and `v` is a vector.
31-
* - the input vector is `[alpha; x]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
32-
* - the result of applying `H` to `[alpha; x]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
30+
* - `H` is a Householder matrix with the form `H = I - tau * [1; V] * [1, V^T]`, where `tau` is a scalar and `V` is a vector.
31+
* - the input vector is `[alpha; X]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
32+
* - the result of applying `H` to `[alpha; X]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
3333
* - if all elements of `X` are zero, then `tau = 0` and `H` is the identity matrix.
3434
* - otherwise, `1 <= tau <= 2`
3535
*
@@ -52,13 +52,13 @@ interface Routine {
5252
( N: number, X: Float64Array, incx: number, out: Float64Array ): void;
5353

5454
/**
55-
* Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; x]` zeros out `X`.
55+
* Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; X]` zeros out `X`.
5656
*
5757
* ## Notes
5858
*
59-
* - `H` is a Householder matrix with the form `H = I - tau * [1; v] * [1, v^T]`, where `tau` is a scalar and `v` is a vector.
60-
* - the input vector is `[alpha; x]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
61-
* - the result of applying `H` to `[alpha; x]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
59+
* - `H` is a Householder matrix with the form `H = I - tau * [1; V] * [1, V^T]`, where `tau` is a scalar and `V` is a vector.
60+
* - the input vector is `[alpha; X]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
61+
* - the result of applying `H` to `[alpha; X]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
6262
* - if all elements of `X` are zero, then `tau = 0` and `H` is the identity matrix.
6363
* - otherwise, `1 <= tau <= 2`
6464
*
@@ -85,13 +85,13 @@ interface Routine {
8585
}
8686

8787
/**
88-
* Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; x]` zeros out `X`.
88+
* Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; X]` zeros out `X`.
8989
*
9090
* ## Notes
9191
*
92-
* - `H` is a Householder matrix with the form `H = I - tau * [1; v] * [1, v^T]`, where `tau` is a scalar and `v` is a vector.
93-
* - the input vector is `[alpha; x]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
94-
* - the result of applying `H` to `[alpha; x]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
92+
* - `H` is a Householder matrix with the form `H = I - tau * [1; V] * [1, V^T]`, where `tau` is a scalar and `V` is a vector.
93+
* - the input vector is `[alpha; X]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
94+
* - the result of applying `H` to `[alpha; X]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
9595
* - if all elements of `X` are zero, then `tau = 0` and `H` is the identity matrix.
9696
* - otherwise, `1 <= tau <= 2`
9797
*

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

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ var dlapy2 = require( '@stdlib/lapack/base/dlapy2' );
3131
// MAIN //
3232

3333
/**
34-
* Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; x]` zeros out `X`.
34+
* Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; X]` zeros out `X`.
3535
*
3636
* ## Notes
3737
*
38-
* - `H` is a Householder matrix with the form `H = I - tau * [1; v] * [1, v^T]`, where `tau` is a scalar and `v` is a vector.
39-
* - the input vector is `[alpha; x]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
40-
* - the result of applying `H` to `[alpha; x]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
38+
* - `H` is a Householder matrix with the form `H = I - tau * [1; V] * [1, V^T]`, where `tau` is a scalar and `V` is a vector.
39+
* - the input vector is `[alpha; X]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
40+
* - the result of applying `H` to `[alpha; X]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
4141
* - if all elements of `X` are zero, then `tau = 0` and `H` is the identity matrix.
4242
* - otherwise, `1 <= tau <= 2`
4343
*
@@ -49,7 +49,7 @@ var dlapy2 = require( '@stdlib/lapack/base/dlapy2' );
4949
* @param {Float64Array} out - array to store `alpha` and `tau`, first indexed element stores `alpha` and the second indexed element stores `tau`
5050
* @param {integer} strideOut - stride length for `out`
5151
* @param {NonNegativeInteger} offsetOut - starting index of `out`
52-
* @returns {void} overwrites the array `X` and `out` in place
52+
* @returns {void}
5353
*
5454
* @example
5555
* var Float64Array = require( '@stdlib/array/float64' );
@@ -72,40 +72,37 @@ function dlarfg( N, X, strideX, offsetX, out, strideOut, offsetOut ) {
7272
var i;
7373

7474
if ( N <= 1 ) {
75-
tau = 0.0; // tau = 0.0
76-
out[ offsetOut + strideOut ] = tau;
75+
out[ offsetOut + strideOut ] = 0.0;
7776
return;
7877
}
7978

8079
xnorm = dnrm2( N - 1, X, strideX, offsetX );
8180
alpha = out[ offsetOut ];
8281

8382
if ( xnorm === 0.0 ) {
84-
tau = 0.0; // tau = 0.0
85-
out[ strideOut + offsetOut ] = tau;
83+
out[ strideOut + offsetOut ] = 0.0;
8684
} else {
8785
beta = -1.0 * sign( dlapy2( alpha, xnorm ), alpha );
88-
safemin = dlamch( 'S' ) / dlamch( 'E' );
86+
safemin = dlamch( 'safemin' ) / dlamch( 'epsilon' );
8987
knt = 0;
9088
if ( abs( beta ) < safemin ) {
9189
rsafmin = 1.0 / safemin;
9290
while ( abs( beta ) < safemin && knt < 20 ) {
9391
knt += 1;
9492
dscal( N-1, rsafmin, X, strideX, offsetX );
9593
beta *= rsafmin;
96-
alpha *= rsafmin; // alpha *= rsafmin
94+
alpha *= rsafmin;
9795
}
9896
xnorm = dnrm2( N - 1, X, strideX, offsetX );
9997
beta = -1.0 * sign( dlapy2( alpha, xnorm ), alpha );
10098
}
101-
tau = ( beta - alpha ) / beta; // tau = (beta - alpha) / beta
99+
tau = ( beta - alpha ) / beta;
102100
dscal( N-1, 1.0 / ( alpha - beta ), X, strideX, offsetX );
103101
for ( i = 0; i < knt; i++ ) {
104102
beta *= safemin;
105103
}
106-
alpha = beta;
107104

108-
out[ offsetOut ] = alpha;
105+
out[ offsetOut ] = beta;
109106
out[ strideOut + offsetOut ] = tau;
110107
}
111108
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ var base = require( './base.js' );
2626
// MAIN //
2727

2828
/**
29-
* Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; x]` zeros out `X`.
29+
* Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; X]` zeros out `X`.
3030
*
3131
* ## Notes
3232
*
33-
* - `H` is a Householder matrix with the form `H = I - tau * [1; v] * [1, v^T]`, where `tau` is a scalar and `v` is a vector.
34-
* - the input vector is `[alpha; x]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
35-
* - the result of applying `H` to `[alpha; x]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
33+
* - `H` is a Householder matrix with the form `H = I - tau * [1; V] * [1, V^T]`, where `tau` is a scalar and `V` is a vector.
34+
* - the input vector is `[alpha; X]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
35+
* - the result of applying `H` to `[alpha; X]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
3636
* - if all elements of `X` are zero, then `tau = 0` and `H` is the identity matrix.
3737
* - otherwise, `1 <= tau <= 2`
3838
*
3939
* @param {NonNegativeInteger} N - number of rows/columns of the elementary reflector `H`
4040
* @param {Float64Array} X - overwritten by the vector `V` on exit, expects `N - 1` indexed elements
4141
* @param {integer} incx - stride length for `X`
4242
* @param {Float64Array} out - array to store `alpha` and `tau`, first indexed element stores `alpha` and the second indexed element stores `tau`
43-
* @returns {void} overwrites the array `X` and `out` in place
43+
* @returns {void}
4444
*
4545
* @example
4646
* var Float64Array = require( '@stdlib/array/float64' );

lib/node_modules/@stdlib/lapack/base/dlarfg/lib/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
'use strict';
2020

2121
/**
22-
* LAPACK routine to generate a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; x]` zeros out `X`.
22+
* LAPACK routine to generate a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; X]` zeros out `X`.
2323
*
2424
* ## Notes
2525
*
26-
* - `H` is a Householder matrix with the form `H = I - tau * [1; v] * [1, v^T]`, where `tau` is a scalar and `v` is a vector.
27-
* - the input vector is `[alpha; x]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
28-
* - the result of applying `H` to `[alpha; x]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
26+
* - `H` is a Householder matrix with the form `H = I - tau * [1; V] * [1, V^T]`, where `tau` is a scalar and `V` is a vector.
27+
* - the input vector is `[alpha; X]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
28+
* - the result of applying `H` to `[alpha; X]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
2929
* - if all elements of `X` are zero, then `tau = 0` and `H` is the identity matrix.
3030
* - otherwise, `1 <= tau <= 2`
3131
*

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ var base = require( './base.js' );
2626
// MAIN //
2727

2828
/**
29-
* Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; x]` zeros out `X` using alternative indexing semantics.
29+
* Generates a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; X]` zeros out `X` using alternative indexing semantics.
3030
*
3131
* ## Notes
3232
*
33-
* - `H` is a Householder matrix with the form `H = I - tau * [1; v] * [1, v^T]`, where `tau` is a scalar and `v` is a vector.
34-
* - the input vector is `[alpha; x]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
35-
* - the result of applying `H` to `[alpha; x]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
33+
* - `H` is a Householder matrix with the form `H = I - tau * [1; V] * [1, V^T]`, where `tau` is a scalar and `V` is a vector.
34+
* - the input vector is `[alpha; X]`, where `alpha` is a scalar and `X` is a real `(n-1)`-element vector.
35+
* - the result of applying `H` to `[alpha; X]` is `[beta; 0]`, with `beta` being a scalar and the rest of the vector zeroed.
3636
* - if all elements of `X` are zero, then `tau = 0` and `H` is the identity matrix.
3737
* - otherwise, `1 <= tau <= 2`
3838
*
@@ -43,7 +43,7 @@ var base = require( './base.js' );
4343
* @param {Float64Array} out - array to store `alpha` and `tau`, first indexed element stores `alpha` and the second indexed element stores `tau`
4444
* @param {integer} strideOut - stride length for `out`
4545
* @param {NonNegativeInteger} offsetOut - starting index of `out`
46-
* @returns {void} overwrites the array `X` and `out` in place
46+
* @returns {void}
4747
*
4848
* @example
4949
* var Float64Array = require( '@stdlib/array/float64' );

lib/node_modules/@stdlib/lapack/base/dlarfg/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@stdlib/lapack/base/dlarfg",
33
"version": "0.0.0",
4-
"description": "LAPACK routine to generate a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; x]` zeros out `X`.",
4+
"description": "LAPACK routine to generate a real elementary reflector `H` of order `N` such that applying `H` to a vector `[alpha; X]` zeros out `X`.",
55
"license": "Apache-2.0",
66
"author": {
77
"name": "The Stdlib Authors",

0 commit comments

Comments
 (0)