Skip to content

Commit 44bdd16

Browse files
committed
chore: code review
--- 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: na - 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: na - task: lint_license_headers status: passed ---
1 parent cdb43aa commit 44bdd16

File tree

9 files changed

+47
-38
lines changed

9 files changed

+47
-38
lines changed

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

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ limitations under the License.
1818
1919
-->
2020

21-
<!-- lint disable max-len -->
22-
2321
# claswp
2422

2523
> Perform a series of row interchanges on an input matrix.
@@ -36,6 +34,8 @@ var claswp = require( '@stdlib/lapack/base/claswp' );
3634

3735
Performs a series of row interchanges on an input matrix `A` using pivot indices stored in `IPIV`.
3836

37+
<!-- eslint-disable max-len -->
38+
3939
```javascript
4040
var Int32Array = require( '@stdlib/array/int32' );
4141
var Complex64Array = require( '@stdlib/array/complex64' );
@@ -51,7 +51,7 @@ The function has the following parameters:
5151

5252
- **order**: storage layout.
5353
- **N**: number of columns in `A`.
54-
- **A**: input matrix stored in linear memory as a [`Complex64Array`][Complex64Array].
54+
- **A**: input matrix stored in linear memory as a [`Complex64Array`][complex64array].
5555
- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`).
5656
- **k1**: index of first row to interchange when `incx` is positive and the index of the last row to interchange when `incx` is negative.
5757
- **k2**: index of last row to interchange when `incx` is positive and the index of the first row to interchange when `incx` is negative.
@@ -60,6 +60,8 @@ The function has the following parameters:
6060

6161
The sign of the increment parameter `incx` determines the order in which pivots are applied. For example, to apply pivots in reverse order,
6262

63+
<!-- eslint-disable max-len -->
64+
6365
```javascript
6466
var Int32Array = require( '@stdlib/array/int32' );
6567
var Complex64Array = require( '@stdlib/array/complex64' );
@@ -73,6 +75,8 @@ claswp( 'row-major', 2, A, 2, 0, 2, IPIV, -1 );
7375

7476
To perform strided access over `IPIV`, provide an `abs(incx)` value greater than one. For example, to access every other element in `IPIV`,
7577

78+
<!-- eslint-disable max-len -->
79+
7680
```javascript
7781
var Int32Array = require( '@stdlib/array/int32' );
7882
var Complex64Array = require( '@stdlib/array/complex64' );
@@ -86,7 +90,7 @@ claswp( 'row-major', 2, A, 2, 0, 2, IPIV, 2 );
8690

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

89-
<!-- eslint-disable stdlib/capitalized-comments -->
93+
<!-- eslint-disable stdlib/capitalized-comments, max-len -->
9094

9195
```javascript
9296
var Int32Array = require( '@stdlib/array/int32' );
@@ -108,6 +112,8 @@ claswp( 'row-major', 2, A1, 2, 0, 2, IPIV1, 1 );
108112

109113
Performs a series of row interchanges on the matrix `A` using pivot indices stored in `IPIV` and alternative indexing semantics.
110114

115+
<!-- eslint-disable max-len -->
116+
111117
```javascript
112118
var Int32Array = require( '@stdlib/array/int32' );
113119
var Complex64Array = require( '@stdlib/array/complex64' );
@@ -122,7 +128,7 @@ claswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 );
122128
The function has the following additional parameters:
123129

124130
- **N**: number of columns in `A`.
125-
- **A**: input matrix stored in linear memory as a [`Complex64Array`][Complex64Array].
131+
- **A**: input matrix stored in linear memory as a [`Complex64Array`][complex64array].
126132
- **sa1**: stride of the first dimension of `A`.
127133
- **sa2**: stride of the second dimension of `A`.
128134
- **oa**: starting index for `A`.
@@ -168,6 +174,8 @@ claswp.ndarray( 2, A, 2, 1, 2, 0, 2, 1, IPIV, 1, 2 );
168174

169175
## Examples
170176

177+
<!-- eslint-disable max-len -->
178+
171179
<!-- eslint no-undef: "error" -->
172180

173181
```javascript
@@ -183,7 +191,7 @@ var offset = 0;
183191
var order = 'column-major';
184192

185193
// Create a matrix stored in linear memory:
186-
var A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] ); // eslint-disable-line max-len
194+
var A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ] );
187195
console.log( ndarray2array( A, shape, strides, offset, order ) );
188196

189197
// Define a vector of pivot indices:
@@ -284,7 +292,7 @@ TODO
284292

285293
[lapack-claswp]: https://www.netlib.org/lapack/explore-html/d1/d7e/group__laswp_ga9171d769b6ff8099934a845677e336b1.html
286294

287-
[Complex64Array]: https://github.com/stdlib-js/stdlib/blob/develop/lib/node_modules/%40stdlib/array/complex64/README.md
295+
[complex64array]: https://github.com/stdlib-js/stdlib/blob/develop/lib/node_modules/%40stdlib/array/complex64/README.md
288296

289297
[mdn-int32array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array
290298

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@ var opts = {
5555
*/
5656
function createBenchmark( order, N, nrows ) {
5757
var IPIV;
58+
var abuf;
5859
var A;
5960

6061
IPIV = discreteUniform( nrows, 0, N-1, {
6162
'dtype': 'int32'
6263
});
63-
A = new Complex64Array( uniform( 2*N*N, -10.0, 10.0, opts ) );
64+
65+
abuf = uniform( 2*N*N, -10.0, 10.0, opts );
66+
A = new Complex64Array( abuf );
6467

6568
return benchmark;
6669

@@ -71,18 +74,17 @@ function createBenchmark( order, N, nrows ) {
7174
* @param {Benchmark} b - benchmark instance
7275
*/
7376
function benchmark( b ) {
74-
var z;
7577
var i;
7678

7779
b.tic();
7880
for ( i = 0; i < b.iterations; i++ ) {
79-
z = claswp( order, N, A, N, 0, nrows-1, IPIV, 1 );
80-
if ( isnan( z[ i%z.length ] ) ) {
81+
claswp( order, N, A, N, 0, nrows-1, IPIV, 1 );
82+
if ( isnan( abuf[ i%abuf.length ] ) ) {
8183
b.fail( 'should not return NaN' );
8284
}
8385
}
8486
b.toc();
85-
if ( isnan( z[ i%z.length ] ) ) {
87+
if ( isnan( abuf[ i%abuf.length ] ) ) {
8688
b.fail( 'should not return NaN' );
8789
}
8890
b.pass( 'benchmark finished' );

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ var opts = {
5555
*/
5656
function createBenchmark( order, N, nrows ) {
5757
var IPIV;
58+
var abuf;
5859
var sa1;
5960
var sa2;
6061
var A;
@@ -69,7 +70,9 @@ function createBenchmark( order, N, nrows ) {
6970
IPIV = discreteUniform( nrows, 0, N-1, {
7071
'dtype': 'int32'
7172
});
72-
A = new Complex64Array( uniform( 2*N*N, -10.0, 10.0, opts ) );
73+
74+
abuf = uniform( 2*N*N, -10.0, 10.0, opts );
75+
A = new Complex64Array( abuf );
7376

7477
return benchmark;
7578

@@ -80,18 +83,17 @@ function createBenchmark( order, N, nrows ) {
8083
* @param {Benchmark} b - benchmark instance
8184
*/
8285
function benchmark( b ) {
83-
var z;
8486
var i;
8587

8688
b.tic();
8789
for ( i = 0; i < b.iterations; i++ ) {
88-
z = claswp( N, A, sa1, sa2, 0, 0, nrows-1, 1, IPIV, 1, 0 );
89-
if ( isnan( z[ i%z.length ] ) ) {
90+
claswp( N, A, sa1, sa2, 0, 0, nrows-1, 1, IPIV, 1, 0 );
91+
if ( isnan( abuf[ i%abuf.length ] ) ) {
9092
b.fail( 'should not return NaN' );
9193
}
9294
}
9395
b.toc();
94-
if ( isnan( z[ i%z.length ] ) ) {
96+
if ( isnan( abuf[ i%abuf.length ] ) ) {
9597
b.fail( 'should not return NaN' );
9698
}
9799
b.pass( 'benchmark finished' );

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
Examples
4545
--------
4646
> var IPIV = new {{alias:@stdlib/array/int32}}( [ 1, 1 ] );
47-
> var A = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
47+
> var v = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ];
48+
> var A = new {{alias:@stdlib/array/complex64}}( v );
4849
> var ord = 'row-major';
4950
> {{alias}}( ord, 2, A, 2, 0, 1, IPIV, 1 )
5051
<Complex64Array>[ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ]
@@ -111,7 +112,8 @@
111112
Examples
112113
--------
113114
> var IPIV = new {{alias:@stdlib/array/int32}}( [ 1, 1 ] );
114-
> var A = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
115+
> var v = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ];
116+
> var A = new {{alias:@stdlib/array/complex64}}( v );
115117
> {{alias}}.ndarray( 2, A, 2, 1, 0, 0, 1, 1, IPIV, 1, 0 )
116118
<Complex64Array>[ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ]
117119

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import { Layout } from '@stdlib/types/blas';
2424
import { Complex64Array } from '@stdlib/types/array';
2525

26-
2726
/**
2827
* Interface describing `claswp`.
2928
*/

lib/node_modules/@stdlib/lapack/base/claswp/examples/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var offset = 0;
3030
var order = 'column-major';
3131

3232
// Create a matrix stored in linear memory:
33-
var A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] ); // eslint-disable-line max-len
33+
var A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ] ); // eslint-disable-line max-len
3434
console.log( ndarray2array( A, shape, strides, offset, order ) );
3535

3636
// Define a vector of pivot indices:

lib/node_modules/@stdlib/lapack/base/claswp/test/fixtures/row_major_k1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
"A_out_mat": [
3737
[ 21.0, 22.0, 23.0, 24.0 ],
38-
[ 17.0, 18.0, 19.0,20.0 ],
38+
[ 17.0, 18.0, 19.0, 20.0 ],
3939
[ 13.0, 14.0, 15.0, 16.0 ],
4040
[ 9.0, 10.0, 11.0, 12.0 ],
4141
[ 5.0, 6.0, 7.0, 8.0 ],

lib/node_modules/@stdlib/lapack/base/claswp/test/test.claswp.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ tape( 'the function efficiently handles large datasets (column-major)', function
277277
var expectedBuf;
278278
var expected;
279279
var IPIV;
280-
var Abuf;
280+
var abuf;
281281
var buf;
282282
var mat;
283283
var out;
@@ -297,11 +297,10 @@ tape( 'the function efficiently handles large datasets (column-major)', function
297297

298298
// Define an input matrix in linear storage:
299299
A = new Complex64Array( buf );
300-
301-
Abuf = reinterpret( A, 0 );
300+
abuf = reinterpret( A, 0 );
302301

303302
// Convert to a nested array:
304-
mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord );
303+
mat = ndarray2array( abuf, [ sh[0], sh[1], 2 ], [ 2*st[0], 2*st[1], 1 ], o, ord );
305304

306305
// Create an array of pivot indices:
307306
IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] );
@@ -473,7 +472,7 @@ tape( 'the function efficiently handles large datasets (row-major)', function te
473472
var expectedMat;
474473
var expected;
475474
var IPIV;
476-
var Abuf;
475+
var abuf;
477476
var buf;
478477
var mat;
479478
var out;
@@ -493,11 +492,10 @@ tape( 'the function efficiently handles large datasets (row-major)', function te
493492

494493
// Define an input matrix in linear storage:
495494
A = new Complex64Array( buf );
496-
497-
Abuf = reinterpret( A, 0 );
495+
abuf = reinterpret( A, 0 );
498496

499497
// Convert to a nested array:
500-
mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord );
498+
mat = ndarray2array( abuf, [ sh[0], sh[1], 2 ], [ 2*st[0], 2*st[1], 1 ], o, ord );
501499

502500
// Create an array of pivot indices:
503501
IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] );

lib/node_modules/@stdlib/lapack/base/claswp/test/test.ndarray.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ tape( 'the function efficiently handles large datasets (column-major)', function
289289
var expectedBuf;
290290
var expected;
291291
var IPIV;
292-
var Abuf;
292+
var abuf;
293293
var buf;
294294
var mat;
295295
var out;
@@ -309,11 +309,10 @@ tape( 'the function efficiently handles large datasets (column-major)', function
309309

310310
// Define an input matrix in linear storage:
311311
A = new Complex64Array( buf );
312-
313-
Abuf = reinterpret( A, 0 );
312+
abuf = reinterpret( A, 0 );
314313

315314
// Convert to a nested array:
316-
mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord );
315+
mat = ndarray2array( abuf, [ sh[0], sh[1], 2 ], [ 2*st[0], 2*st[1], 1 ], o, ord );
317316

318317
// Create an array of pivot indices:
319318
IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] );
@@ -548,7 +547,7 @@ tape( 'the function efficiently handles large datasets (row-major)', function te
548547
var expectedMat;
549548
var expected;
550549
var IPIV;
551-
var Abuf;
550+
var abuf;
552551
var buf;
553552
var mat;
554553
var out;
@@ -568,11 +567,10 @@ tape( 'the function efficiently handles large datasets (row-major)', function te
568567

569568
// Define an input matrix in linear storage:
570569
A = new Complex64Array( buf );
571-
572-
Abuf = reinterpret( A, 0 );
570+
abuf = reinterpret( A, 0 );
573571

574572
// Convert to a nested array:
575-
mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord );
573+
mat = ndarray2array( abuf, [ sh[0], sh[1], 2 ], [ 2*st[0], 2*st[1], 1 ], o, ord );
576574

577575
// Create an array of pivot indices:
578576
IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] );

0 commit comments

Comments
 (0)