Skip to content

Commit 08ac549

Browse files
committed
chore: clean-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: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - 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: passed - task: lint_license_headers status: passed ---
1 parent 5f3e534 commit 08ac549

File tree

11 files changed

+304
-195
lines changed

11 files changed

+304
-195
lines changed

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

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ limitations under the License.
2424
2525
<section class="intro">
2626

27-
In linear algebra, a `Householder transformation` (or an `elementary reflector`) is a linear transformation that describes a reflection about a plane or a hyperplane containing the origin.
27+
A **Householder transformation** (or an **elementary reflector**) is a linear transformation that describes a reflection about a plane or a hyperplane containing the origin.
2828

2929
</section>
3030

@@ -38,7 +38,7 @@ In linear algebra, a `Householder transformation` (or an `elementary reflector`)
3838
var dlarf1f = require( '@stdlib/lapack/base/dlarf1f' );
3939
```
4040

41-
#### dlarf1f( order, side, M, N, V, incv, tau, C, LDC, work )
41+
#### dlarf1f( order, side, M, N, V, strideV, tau, C, LDC, work )
4242

4343
Applies a real elementary reflector `H = I - tau * v * v^T` to a real M by N matrix `C`.
4444

@@ -58,11 +58,11 @@ var out = dlarf1f( 'row-major', 'left', 4, 3, V, 1, 1.0, C, 3, work );
5858
The function has the following parameters:
5959

6060
- **order**: storage layout.
61-
- **side**: specifies the side of multiplication with `C`. Use `'left'` to form `H * C` and `'right'` to form `C * H`.
61+
- **side**: specifies the side of multiplication with `C`.
6262
- **M**: number of rows in `C`.
6363
- **N**: number of columns in `C`.
6464
- **V**: the vector `v` as a [`Float64Array`][mdn-float64array].
65-
- **incv**: stride length for `V`. If `incv` is negative, the elements of `V` are accessed in reverse order.
65+
- **strideV**: stride length for `V`. If `strideV` is negative, the elements of `V` are accessed in reverse order.
6666
- **tau**: scalar constant.
6767
- **C**: input matrix stored in linear memory as a [`Float64Array`][mdn-float64array].
6868
- **LDC**: stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`).
@@ -71,14 +71,16 @@ The function has the following parameters:
7171
When `side` is `'left'`,
7272

7373
- `work` should have `N` indexed elements.
74-
- `V` should have `1 + (M-1) * abs(incv)` indexed elements.
74+
- `V` should have `1 + (M-1) * abs(strideV)` indexed elements.
75+
- `C` is overwritten by `H * C`.
7576

7677
When `side` is `'right'`,
7778

7879
- `work` should have `M` indexed elements.
79-
- `V` should have `1 + (N-1) * abs(incv)` indexed elements.
80+
- `V` should have `1 + (N-1) * abs(strideV)` indexed elements.
81+
- `C` is overwritten by `C * H`.
8082

81-
The sign of the increment parameter `incv` determines the order in which elements of `V` are accessed. For example, to access elements in reverse order,
83+
The sign of the increment parameter `strideV` determines the order in which elements of `V` are accessed. For example, to access elements in reverse order,
8284

8385
<!-- eslint-disable max-len -->
8486

@@ -93,7 +95,7 @@ var out = dlarf1f( 'row-major', 'left', 4, 3, V, -1, 1.0, C, 3, work );
9395
// returns <Float64Array>[ ~-3.80, -8.6, ~-13.4, ~0.56, 1.92, ~3.28, ~1.08, ~1.56, ~2.04, ~1.60, ~1.20, ~0.80 ]
9496
```
9597

96-
To perform strided access over `V`, provide an `abs(incv)` value greater than one. For example, to access every other element in `V`,
98+
To perform strided access over `V`, provide an `abs(strideV)` value greater than one. For example, to access every other element in `V`,
9799

98100
<!-- eslint-disable max-len -->
99101

@@ -148,7 +150,7 @@ var out = dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 );
148150

149151
The function has the following additional parameters:
150152

151-
- **side**: specifies the side of multiplication with `C`. Use `'left'` to form `H * C` and `'right'` to form `C * H`.
153+
- **side**: specifies the side of multiplication with `C`.
152154
- **M**: number of rows in `C`.
153155
- **N**: number of columns in `C`.
154156
- **V**: the vector `v` as a [`Float64Array`][mdn-float64array].
@@ -166,12 +168,14 @@ The function has the following additional parameters:
166168
When `side` is `'left'`,
167169

168170
- `work` should have `N` indexed elements.
169-
- `V` should have `1 + (M-1) * abs(incv)` indexed elements.
171+
- `V` should have `1 + (M-1) * abs(sv)` indexed elements.
172+
- `C` is overwritten by `H * C`.
170173

171174
When `side` is `'right'`,
172175

173176
- `work` should have `M` indexed elements.
174-
- `V` should have `1 + (N-1) * abs(incv)` indexed elements.
177+
- `V` should have `1 + (N-1) * abs(sv)` indexed elements.
178+
- `C` is overwritten by `C * H`.
175179

176180
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,
177181

@@ -196,7 +200,6 @@ var out = dlarf1f.ndarray( 'left', 4, 3, V, 1, 2, 1.0, C, 3, 1, 4, work, 1, 0 );
196200

197201
## Notes
198202

199-
- `C` is overwritten by `H * C` if side = `'left'` and `C * H` if side = `'right'`.
200203
- `dlarf1f()` corresponds to the [LAPACK][LAPACK] function [`dlarf1f`][lapack-dlarf1f].
201204

202205
</section>
@@ -226,7 +229,7 @@ var strides = shape2strides( shape, order );
226229
var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] );
227230
console.log( ndarray2array( C, shape, strides, 0, order ) );
228231

229-
// Define the vector `v` and workspace array:
232+
// Define the vector `v` and a workspace array:
230233
var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] );
231234
var work = new Float64Array( 3 );
232235

lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function createBenchmark( order, N, side ) {
6060
var work = new Float64Array( N );
6161
var C = discreteUniform( N*N, 1.0, 10.0, opts );
6262
var V = new Float64Array( N );
63-
V[ N-1 ] = 1.0; // keeping only the last element non zero to ensure maximum iterations but minimum overflow
63+
V[ N-1 ] = 1.0; // keeping only the last element nonzero to ensure maximum iterations but minimum overflow
6464
return benchmark;
6565

6666
/**

lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.ndarray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function createBenchmark( order, N, side ) {
6767
work = new Float64Array( N );
6868
C = discreteUniform( N*N, 1.0, 10.0, opts );
6969
V = new Float64Array( N );
70-
V[ N-1 ] = 1.0; // keeping only the last element non zero to ensure maximum iterations but minimum overflow
70+
V[ N-1 ] = 1.0; // keeping only the last element nonzero to ensure maximum iterations but minimum overflow
7171
if ( isColumnMajor( order ) ) {
7272
sc1 = 1;
7373
sc2 = N;

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

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11

2-
{{alias}}( order, side, M, N, V, incv, tau, C, LDC, work )
3-
Applies a real elementary reflector `H = I - tau * v * v^T` to a
4-
real M by N matrix `C`.
2+
{{alias}}( order, side, M, N, V, strideV, tau, C, LDC, work )
3+
Applies a real elementary reflector `H = I - tau * v * v^T` to a real M by N
4+
matrix `C`.
5+
6+
If `side = 'left'`,
7+
8+
- `work` should have `N` indexed elements.
9+
- `V` should have `1 + (M-1) * abs(strideV)` indexed elements.
10+
- `C` is overwritten by `H * C`.
11+
12+
If `side = 'right'`,
13+
14+
- `work` should have `M` indexed elements.
15+
- `V` should have `1 + (N-1) * abs(strideV)` indexed elements.
16+
- `C` is overwritten by `C * H`.
517

618
Parameters
719
----------
@@ -21,7 +33,7 @@
2133
V: Float64Array
2234
The vector `v`.
2335

24-
incv: integer
36+
strideV: integer
2537
Stride length for `V`.
2638

2739
tau: number
@@ -52,8 +64,20 @@
5264

5365

5466
{{alias}}.ndarray( side, M, N, V, sv, ov, tau, C, sc1, sc2, oc, work, sw, ow )
55-
Applies a real elementary reflector `H = I - tau * v * v^T` to a real
56-
M by N matrix `C` using alternative indexing semantics.
67+
Applies a real elementary reflector `H = I - tau * v * v^T` to a real M by N
68+
matrix `C` using alternative indexing semantics.
69+
70+
If `side = 'left'`,
71+
72+
- `work` should have `N` indexed elements.
73+
- `V` should have `1 + (M-1) * abs(sv)` indexed elements.
74+
- `C` is overwritten by `H * C`.
75+
76+
If `side = 'right'`,
77+
78+
- `work` should have `M` indexed elements.
79+
- `V` should have `1 + (N-1) * abs(sv)` indexed elements.
80+
- `C` is overwritten by `C * H`.
5781

5882
Parameters
5983
----------

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

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818

1919
// TypeScript Version: 4.1
2020

21-
/**
22-
* Must be either `'left'` or `'right'`.
23-
*/
24-
type Side = 'left' | 'right';
21+
/// <reference types="@stdlib/types"/>
22+
23+
import { Layout, OperationSide } from '@stdlib/types/blas';
2524

2625
/**
2726
* Interface describing `dlarf1f`.
@@ -30,14 +29,29 @@ interface Routine {
3029
/**
3130
* Applies a real elementary reflector `H = I - tau * v * v^T` to a real M by N matrix `C`.
3231
*
33-
* @param side - specifies the side of multiplication with `C`. Use `'left'` to form `H * C` and `'right'` to form `C * H`.
32+
* ## Notes
33+
*
34+
* - If `side = 'left'`,
35+
*
36+
* - `work` should have `N` indexed elements.
37+
* - `V` should have `1 + (M-1) * abs(strideV)` indexed elements.
38+
* - `C` is overwritten by `H * C`.
39+
*
40+
* - If `side = 'right'`,
41+
*
42+
* - `work` should have `M` indexed elements.
43+
* - `V` should have `1 + (N-1) * abs(strideV)` indexed elements.
44+
* - `C` is overwritten by `C * H`.
45+
*
46+
* @param order - storage layout
47+
* @param side - specifies the side of multiplication with `C`.
3448
* @param M - number of rows in `C`
3549
* @param N - number of columns in `C`
3650
* @param V - the vector `v`
37-
* @param incv - stride length for `V`
51+
* @param strideV - stride length for `V`
3852
* @param tau - scalar constant
3953
* @param C - input matrix
40-
* @param ldc - leading dimension of `C`
54+
* @param ldc - stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`)
4155
* @param work - workspace array
4256
* @returns `C * H` or `H * C`
4357
*
@@ -48,15 +62,29 @@ interface Routine {
4862
* var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] );
4963
* var work = new Float64Array( 3 );
5064
*
51-
* dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, work );
65+
* dlarf1f( 'row-major', 'left', 4, 3, V, 1, 1.0, C, 3, work );
5266
* // returns <Float64Array>[ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ]
5367
*/
54-
( side: Side, M: number, N: number, V: Float64Array, incv: number, tau: number, C: Float64Array, ldc: number, work: Float64Array ): Float64Array;
68+
( order: Layout, side: OperationSide, M: number, N: number, V: Float64Array, strideV: number, tau: number, C: Float64Array, ldc: number, work: Float64Array ): Float64Array;
5569

5670
/**
5771
* Applies a real elementary reflector `H = I - tau * v * v^T` to a real M by N matrix `C` using alternative indexing semantics.
5872
*
59-
* @param side - specifies the side of multiplication with `C`. Use `'left'` to form `H * C` and `'right'` to form `C * H`.
73+
* ## Notes
74+
*
75+
* - If `side = 'left'`,
76+
*
77+
* - `work` should have `N` indexed elements.
78+
* - `V` should have `1 + (M-1) * abs(strideV)` indexed elements.
79+
* - `C` is overwritten by `H * C`.
80+
*
81+
* - If `side = 'right'`,
82+
*
83+
* - `work` should have `M` indexed elements.
84+
* - `V` should have `1 + (N-1) * abs(strideV)` indexed elements.
85+
* - `C` is overwritten by `C * H`.
86+
*
87+
* @param side - specifies the side of multiplication with `C`
6088
* @param M - number of rows in `C`
6189
* @param N - number of columns in `C`
6290
* @param V - the vector `v`
@@ -82,20 +110,35 @@ interface Routine {
82110
* dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 );
83111
* // returns <Float64Array>[ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ]
84112
*/
85-
ndarray( side: Side, M: number, N: number, V: Float64Array, strideV: number, offsetV: number, tau: number, C: Float64Array, strideC1: number, strideC2: number, offsetC: number, work: Float64Array, strideWork: number, offsetWork: number ): Float64Array;
113+
ndarray( side: OperationSide, M: number, N: number, V: Float64Array, strideV: number, offsetV: number, tau: number, C: Float64Array, strideC1: number, strideC2: number, offsetC: number, work: Float64Array, strideWork: number, offsetWork: number ): Float64Array;
86114
}
87115

88116
/**
89117
* Applies a real elementary reflector `H = I - tau * v * v^T` to a real M by N matrix `C`.
90118
*
91-
* @param side - specifies the side of multiplication with `C`. Use `'left'` to form `H * C` and `'right'` to form `C * H`.
119+
* ## Notes
120+
*
121+
* - If `side = 'left'`,
122+
*
123+
* - `work` should have `N` indexed elements.
124+
* - `V` should have `1 + (M-1) * abs(strideV)` indexed elements.
125+
* - `C` is overwritten by `H * C`.
126+
*
127+
* - If `side = 'right'`,
128+
*
129+
* - `work` should have `M` indexed elements.
130+
* - `V` should have `1 + (N-1) * abs(strideV)` indexed elements.
131+
* - `C` is overwritten by `C * H`.
132+
*
133+
* @param order - storage layout
134+
* @param side - specifies the side of multiplication with `C`
92135
* @param M - number of rows in `C`
93136
* @param N - number of columns in `C`
94137
* @param V - the vector `v`
95-
* @param incv - stride length for `V`
138+
* @param strideV - stride length for `V`
96139
* @param tau - scalar constant
97140
* @param C - input matrix
98-
* @param ldc - leading dimension of `C`
141+
* @param ldc - stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`)
99142
* @param work - workspace array
100143
* @returns `C * H` or `H * C`
101144
*
@@ -106,7 +149,7 @@ interface Routine {
106149
* var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] );
107150
* var work = new Float64Array( 3 );
108151
*
109-
* dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, work );
152+
* dlarf1f( 'row-major', 'left', 4, 3, V, 1, 1.0, C, 3, work );
110153
* // returns <Float64Array>[ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ]
111154
*
112155
* @example

0 commit comments

Comments
 (0)